What happens when I enter .wq! in vim?
Is there a way to prohibit that behavior?
Asked
Active
Viewed 1,141 times
2 Answers
1
use vim's help to understand each of those
. - repeat last change - :h .
w - move cursor to next word - :h w
q! - q would start recording a macro but since ! isn't a valid register to record the macro to they simply cancel each other
you could add nmap .wq! <Nop> to your vimrc to make this combination a noop but I wouldn't recommend doing that. It would make your . respond slower since it's a prefix for an existing map so if you ever learn more and start using this feature this mapping will annoy you.
sudavid4
- 1,081
- 6
- 14
0
But if you use :.wq! it will try to save the current line, overwriting the current file.
SergioAraujo
- 11,069
- 3
- 50
- 40
-
Is there a way to prohibit it? nmap is not working..... – kiwamunet Mar 02 '18 at 01:26