dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 4f3a3d7d2d58afa287af7be0c07c869caf05e06b
parent 26aadb620abfac1d43ce70cfb744d03970b5d197
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Mon, 27 Jan 2020 14:48:31 +0100

vim: changes to how undo_ftplugin is done

Former-commit-id: 064ec207745e2129a405327576d61388efd9950f
Diffstat:
Mvim/after/ftplugin/ada.vim | 9++++-----
Mvim/after/ftplugin/c.vim | 9++++-----
Mvim/after/ftplugin/gitcommit.vim | 9++++-----
Mvim/after/ftplugin/haskell.vim | 9++++-----
Mvim/after/ftplugin/javascript.vim | 9++++-----
Mvim/after/ftplugin/man.vim | 4++++
Mvim/after/ftplugin/netrw.vim | 9++++-----
Mvim/after/ftplugin/plantuml.vim | 17+++++------------
Mvim/after/ftplugin/qf.vim | 9++++-----
Mvim/after/ftplugin/sh.vim | 9++++-----
Mvim/after/ftplugin/tagbar.vim | 9++++-----
Mvim/after/ftplugin/tex.vim | 9++++-----
Mvim/after/ftplugin/vim.vim | 9++++-----
Mvim/after/ftplugin/vimcolor.vim | 20+++++++++-----------
Mvim/after/ftplugin/vimwiki.vim | 17++++++++---------
15 files changed, 70 insertions(+), 87 deletions(-)

