Currently the NERDTree buffer opens for every file that you open. If I'm writing to *.scala, *.py, etc. But I don't want this to happen for certain files that I'm writing (such as Haskell). For example, when I'm opening a Haskell file, I don't want the NERDTree buffer to open as soon as I type in vim file.hs
in the terminal. Does anyone know how to get this to work?
You probably use something like this in your ~/.vimrc
to automatically open NERDTree:
:autocmd VimEnter * NERDTree
You just need to add a conditional, e.g. to suppress the opening when any files are passed to Vim:
:autocmd VimEnter * if argc() == 0 | NERDTree | endif
As the VimEnter command fires after buffers have been loaded, you can also check for the current 'filetype'
value to suppress only, say, Haskell files:
:autocmd VimEnter * if &filetype !=# 'haskell' | NERDTree | endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With