[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") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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'

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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'

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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

View file

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

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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' ]

View file

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

View file

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

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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>

View file

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

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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' ]

View file

@ -1,6 +1,5 @@
if !exists("b:undo_ftplugin") " Create the `b:undo_ftplugin` variable if it doesn't exist
let b:undo_ftplugin='' call ftplugined#check_undo_ft()
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' ]

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