> You're working on a large project, so I would advise caution when
doing
> tab completion. If you happened to be waiting on an accidental (slow)
> completion like a<Tab>, then hit Ctrl-c to stop it.
Yes, I love how vim is nice and intuitive if Linux stuff is ingrained in
your every move :)
> Nope, no (easy) way. That's just how Vim was implemented. You could
hack
> the source code though.
>
> If you don't have any other commands besides :Sfind beginning with
"Sf",
> you can just do :Sf instead of the full :Sfind. It's an extra Shift
> keystroke.
That is a shame. Regrettably I have enough coding to do without hacking
through the source for vim and getting it to compile on Windows; I'm
sure I could do it in Linux in a couple of minutes but that wouldn't
help me at work much! Curses. However I have found a rather nice
solution (see below).
> An (untested) alternative I just thought of is to do something like
this
> (Vim 7):
>
> cnoremap <silent><expr>:
getcmdpos()==1?toupper(nr2char(getchar())):':'
That is rather great, although it doesn't work with the <silent> tag in
there. That is, it DOES work, but it is somewhat confusing. Because of
the <silent> the result of the ":getchar()" will not be displayed in the
command line, meaning if you enter "::sf" then you will see on the
command line ":f ". Note the space after the "f". If you now press
backspace the command line changes to ":S". Removing the <silent> makes
the remapping of : work perfectly.
However I was playing around and came up with an alternative mapping
which makes me grin all over. It is a really logical continuation of the
remapping of : that you provided:
cnoremap <expr>sf getcmdpos()==1?'Sf':'sf'
Brilliant! It works exactly as I want, and if you pause after the "s"
before typing the "f" (for timeoutlen) then it aborts the remap and
gives you a lowercase "sf".
Thanks for your help Gerald, I hope this thread helps others in their
time of need!
Max