I have
cmap w!! %!sudo tee > /dev/null %
in my .vimrc
.
When I type a w
while writing in the vim command line (after :
), the cursor stays over the w
for a few seconds before moving right. This sometimes breaks my train of thought and confuses me for a few seconds. Is there a way to make the mapping happen when pressing enter after the command so that it doesn't temporarily "eat" the w
every time I press it?
(Incidentally, this mapping also makes w!!
expand when I'm typing a search query which isn't annoying in practice (except for the fact that the w
is similarly delayed) but seems strange.)