From time to time I accidentally create files with names like ":w" or ":q". This happens when instead of writing :wq
I type :w:q
and sometimes, for some reason, even :w:w
or :w :w
. And this has become too frequent to ignore.
My solution to this problem would be to make vim throw an error if :w
is given a filename that starts with a colon. Are there ways to force vim to behave like that? Or maybe there is another obvious solution I am missing?