How to turn on git syntax highlighting on vim on a Mac

7,018

I just figured out all I need is to create a ~/.vimrc file with a line that reads

syntax on
Share:
7,018

Related videos on Youtube

Christoph
Author by

Christoph

Updated on September 18, 2022

Comments

  • Christoph
    Christoph over 1 year

    I just recently switched over to Mac. On windows I was using git through the msysgit project. When doing a git rebase -i I'm used to get a nice syntax highlighting in vim. I'm missing it badly now that I'm on Mac. How can I get it back?

    • Admin
      Admin over 11 years
      the colors for the git log etc do work, yes. I have git config --global color.ui true
    • Admin
      Admin over 11 years
      Did you not copy your previous Vim config over?
    • Admin
      Admin over 11 years
      msysgitseemed to abstract all those difficulties away from the end user. All the highlighting worked just out of the box so until my first interactive rebase on my new MacBook I didn't even know that something like a vim config does even exist :)
    • Admin
      Admin over 11 years
      as a side note, may i introduce you to vim-fugitive ? github.com/tpope/vim-fugitive (see the screencasts on vimcast.org vimcasts.org/episodes/…)
    • Admin
      Admin over 11 years
      Need to check it out :)
  • Admin
    Admin over 11 years
    I created the .vimrcat ~/ with the line that you postet and also created the gitrebase.vim file at ~/.vim/syntax/ with the content from that link. Then I reopened the terminal and tried it. It doesn't work. Anything I might be missing?
  • Admin
    Admin over 11 years
    Ok, I just figured out all I need is that .vimrc file with a line that reads syntax on
  • snowe2010
    snowe2010 about 8 years
    you should mark your answer as correct. It helped me for sure!