I’ve just found something rather useful in vim: :set wildmode. Normally in vim, you can use TAB to complete filenames. So you enter
:e some/ve<TAB> and vim pads it out to
:e some/very_long_filename.html. Lovely.
But in a directory full of files with similar prefixes, it’s less than helpful. I hit
:e acc<TAB> and vim expands to
:e acc_click_here_to_continue.html. But then I need to backspace all the way back so it reads
:e acc and hit TAB again. This is a pain.
But, if you stick
set wildmode=longest,full into
~/.vimrc, then vim stops when it’s completed the longest unique prefix (“acc”) and gives you a chance to type. Or, if you just keep banging on the TAB key like a deranged gibbon it will start rotating through all the possible completions. But by stopping at that point, I get a chance to intervene.
It sounds like a teeny-tiny little thing. But it’s one less thing that’s getting in the way of me doing things.
That said, any time saved has already been wiped out by writing this blog entry.