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

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?

Answers


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


You probably need to set up an autocmd in your .vimrc to recognise the appropriate file as a rebase -i temporary:

autocmd BufNewFile,BufRead git-rebase-todo setf gitrebase

Then you just need to use a syntax file ~/.vim/syntax/gitrebase.vim and put in whatever highlighting commands match your preferences such as the one supplied with recents vims: http://code.google.com/p/vim/source/browse/runtime/syntax/gitrebase.vim


Need Your Help

Hibernate, @SequenceGenerator and allocationSize

java hibernate jpa hilo

We all know the default behaviour of Hibernate when using @SequenceGenerator - it increases real database sequence by one, multiple this value by 50 (default allocationSize value) - and then uses t...

Travis-CI build failure "The type or namespace name 'Extensions' does not exist in the namespace"

c# .net .net-core travis-ci

Still new to Travis-CI and wanted to see if it's something I'm doing or not. I'm getting a build error in Travis-CI, but not locally.