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 - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -