[FIX][VIM] Set b:undo_ftplugin if not set

I hit the problem when loading a fugitive window, but this should be
done for all filetype plug-ins before trying to append to the variable.
This commit is contained in:
Bruno BELANYI 2019-10-25 14:15:56 +02:00
parent 571d5bc9e0
commit 36faab278e
15 changed files with 60 additions and 0 deletions

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Use shfmt as ALE fixer for bash " Use shfmt as ALE fixer for bash
let b:ale_fixers=[ 'shfmt' ] let b:ale_fixers=[ 'shfmt' ]
let b:undo_ftplugin.='|unlet b:ale_fixers' let b:undo_ftplugin.='|unlet b:ale_fixers'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" More warnings and the usual version in flags for Clang " More warnings and the usual version in flags for Clang
let b:ale_c_clang_options='-Wall -Wextra -pedantic -std=c99' let b:ale_c_clang_options='-Wall -Wextra -pedantic -std=c99'
let b:undo_ftplugin.='|unlet b:ale_c_clang_options' let b:undo_ftplugin.='|unlet b:ale_c_clang_options'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" More warnings and the usual version in flags for Clang " More warnings and the usual version in flags for Clang
let b:ale_cpp_clang_options='-Wall -Wextra -pedantic -std=c++17' let b:ale_cpp_clang_options='-Wall -Wextra -pedantic -std=c++17'
let b:undo_ftplugin.='|unlet b:ale_cpp_clang_options' let b:undo_ftplugin.='|unlet b:ale_cpp_clang_options'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Use my desired ALE fixer for D " Use my desired ALE fixer for D
let b:ale_fixers=[ 'dfmt' ] let b:ale_fixers=[ 'dfmt' ]
let b:undo_ftplugin.='|unlet b:ale_fixers' let b:undo_ftplugin.='|unlet b:ale_fixers'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Don't highlight trailing whitespace in fugitive windows " Don't highlight trailing whitespace in fugitive windows
let b:better_whitespace_enabled=0 let b:better_whitespace_enabled=0
let b:undo_ftplugin.='|unlet b:better_whitespace_enabled' let b:undo_ftplugin.='|unlet b:better_whitespace_enabled'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Enable spell checking on commit messages " Enable spell checking on commit messages
setlocal spell setlocal spell
let b:undo_ftplugin.='|setlocal spell<' let b:undo_ftplugin.='|setlocal spell<'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Use my desired ALE fixer for JSON " Use my desired ALE fixer for JSON
let b:ale_fixers=[ 'jq' ] let b:ale_fixers=[ 'jq' ]
let b:undo_ftplugin.='|unlet b:ale_fixers' let b:undo_ftplugin.='|unlet b:ale_fixers'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Makefiles should use tabs to indent " Makefiles should use tabs to indent
setlocal noexpandtab setlocal noexpandtab
let b:undo_ftplugin.='|setlocal noexpandtab<' let b:undo_ftplugin.='|setlocal noexpandtab<'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Don't show Netrw in buffer list " Don't show Netrw in buffer list
setlocal bufhidden=delete setlocal bufhidden=delete
let b:undo_ftplugin='|setlocal bufhidden<' let b:undo_ftplugin='|setlocal bufhidden<'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Let ALE know that I want Markdown linters " Let ALE know that I want Markdown linters
let b:ale_linter_aliases=[ 'markdown' ] let b:ale_linter_aliases=[ 'markdown' ]
let b:undo_ftplugin.='|unlet b:ale_linter_aliases' let b:undo_ftplugin.='|unlet b:ale_linter_aliases'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Use my desired ALE fixers for python " Use my desired ALE fixers for python
let b:ale_fixers=[ 'black', 'isort' ] let b:ale_fixers=[ 'black', 'isort' ]
let b:undo_ftplugin.='|unlet b:ale_fixers' let b:undo_ftplugin.='|unlet b:ale_fixers'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Use h/l to go to the previous/next non-empty quickfix or location list " Use h/l to go to the previous/next non-empty quickfix or location list
nnoremap <silent> <buffer> h :call quickfixed#older()<CR> nnoremap <silent> <buffer> h :call quickfixed#older()<CR>
let b:undo_ftplugin.='|nunmap <buffer> h' let b:undo_ftplugin.='|nunmap <buffer> h'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Check tests too " Check tests too
let b:ale_rust_cargo_check_tests=1 let b:ale_rust_cargo_check_tests=1
let b:undo_ftplugin='|unlet b:ale_rust_cargo_check_tests' let b:undo_ftplugin='|unlet b:ale_rust_cargo_check_tests'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Use shfmt as ALE fixer for sh " Use shfmt as ALE fixer for sh
let b:ale_fixers=[ 'shfmt' ] let b:ale_fixers=[ 'shfmt' ]
let b:undo_ftplugin.='|unlet b:ale_fixers' let b:undo_ftplugin.='|unlet b:ale_fixers'

View file

@ -1,3 +1,7 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Use shfmt as ALE fixer for zsh " Use shfmt as ALE fixer for zsh
let b:ale_fixers=[ 'shfmt' ] let b:ale_fixers=[ 'shfmt' ]
let b:undo_ftplugin.='|unlet b:ale_fixers' let b:undo_ftplugin.='|unlet b:ale_fixers'