0

I'm trying to figure out how to configure ViM so that when it starts up it shows my Tagbar plugin and NERDTree plugin, but I don't want it to show up when I'm committing files in GIT. So far I have...

if has("autocmd")
  " startup with tagbar window shown
  autocmd VimEnter * TagbarToggle

  " startup with nerdtree window shown
  autocmd VimEnter * NERDTreeToggle

  " startup in the correct window
  autocmd VimEnter * wincmd l
endif

This does everything except for when its in Git commit message. How can I check for the file?

I've tried if

if !globpath( '.', '**/.git/' )
    echom 'youre not in a git file'
endif
iamnewton
  • 329
  • 3
  • 9
  • 1
    You may want to avoid using NerdTree/Tagbar as an always on "project drawer". Vim does not do project drawers and therefore this workflow become inconvenient especially when using splits. The other issue is wasted space. How often do us look at or use NerdTree/Tagbar? 10% of the time? Less? Why not just toggle open up these plugins when you need instead of have them open all the time. I have a post that discusses similar topics: [Files, Buffers, and Splits Oh My!](http://stackoverflow.com/a/23121220/438329) – Peter Rincker Nov 06 '14 at 19:04
  • @PeterRincker fair enough. You make a good point, so thanks. – iamnewton Nov 06 '14 at 19:33

0 Answers0