I am trying to add :autocmd BufWrite * make
to modeline in vim, but it is not triggered. I see that the help says only set <options>
can be used in modelines. Is there a way to achieve this effect, where I write a file to run make
.
Asked
Active
Viewed 615 times
1 Answers
3
Set your autocmd in your ~/.vimrc
with a pattern that will match your file name. I would also suggest using augroup
so it can be made to be re-sourced.
augroup my_project
autocmd!
autocmd BufWrite /project/*.c make
augroup END
For more help see:
:h :au
:h :aug

Peter Rincker
- 43,539
- 9
- 74
- 101