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.

This question is not the same as In vim, how can I quickly switch between tabs?, but what I want is a bit similar to it, since we are all trying to find shortcuts when editing with vim:)

Now I am in the following mode:

set number
syntax on
colorscheme desert

Can I switch to the other mode quickly without typing 3 command?

That would be more convenient than inputing lots of commands.

set nonumber
syntax off
colorscheme blue
share|improve this question
add comment

1 Answer

Toggling the number setting is explained in this SO question:

set number
nnoremap <F2> :set nonumber!<CR>

Toggling the syntax highlighting is explained in the vimdoc:

:map <F7> :if exists("g:syntax_on") <Bar>
    \   syntax off <Bar>
    \ else <Bar>
    \   syntax enable <Bar>
    \ endif <CR>

And there is a script to cycle through colorscheme options at wikia.

share|improve this answer
add comment

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.