From 52e201b43aca55be0a51e4342fcbc1de09b8f2d7 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 19 Jun 2019 12:39:23 +1200 Subject: Remove unnecessary :setlocal commands --- vim/vimrc | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'vim') diff --git a/vim/vimrc b/vim/vimrc index 2f638b6b..3bc765b7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -1326,45 +1326,45 @@ endif " 'cursorline' is always off when in any visual mode, including block mode, " where it actually might have been really handy. +"" Leader,TAB toggles automatic indentation based on the previous line +nnoremap + \ :set autoindent! autoindent? +"" Leader,c toggles highlighted cursor row; doesn't work in visual mode +nnoremap c + \ :set cursorline! cursorline? "" Leader,h toggles highlighting search results nnoremap h \ :set hlsearch! hlsearch? "" Leader,i toggles showing matches as I enter my pattern nnoremap i \ :set incsearch! incsearch? -"" Leader,TAB toggles automatic indentation based on the previous line -nnoremap - \ :setlocal autoindent! autoindent? -"" Leader,c toggles highlighted cursor row; doesn't work in visual mode -nnoremap c - \ :setlocal cursorline! cursorline? "" Leader,s toggles spell checking nnoremap s - \ :setlocal spell! spell? + \ :set spell! spell? " The next group of option-toggling maps are much the same as the previous " group, except they also include analogous maps for visual mode, defined as " recursive maps into normal mode that conclude with re-selecting the text. -"" Leader,N toggles position display in bottom right -nnoremap N - \ :set ruler! ruler? -xmap N Ngv "" Leader,C toggles highlighted cursor column; works in visual mode nnoremap C - \ :setlocal cursorcolumn! cursorcolumn? + \ :set cursorcolumn! cursorcolumn? xmap C Cgv "" Leader,l toggles showing tab, end-of-line, and trailing white space nnoremap l - \ :setlocal list! list? + \ :set list! list? xmap l lgv "" Leader,n toggles line number display nnoremap n - \ :setlocal number! number? + \ :set number! number? xmap n ngv +"" Leader,N toggles position display in bottom right +nnoremap N + \ :set ruler! ruler? +xmap N Ngv "" Leader,w toggles soft wrapping nnoremap w - \ :setlocal wrap! wrap? + \ :set wrap! wrap? xmap w wgv " This next one just shows option state of the 'formatoptions' affecting how @@ -1372,7 +1372,7 @@ xmap w wgv "" Leader,f shows the current 'formatoptions' at a glance nnoremap f - \ :setlocal formatoptions? + \ :set formatoptions? " I often have to switch between US English and NZ English. The latter is " almost exactly the same as UK English in most locales, although we use @@ -1382,10 +1382,10 @@ nnoremap f "" Leader,u sets US English spelling language nnoremap u - \ :setlocal spelllang=en_us + \ :set spelllang=en_us "" Leader,z sets NZ English spelling language nnoremap z - \ :setlocal spelllang=en_nz + \ :set spelllang=en_nz " The next mapping is also for toggling an option, but it's more complicated; " it uses a simple plugin of mine called copy_linebreak.vim to manage several @@ -1438,10 +1438,10 @@ nnoremap F \ :ReloadFileType "" Leader,t shows current filetype nnoremap t - \ :setlocal filetype? + \ :set filetype? "" Leader,T clears filetype nnoremap T - \ :setlocal filetype= + \ :set filetype= " These mappings use my put_date.vim plugin for date insertion into the " buffer. @@ -1515,10 +1515,10 @@ nnoremap \ :enew "" Leader,e forces a buffer to be editable, even a :help one nnoremap e - \ :setlocal modifiable noreadonly + \ :set modifiable noreadonly "" Leader,E locks a buffer, reversible with e nnoremap E - \ :setlocal nomodifiable readonly + \ :set nomodifiable readonly "" Leader,j jumps to buffers ("jetpack") nnoremap j \ :buffers:buffer -- cgit v1.2.3