[UPDATE][VIM] Use b:undo_ftplugin
You're supposed to undo the changes that you made to a buffer's variables when doing filetype-related settings. The variable 'b:undo_ftplugin' contains the commands necessary to revert any changes that you have made to accomodate this filetype. I removed the mappings for left and right in a quickfix windows because I don't use them, and the 'qf' plug-in already maps those (meaning I had an error when I tried to unmap them after qf already did so).
This commit is contained in:
parent
a0a11c5eb9
commit
0473705335
|
@ -1,8 +1,11 @@
|
||||||
" 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'
|
||||||
|
|
||||||
" Indent with 4 spaces, simplify script, indent switch cases, use Bash variant
|
" Indent with 4 spaces, simplify script, indent switch cases, use Bash variant
|
||||||
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln bash'
|
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln bash'
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_sh_shfmt_options'
|
||||||
|
|
||||||
" Use bash dialect explicitly, require explicit empty string test
|
" Use bash dialect explicitly, require explicit empty string test
|
||||||
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
|
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_sh_shellcheck_options'
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
" Use compile_commands.json to look for additional flags
|
" Use compile_commands.json to look for additional flags
|
||||||
let b:ale_c_parse_compile_commands=1
|
let b:ale_c_parse_compile_commands=1
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_c_parse_compile_commands'
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
" Use compile_commands.json to look for additional flags
|
" Use compile_commands.json to look for additional flags
|
||||||
let b:ale_c_parse_compile_commands=1
|
let b:ale_c_parse_compile_commands=1
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_c_parse_compile_commands'
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
" 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'
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
" Enable spell checking on commit messages
|
" Enable spell checking on commit messages
|
||||||
setlocal spell
|
setlocal spell
|
||||||
|
let b:undo_ftplugin.='|setlocal spell<'
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
" 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'
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
" 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'
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
" 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'
|
||||||
" Use my desired ALE linters for python
|
" Use my desired ALE linters for python
|
||||||
let b:ale_linters=[ 'flake8', 'mypy', 'pylint', 'pyls' ]
|
let b:ale_linters=[ 'flake8', 'mypy', 'pylint', 'pyls' ]
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_linters'
|
||||||
|
|
||||||
"let b:ale_python_pyls_executable='pyls'
|
"let b:ale_python_pyls_executable='pyls'
|
||||||
let b:ale_python_pyls_auto_pipenv=1
|
let b:ale_python_pyls_auto_pipenv=1
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_python_pyls_auto_pipenv'
|
||||||
|
|
||||||
" Disable pycodestyle checks from pyls because I'm already using flake8
|
" Disable pycodestyle checks from pyls because I'm already using flake8
|
||||||
let b:ale_python_pyls_config={
|
let b:ale_python_pyls_config={
|
||||||
|
@ -16,6 +19,8 @@ let b:ale_python_pyls_config={
|
||||||
\ },
|
\ },
|
||||||
\ },
|
\ },
|
||||||
\ }
|
\ }
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_python_pyls_config'
|
||||||
|
|
||||||
" Change max length of a line to 88 for this buffer to match black's settings
|
" Change max length of a line to 88 for this buffer to match black's settings
|
||||||
setlocal colorcolumn=88
|
setlocal colorcolumn=88
|
||||||
|
let b:undo_ftplugin.='|setlocal colorcolumn<'
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
" 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'
|
||||||
nnoremap <silent> <buffer> l :call quickfixed#newer()<CR>
|
nnoremap <silent> <buffer> l :call quickfixed#newer()<CR>
|
||||||
|
let b:undo_ftplugin.='|nunmap <buffer> l'
|
||||||
" Use left/right to go to the previous/next non-empty quickfix or location list
|
|
||||||
nnoremap <silent> <buffer> <Left> :call quickfixed#older()<CR>
|
|
||||||
nnoremap <silent> <buffer> <Right> :call quickfixed#newer()<CR>
|
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
" Use rustfmt as ALE fixer for rust
|
" Use rustfmt as ALE fixer for rust
|
||||||
let b:ale_fixers=[ 'rustfmt' ]
|
let b:ale_fixers=[ 'rustfmt' ]
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_fixers'
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
" 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'
|
||||||
|
|
||||||
" Indent with 4 spaces, simplify the code, indent switch cases, use POSIX
|
" Indent with 4 spaces, simplify the code, indent switch cases, use POSIX
|
||||||
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln posix'
|
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln posix'
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_sh_shfmt_options'
|
||||||
|
|
||||||
" Require explicit empty string test
|
" Require explicit empty string test
|
||||||
let b:ale_sh_shellcheck_options='-o avoid-nullary-conditions'
|
let b:ale_sh_shellcheck_options='-o avoid-nullary-conditions'
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_sh_shellcheck_options'
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
" 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'
|
||||||
|
|
||||||
" Indent with 4 spaces, simplify script, indent switch cases, use Bash variant
|
" Indent with 4 spaces, simplify script, indent switch cases, use Bash variant
|
||||||
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln bash'
|
let b:ale_sh_shfmt_options='-i 4 -s -ci -ln bash'
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_sh_shfmt_options'
|
||||||
|
|
||||||
" Use bash dialect explicitly, require explicit empty string test
|
" Use bash dialect explicitly, require explicit empty string test
|
||||||
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
|
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
|
||||||
|
let b:undo_ftplugin.='|unlet b:ale_sh_shellcheck_options'
|
||||||
|
|
Loading…
Reference in a new issue