[UPDATE][VIM] Factorise b:undo_ftplugin

Instead of re-writing the same condition each time, I put the function
in an autoload plugin instead (which is going to be loaded just about
every time I start writing code, but that's neither here nor there) to
stop repeating myself.
This commit is contained in:
Bruno BELANYI 2019-10-25 14:25:48 +02:00
parent 36faab278e
commit d9eab5526f
16 changed files with 36 additions and 45 deletions

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use shfmt as ALE fixer for bash
let b:ale_fixers=[ 'shfmt' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" More warnings and the usual version in flags for Clang
let b:ale_c_clang_options='-Wall -Wextra -pedantic -std=c99'

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" More warnings and the usual version in flags for Clang
let b:ale_cpp_clang_options='-Wall -Wextra -pedantic -std=c++17'

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use my desired ALE fixer for D
let b:ale_fixers=[ 'dfmt' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Don't highlight trailing whitespace in fugitive windows
let b:better_whitespace_enabled=0

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Enable spell checking on commit messages
setlocal spell

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use my desired ALE fixer for JSON
let b:ale_fixers=[ 'jq' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Makefiles should use tabs to indent
setlocal noexpandtab

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Don't show Netrw in buffer list
setlocal bufhidden=delete

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Let ALE know that I want Markdown linters
let b:ale_linter_aliases=[ 'markdown' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use my desired ALE fixers for python
let b:ale_fixers=[ 'black', 'isort' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use h/l to go to the previous/next non-empty quickfix or location list
nnoremap <silent> <buffer> h :call quickfixed#older()<CR>

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Check tests too
let b:ale_rust_cargo_check_tests=1

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use shfmt as ALE fixer for sh
let b:ale_fixers=[ 'shfmt' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
" Create the `b:undo_ftplugin` variable if it doesn't exist
call ftplugined#check_undo_ft()
" Use shfmt as ALE fixer for zsh
let b:ale_fixers=[ 'shfmt' ]

View file

@ -0,0 +1,6 @@
" Create the `b:undo_ftplugin` variable if it doesn't exist
function! ftplugined#check_undo_ft()
if !exists("b:undo_ftplugin")
let b:undo_ftplugin=''
endif
endfunction