Anyone knows how to configure vim so that line number can show/hide by F10?

Now I'm typing set nu/nonu,which is not convenient...

link|improve this question

25% accept rate
feedback

1 Answer

map <F10> :set number! <- Should do the trick (AFAIK, the ! at the end makes it a toggle, instead of an always-on).

EDIT: Apologies, I forgot an important note (which you may have already known, but it was inconsiderate of me to forget): To make this persistent, add this line to your .vimrc file.

Take a look at this page for reference, and this SO question for more.

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.