Thursday, 22 August 2013

Vim autocommand not triggering on search?

Vim autocommand not triggering on search?

I've got the following line in my .vimrc:
autocmd BufNewFile,BufReadPost $HOME/git/repo/* set sw=2 ts=2 et
I use this because I need to follow the conventions of a particular git
repository. However, I've noticed that when I search with the ':vim'
command I don't get the intended indentation settings applied.
Let's say that I search for the string abc using :vim /abc/ ** and this
opens the first hit in the file X - vim opens a new buffer for the file
because it was not previously opened. Why does it not trigger the
BufReadPost event?

No comments:

Post a Comment