Vim colours in Mac OS X disappeared

  • Thread starter Thread starter cepheid
  • Start date Start date
  • Tags Tags
    Mac Os
Click For Summary
SUMMARY

The issue of missing syntax highlighting in Vim on Mac OS X can be resolved by adding the line "syntax on" to the /usr/share/vim/vimrc file. This problem arose after modifications were made to the ~/.bash_profile in an attempt to enable color output for the ls command. Users should verify their Vim installation, which typically comes with the Xcode developer tools. Restoring default coloring in Vim is straightforward by adjusting the configuration file.

PREREQUISITES
  • Familiarity with Vim text editor
  • Basic understanding of Mac OS X file system
  • Knowledge of shell configuration files, specifically ~/.bash_profile
  • Experience with Xcode developer tools installation
NEXT STEPS
  • Learn how to configure Vim settings in /usr/share/vim/vimrc
  • Explore Vim color schemes and how to apply them
  • Research troubleshooting techniques for syntax highlighting issues in Vim
  • Understand the use of terminal color settings in Mac OS X
USEFUL FOR

Mac OS X users, developers working with C source files, and anyone looking to enhance their Vim experience through color coding and syntax highlighting.

cepheid
Staff Emeritus
Science Advisor
Gold Member
Messages
5,197
Reaction score
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
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).
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
60
Views
11K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
16K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K