Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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...

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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