Vim colours in Mac OS X disappeared

  • Thread starter cepheid
  • Start date
  • Tags
    Mac Os
In summary, the conversation discusses an issue with the color-coding in vim for a C source file on a Mac OS X. The problem arose after making changes to the .bash_profile to enable color-coding for the ls command. However, even after undoing the changes, the issue persists. The solution is found by adding the line "syntax on" to the vimrc file. It is also mentioned that the confusion could have stemmed from using vim on a Linux box via SSH.
  • #1
cepheid
Staff Emeritus
Science Advisor
Gold Member
5,199
38
When I open a C source file in vim in Mac OS X, syntax is no longer colour-coded. I think that this happened after I tinkered around with ~/.bash_profile. I did the latter because I was trying to get ls to use colours, and I found an article online that told me what lines to add to .bash_profile to get ls colours. But even after commenting out my additions to .bash_profile, the problem remains.

I'm not even sure where vim is installed. I think that I did not have it until I installed the Xcode developer tools (but I could be wrong). Does anyone know how I can restore the default colouring?
 
Last edited by a moderator:
Computer science news on Phys.org
  • #2
Nevermind.

I turn on colours by adding the line "syntax on" to my /usr/share/vim/vimrc file.

It could be that I never had colours in vim on my mac and I was just confused (because I used vim on one of the linux boxes in my lab over ssh -- from my mac).
 

Related to Vim colours in Mac OS X disappeared

1. Why did my Vim colours disappear in Mac OS X?

This could be due to a number of reasons, such as a recent update or changes in your system settings. It could also be caused by conflicts with other applications or plugins.

2. How can I fix the issue with my Vim colours disappearing?

First, try restarting your computer and see if that resolves the issue. If not, try updating your Vim or reinstalling it. You can also check your Vim settings and make sure the correct color scheme is selected.

3. Does this issue only occur in Mac OS X?

No, Vim colour issues can occur in any operating system. However, the steps to resolve the issue may differ depending on the OS.

4. Can I customize my Vim colours in Mac OS X?

Yes, you can customize your Vim colours by selecting a different color scheme or creating your own. You can also adjust the specific colors for different elements within Vim.

5. How can I prevent my Vim colours from disappearing in the future?

To prevent this issue, make sure to regularly update your Vim and check for any conflicts with other applications or plugins. It's also a good idea to save your customized color scheme in case it gets overwritten in the future.

Similar threads

  • Programming and Computer Science
Replies
1
Views
3K
  • Computing and Technology
Replies
5
Views
4K
Replies
60
Views
9K
  • Computing and Technology
Replies
2
Views
2K
  • Programming and Computer Science
Replies
4
Views
15K
  • Computing and Technology
Replies
2
Views
4K
  • Programming and Computer Science
Replies
6
Views
3K
  • Special and General Relativity
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
8K
  • Computing and Technology
Replies
12
Views
2K
Back
Top