How to conclude vim print about saving an unsaved file before compilation?

I always forget to save all files in the buffer before compilation using the vim build compilation command :make. So is it possible to make vim print a hint about saving a file in the same way as what it does when we exit before saving files?

+5
source share
2 answers

Edit Re:

I found that the "autowrite" option may solve this problem in some aspects, but I will also autowrite when I print the next, previous, tag. I am looking for the best solution

You can use QuickFixCmdPre:

:au QuickFixCmdPre * write

make. . :he autocmd.

, , vim's

:make

, , . :!scons -C src, :se makeprg=scons\ -C\ src regular :make Quickfix.

.:


`autowrite`

:set autoread autowrite

.vimrc; , , , .

, (, Visual Studio Notepad ++, ).

- , , C-z, , ( , ), window ( ), .

+4

, :

nnoremap <leader>m :wa <BAR> :make<CR>
  • :wa
  • :make
  • | , .
+5

All Articles