Call an exclamation mark after defining the command as: wq
I'm looking for a way to make a handle !
after a command like :wq!
. This is in order to make my own function to exit and / or write files. I tried this, but of course it didn't work:
command! -nargs=0 SQ :call <SID>SaveAndQuit(0, 0)
command! -nargs=0 SWQ :call <SID>SaveAndQuit(1, 0)
command! -nargs=0 SQ! :call <SID>SaveAndQuit(0, 1)
command! -nargs=0 SWQ! :call <SID>SaveAndQuit(1, 1)
with function function! <SID>SaveAndQuit( write, force )
. Is there a way to deal with !
?
+3
source to share
1 answer