How to know if vim call from Git, in vimrc -


.gitconfig

    [core]     editor = /usr/bin/vim 

.vimrc

autocmd vimenter * nerdtree ./

i don't want call in git commit.

i want this

    if !gitcommit       autocmd vimenter * nerdtree ./     endif 

this snippet should put in right direction:

augroup isnotgitcommit   autocmd!   autocmd vimenter * nerdtree ./ augroup end  autocmd bufread commit_editmsg autocmd! isnotgitcommit 

the notgitcommit group contains generic autocmd works "regular" file.

the other autocmd triggered when edit commit message, before vimenter event, , removes notgitcommit group.


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -