Created
November 30, 2010 17:45
-
-
Save AndrewRadev/722047 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Toggle settings: | |
command! -nargs=+ MapToggle call s:MapToggle(<f-args>) | |
function! s:MapToggle(key, opt) | |
let cmd = ':set '.a:opt.'! \| set '.a:opt."?\<CR>" | |
exec 'nnoremap '.a:key.' '.cmd | |
endfunction | |
" To toggle search highlighting on and off with <F9>, just do: | |
" | |
" MapToggle <F9> hlsearch | |
" Personal mappings: | |
" map s <Nop> | |
MapToggle sl list | |
MapToggle sh hlsearch | |
MapToggle sw wrap | |
MapToggle ss spell | |
MapToggle sc cursorcolumn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment