From 3f586a3d48bb04ef9206a202235b54cfcec38859 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 3 Nov 2017 20:35:23 +1300 Subject: Use / correctly in Vim config From ":help ": > In a global plugin should be used and in a filetype plugin > . "mapleader" and "maplocalleader" can be equal. --- vim/config/format.vim | 6 +++--- vim/config/list.vim | 2 +- vim/config/number.vim | 2 +- vim/config/search.vim | 4 ++-- vim/config/spell.vim | 6 +++--- vim/config/whitespace.vim | 2 +- vim/config/wrap.vim | 4 ++-- vim/ftplugin/html.vim | 4 ++-- vim/ftplugin/perl.vim | 6 +++--- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/vim/config/format.vim b/vim/config/format.vim index 35245d0d..b0de7621 100644 --- a/vim/config/format.vim +++ b/vim/config/format.vim @@ -38,8 +38,8 @@ if has('eval') endfunction " Map leader-letters to corresponding format option flags - nnoremap a :call ToggleFormatFlag('a') - nnoremap c :call ToggleFormatFlag('c') - nnoremap t :call ToggleFormatFlag('t') + nnoremap a :call ToggleFormatFlag('a') + nnoremap c :call ToggleFormatFlag('c') + nnoremap t :call ToggleFormatFlag('t') endif diff --git a/vim/config/list.vim b/vim/config/list.vim index faf5e29a..209bb4ec 100644 --- a/vim/config/list.vim +++ b/vim/config/list.vim @@ -1,7 +1,7 @@ " Don't show whitespace characters or end-of-line characters visually by " default, but make \l toggle between them set nolist -nnoremap l :setlocal list! list? +nnoremap l :setlocal list! list? " Clearly show when the start or end of the row does not correspond to the " start and end of the line diff --git a/vim/config/number.vim b/vim/config/number.vim index 35ec7efe..d7d9919c 100644 --- a/vim/config/number.vim +++ b/vim/config/number.vim @@ -1,3 +1,3 @@ " Don't show line numbers by default, but \n toggles them set nonumber -nnoremap n :setlocal number! number? +nnoremap n :setlocal number! number? diff --git a/vim/config/search.vim b/vim/config/search.vim index 66b81ab0..0f10eea5 100644 --- a/vim/config/search.vim +++ b/vim/config/search.vim @@ -3,11 +3,11 @@ if has('extra_search') " Searching as I enter my pattern, \i toggles this set incsearch - nnoremap i :setlocal incsearch! incsearch? + nnoremap i :setlocal incsearch! incsearch? " Highlight search results, \h toggles this set hlsearch - nnoremap h :setlocal hlsearch! hlsearch? + nnoremap h :setlocal hlsearch! hlsearch? " Pressing ^L will clear highlighting until the next search-related " operation; quite good because the highlighting gets distracting after diff --git a/vim/config/spell.vim b/vim/config/spell.vim index 046b50ff..6a0167d0 100644 --- a/vim/config/spell.vim +++ b/vim/config/spell.vim @@ -3,12 +3,12 @@ if has('spell') " Don't check spelling by default, but bind \s to toggle this set nospell - nnoremap s :setlocal spell! spell? + nnoremap s :setlocal spell! spell? " Use New Zealand English for spelling by default (it's almost identical " to British English), but bind \u to switch to US English and \z to " switch back set spelllang=en_nz - nnoremap u :setlocal spelllang=en_us spelllang? - nnoremap z :setlocal spelllang=en_nz spelllang? + nnoremap u :setlocal spelllang=en_us spelllang? + nnoremap z :setlocal spelllang=en_nz spelllang? endif diff --git a/vim/config/whitespace.vim b/vim/config/whitespace.vim index cc2554bd..bfe2663d 100644 --- a/vim/config/whitespace.vim +++ b/vim/config/whitespace.vim @@ -52,6 +52,6 @@ if has('eval') endfunction " Map \x to the function just defined - nnoremap x :call StripTrailingWhitespace() + nnoremap x :call StripTrailingWhitespace() endif diff --git a/vim/config/wrap.vim b/vim/config/wrap.vim index 0e5866d8..7a442e89 100644 --- a/vim/config/wrap.vim +++ b/vim/config/wrap.vim @@ -1,6 +1,6 @@ " Don't wrap by default, but use \w to toggle it on or off quickly set nowrap -nnoremap w :setlocal wrap! wrap? +nnoremap w :setlocal wrap! wrap? " When wrapping text, if a line is so long that not all of it can be shown on " the screen, show as much as possible anyway; by default Vim fills the left @@ -58,7 +58,7 @@ if has('linebreak') endfunction " Map \b to defined function - nnoremap b :call ToggleBreak() + nnoremap b :call ToggleBreak() endif endif diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim index 3f28e9ea..309b7132 100644 --- a/vim/ftplugin/html.vim +++ b/vim/ftplugin/html.vim @@ -1,5 +1,5 @@ " Run tidy -eq -utf8 on file for the current buffer -nnoremap v :exe "!tidy -eq -utf8 " . shellescape(expand("%")) +nnoremap v :exe "!tidy -eq -utf8 " . shellescape(expand("%")) " Make a bare URL into a link to itself function! s:UrlLink() @@ -8,4 +8,4 @@ function! s:UrlLink() normal! E execute "normal! a\" endfunction -nnoremap r :call UrlLink() +nnoremap r :call UrlLink() diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim index dad2ce35..53341183 100644 --- a/vim/ftplugin/perl.vim +++ b/vim/ftplugin/perl.vim @@ -1,6 +1,6 @@ " Run perl -c on file for the current buffer -nnoremap pc :exe "!perl -c " . shellescape(expand("%")) +nnoremap pc :exe "!perl -c " . shellescape(expand("%")) " Run perlcritic on the file for the current buffer -nnoremap pl :exe "!perlcritic " . shellescape(expand("%")) +nnoremap pl :exe "!perlcritic " . shellescape(expand("%")) " Run the current buffer through perltidy -nnoremap pt :%!perltidy +nnoremap pt :%!perltidy -- cgit v1.2.3