diff --git a/vim/after/ftplugin/ada.vim b/vim/after/ftplugin/ada.vim @@ -1,6 +1,5 @@ compiler ada -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal makeprg< errorformat<' -else - let b:undo_ftplugin = 'setlocal makeprg< errorformat<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal makeprg< errorformat<' diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim @@ -1,8 +1,7 @@ if v:version >= 800 packadd termdebug endif -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '| nmapc <buffer>' -else - let b:undo_ftplugin = 'nmapc <buffer>' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '| nmapc <buffer>' diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim @@ -1,7 +1,6 @@ setlocal spell setlocal spelllang=en -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal spell< spelllang<' -else - let b:undo_ftplugin = 'setlocal spell< spelllang<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal spell< spelllang<' diff --git a/vim/after/ftplugin/haskell.vim b/vim/after/ftplugin/haskell.vim @@ -1,6 +1,5 @@ set suffixesadd=.hs -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '| set suffixesadd<' -else - let b:undo_ftplugin = '| set suffixesadd<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '| set suffixesadd<' diff --git a/vim/after/ftplugin/javascript.vim b/vim/after/ftplugin/javascript.vim @@ -1,7 +1,6 @@ runtime! ftplugin/html/sparkup.vim setlocal suffixesadd =.js,.ts -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '| setlocal suffixesadd<' -else - let b:undo_ftplugin = '| setlocal suffixesadd<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '| setlocal suffixesadd<' diff --git a/vim/after/ftplugin/man.vim b/vim/after/ftplugin/man.vim @@ -1,2 +1,6 @@ " Make searching for keywords/options easier nnoremap <buffer> <leader>/ /^ \+ +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '| nmapc <buffer>' diff --git a/vim/after/ftplugin/netrw.vim b/vim/after/ftplugin/netrw.vim @@ -1,6 +1,5 @@ setlocal bufhidden=delete -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal bufhidden<' -else - let b:undo_ftplugin = 'setlocal bufhidden<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal bufhidden<' diff --git a/vim/after/ftplugin/plantuml.vim b/vim/after/ftplugin/plantuml.vim @@ -1,14 +1,7 @@ compiler plantuml -augroup plantuml_buffer - autocmd! * <buffer> -augroup END nnoremap <buffer> <leader><CR> :silent !open "%<.png"<CR>:redraw!<CR> -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '| nmapc <buffer>' - let b:undo_ftplugin .= '| setlocal makeprg<' - let b:undo_ftplugin .= '| exe "au! plantuml_buffer * <buffer>"' -else - let b:undo_ftplugin = 'nmapc <buffer>' - let b:undo_ftplugin .= '| setlocal makeprg<' - let b:undo_ftplugin .= '| exe "au! plantuml_buffer * <buffer>"' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '| nmapc <buffer>' +let b:undo_ftplugin .= '| setlocal makeprg<' diff --git a/vim/after/ftplugin/qf.vim b/vim/after/ftplugin/qf.vim @@ -1,6 +1,5 @@ setlocal nocursorline -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal nocursorline<' -else - let b:undo_ftplugin = 'setlocal nocursorline<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal nocursorline<' diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim @@ -1,6 +1,5 @@ compiler sh -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal makeprg<' -else - let b:undo_ftplugin = 'setlocal makeprg<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal makeprg<' diff --git a/vim/after/ftplugin/tagbar.vim b/vim/after/ftplugin/tagbar.vim @@ -1,6 +1,5 @@ setlocal nocursorline -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal nocursorline<' -else - let b:undo_ftplugin = 'setlocal nocursorline<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal nocursorline<' diff --git a/vim/after/ftplugin/tex.vim b/vim/after/ftplugin/tex.vim @@ -1,6 +1,5 @@ nnoremap <buffer> <leader>tt :VimtexTocToggle -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|nmapc <buffer>' -else - let b:undo_ftplugin = 'nmapc <buffer>' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|nmapc <buffer>' diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim @@ -1,6 +1,5 @@ setlocal keywordprg=:help -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal keywordprg<' -else - let b:undo_ftplugin = 'setlocal keywordprg<' -endif +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal keywordprg<' diff --git a/vim/after/ftplugin/vimcolor.vim b/vim/after/ftplugin/vimcolor.vim @@ -3,16 +3,14 @@ augroup vimcolor_buffer autocmd! * <buffer> autocmd BufWritePost <buffer> silent make | execute 'colorscheme '.expand('%:p:t:r') augroup END + map <buffer> <leader>CH <Plug>Colorizer nnoremap <buffer> <leader>CC :ColorClear<CR> -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal makeprg< ' - let b:undo_ftplugin .= '|exe "au! vimcolor_buffer * <buffer>"' - let b:undo_ftplugin .= '|vmapc <buffer>' - let b:undo_ftplugin .= '|nmapc <buffer>' -else - let b:undo_ftplugin = 'setlocal makeprg< ' - let b:undo_ftplugin .= '|exe "au! vimcolor_buffer * <buffer>"' - let b:undo_ftplugin .= '|vmapc <buffer>' - let b:undo_ftplugin .= '|nmapc <buffer>' -endif + +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal makeprg< ' +let b:undo_ftplugin .= '|exe "au! vimcolor_buffer * <buffer>"' +let b:undo_ftplugin .= '|mapc <buffer>' +let b:undo_ftplugin .= '|nmapc <buffer>' diff --git a/vim/after/ftplugin/vimwiki.vim b/vim/after/ftplugin/vimwiki.vim @@ -1,12 +1,11 @@ setlocal wrap shiftwidth=4 tabstop=4 softtabstop=4 breakindent breakindentopt=shift:3 + cabbrev <buffer> table VimwikiTable nmap <buffer> <leader><CR> <Plug>VimwikiSplitLink -if exists('b:undo_ftplugin') - let b:undo_ftplugin .= '|setlocal wrap< shiftwidth< tabstop< softtabstop< breakindent< breakindentopt<' - let b:undo_ftplugin .= '| cabc <buffer>' - let b:undo_ftplugin .= '| nmapc <buffer>' -else - let b:undo_ftplugin = 'setlocal wrap< shiftwidth< tabstop< softtabstop< breakindent< breakindentopt<' - let b:undo_ftplugin .= '| cabc <buffer>' - let b:undo_ftplugin .= '| nmapc <buffer>' -endif + +if !exists('b:undo_ftplugin') + let b:undo_ftplugin = '' +end +let b:undo_ftplugin .= '|setlocal wrap< shiftwidth< tabstop< softtabstop< breakindent< breakindentopt<' +let b:undo_ftplugin .= '| cabc <buffer>' +let b:undo_ftplugin .= '| nmapc <buffer>'