I want to call a command when I save the file.
I am calling it by :make
manually now, but I wish it could be called when I execute :w
and :wq
.
I also want enable this feature in any subfolder that doesn't contain a Makefile but its parents contains one. Just like this topic said, but it doesn't works for me:
How to efficiently "make" with Vim
AutoSave is disabled by default, run :AutoSaveToggle to enable/disable AutoSave. If you want plugin to be always enabled it can be done with g:auto_save option (place 'let g:auto_save = 1' in your . vimrc). Inspired by the same feature in RubyMine text editor.
Press Esc key and type :w to save a file in vim. One can press Esc and type :wq to save changes to a file and exit from vim. Another option is to press :x.
To save a file in Vim / vi, press Esc key, type :w and hit Enter key. One can save a file and quit vim / Vi by pressing Esc key, type :x and hit Enter key.
:autocmd BufWritePost <buffer> make
au BufWritePost *.c
\ make
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