in VIM sometimes when saving, I accidentally hit capital W instead of its lowercase brother. I am prompted for my system password, so I assume it is running a sudo command of some sort, but do you know what?

Thank you!

link|improve this question
1  
in my vim it gives me "E492: Not an editor command: W" if i try to ":W". – akira May 26 '10 at 16:10
feedback

migrated from stackoverflow.com May 26 '10 at 15:56

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 5 down vote accepted

As others have said, :W isn't defined in vanilla vim (7.0 here), so it sounds like some plugin you've installed has added it.

:command W will tell you what it does.

link|improve this answer
feedback

That's strange. The normal mapping of "W" advances by a WORD, where WORD is defined by a sequence of non-blank characters.

link|improve this answer
@bentsai: OP is not in control-mode but in ex-mode, as in "instead of :w he uses :W" – akira May 26 '10 at 15:59
@akira that makes more sense. – bentsai May 26 '10 at 16:00
feedback

:W doesn't do anything in my copy of VIM (6.4), for what that's worth. What does :help :W tell you? (For me, it just takes me to the help for :w, which wouldn't be, um, help-ful for you. :-) )

link|improve this answer
feedback

You can test this line

{Cursor}It's the test

{Cursor} : Cursor position in normal mode, w: will move word which separated by " ,./?" W: will move word which separated by " " only

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.