commit ad2fe3a626a96704cccd989cca11f0e87cced3b1 parent ccbaf55ba12af83fb2f2a1de6404afba1a4dc6e9 Author: Chris Bracken <chris@bracken.jp> Date: Wed, 6 Mar 2013 21:35:14 -0800 Minor cleanup of ToggleNumbering() and ToggleMenu() mappings. Diffstat:
M | .vim/.vimrc | | | 21 | ++++++++++----------- |
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/.vim/.vimrc b/.vim/.vimrc @@ -26,14 +26,14 @@ set showmatch " Flash matching paren set history=50 " 50 lines of cmdline history " Toggle relative numbering -function! RelNumToggle() +function! ToggleNumbering() if (&relativenumber == 1) set number else set relativenumber endif endfunc -nnoremap <C-n> :call RelNumToggle()<CR> +nmap <C-n> :call ToggleNumbering()<CR> " Indentation/tabulation set autoindent @@ -83,13 +83,12 @@ if has("gui_running") set guioptions-=m " Hide menu bar " Menubar toggling - :let g:toggleMenu = 0 - map <silent> <S-F1> - \ :if g:toggleMenu == 1<CR> - \ :set guioptions-=m<CR> - \ :let g:toggleMenu = 0<CR> - \ :else<CR> - \ :set guioptions+=m<CR> - \ :let g:toggleMenu = 1<CR> - \ :endif<CR> + function! ToggleMenu() + if &go=~#'m' + set go-=m + else + set go+=m + endif + endfunc + map <silent> <S-F1> :call ToggleMenu()<CR> endif