home: vim: add 'after'
This commit is contained in:
parent
d74aead9ae
commit
f1e4a4d914
31 changed files with 364 additions and 0 deletions
14
home/vim/after/ftplugin/bash.vim
Normal file
14
home/vim/after/ftplugin/bash.vim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
" 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' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" 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:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
|
||||
|
||||
" Use bash dialect explicitly, require explicit empty string test
|
||||
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'
|
||||
13
home/vim/after/ftplugin/beancount.vim
Normal file
13
home/vim/after/ftplugin/beancount.vim
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use a small indentation value on beancount files
|
||||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
|
||||
" Have automatic padding of transactions so that decimal is on 52nd column
|
||||
let g:beancount_separator_col=52
|
||||
|
||||
" Automatic padding for transactions
|
||||
nnoremap <buffer> <leader>= :AlignCommodity<CR>
|
||||
vnoremap <buffer> <leader>= :AlignCommodity<CR>
|
||||
14
home/vim/after/ftplugin/c.vim
Normal file
14
home/vim/after/ftplugin/c.vim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
" 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'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_c_clang_options'
|
||||
|
||||
" More warnings and the usual version in flags for GCC
|
||||
let b:ale_c_gcc_options='-Wall -Wextra -pedantic -std=c99'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_c_gcc_options'
|
||||
|
||||
" Use compile_commands.json to look for additional flags
|
||||
let b:ale_c_parse_compile_commands=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_c_parse_compile_commands'
|
||||
6
home/vim/after/ftplugin/cmake.vim
Normal file
6
home/vim/after/ftplugin/cmake.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use 2 spaces indentation inside CMake files
|
||||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
14
home/vim/after/ftplugin/cpp.vim
Normal file
14
home/vim/after/ftplugin/cpp.vim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
" 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'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_cpp_clang_options'
|
||||
|
||||
" More warnings and the usual version in flags for GCC
|
||||
let b:ale_cpp_gcc_options='-Wall -Wextra -pedantic -std=c++17'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_cpp_gcc_options'
|
||||
|
||||
" Use compile_commands.json to look for additional flags
|
||||
let b:ale_c_parse_compile_commands=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_c_parse_compile_commands'
|
||||
6
home/vim/after/ftplugin/d.vim
Normal file
6
home/vim/after/ftplugin/d.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" 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' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
6
home/vim/after/ftplugin/fugitive.vim
Normal file
6
home/vim/after/ftplugin/fugitive.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" 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
|
||||
let b:undo_ftplugin.='|unlet! b:better_whitespace_enabled'
|
||||
6
home/vim/after/ftplugin/gitcommit.vim
Normal file
6
home/vim/after/ftplugin/gitcommit.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Enable spell checking on commit messages
|
||||
setlocal spell
|
||||
let b:undo_ftplugin.='|setlocal spell<'
|
||||
6
home/vim/after/ftplugin/gitconfig.vim
Normal file
6
home/vim/after/ftplugin/gitconfig.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Git configuration files should use tabs to indent
|
||||
setlocal noexpandtab
|
||||
let b:undo_ftplugin.='|setlocal noexpandtab<'
|
||||
6
home/vim/after/ftplugin/gitsendemail.vim
Normal file
6
home/vim/after/ftplugin/gitsendemail.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Disable the prompt to delete whitespace
|
||||
DisableStripWhitespaceOnSave
|
||||
let b:undo_ftplugin.='|EnableStripWhitespaceOnSave'
|
||||
30
home/vim/after/ftplugin/haskell.vim
Normal file
30
home/vim/after/ftplugin/haskell.vim
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use a small indentation value on Haskell files
|
||||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
|
||||
" Use my desired ALE fixers for Haskell
|
||||
let b:ale_fixers=[ 'brittany' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" Use stack-managed `hlint`
|
||||
let b:ale_haskell_hlint_executable='stack'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_haskell_hlint_executable'
|
||||
|
||||
" Use stack-managed `brittany`
|
||||
let b:ale_haskell_brittany_executable='stack'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_haskell_brittany_executable'
|
||||
|
||||
" Use dynamic libraries because of Arch linux, with default ALE options
|
||||
let b:ale_haskell_ghc_options='--dynamic -fno-code -v0'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_haskell_ghc_options'
|
||||
|
||||
" Automatically format files when saving them
|
||||
let b:ale_fix_on_save=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
|
||||
|
||||
" Change max length of a line to 100 for this buffer to match official guidelines
|
||||
setlocal colorcolumn=100
|
||||
let b:undo_ftplugin.='|setlocal colorcolumn<'
|
||||
6
home/vim/after/ftplugin/help.vim
Normal file
6
home/vim/after/ftplugin/help.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Don't highlight trailing whitespace in help windows
|
||||
let b:better_whitespace_enabled=0
|
||||
let b:undo_ftplugin.='|unlet! b:better_whitespace_enabled'
|
||||
6
home/vim/after/ftplugin/json.vim
Normal file
6
home/vim/after/ftplugin/json.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" 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' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
6
home/vim/after/ftplugin/mail.vim
Normal file
6
home/vim/after/ftplugin/mail.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Change max length of a line to 72 to follow the netiquette
|
||||
setlocal colorcolumn=72
|
||||
let b:undo_ftplugin.='|setlocal colorcolumn<'
|
||||
6
home/vim/after/ftplugin/make.vim
Normal file
6
home/vim/after/ftplugin/make.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Makefiles should use tabs to indent
|
||||
setlocal noexpandtab
|
||||
let b:undo_ftplugin.='|setlocal noexpandtab<'
|
||||
6
home/vim/after/ftplugin/netrw.vim
Normal file
6
home/vim/after/ftplugin/netrw.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" 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
|
||||
let b:undo_ftplugin='|setlocal bufhidden<'
|
||||
14
home/vim/after/ftplugin/pandoc.vim
Normal file
14
home/vim/after/ftplugin/pandoc.vim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
" 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' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_linter_aliases'
|
||||
|
||||
" Use a small indentation value on Pandoc files
|
||||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
|
||||
" Use my usual text width
|
||||
setlocal textwidth=80
|
||||
let b:undo_ftplugin.='|setlocal textwidth<'
|
||||
40
home/vim/after/ftplugin/python.vim
Normal file
40
home/vim/after/ftplugin/python.vim
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
" 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' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
" Use my desired ALE linters for python
|
||||
let b:ale_linters=[ 'flake8', 'mypy', 'pylint', 'pyls' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_linters'
|
||||
|
||||
" Use pyls inside the python environment if needed
|
||||
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
|
||||
let b:ale_python_pyls_config={
|
||||
\ 'pyls': {
|
||||
\ 'plugins': {
|
||||
\ 'pycodestyle': {
|
||||
\ 'enabled': v:false
|
||||
\ },
|
||||
\ },
|
||||
\ },
|
||||
\ }
|
||||
let b:undo_ftplugin.='|unlet! b:ale_python_pyls_config'
|
||||
|
||||
" Don't use mypy to check for syntax errors
|
||||
let b:ale_python_mypy_ignore_invalid_syntax=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_python_mypy_ignore_invalid_syntax'
|
||||
" Use mypy inside the python environment if needed
|
||||
let b:ale_python_mypy_auto_pipenv=1
|
||||
let b:undo_ftplugin.='|unlet! b:ale_python_mypy_auto_pipenv'
|
||||
|
||||
" Automatically format files when saving them
|
||||
let b:ale_fix_on_save=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
|
||||
|
||||
" Change max length of a line to 88 for this buffer to match black's settings
|
||||
setlocal colorcolumn=88
|
||||
let b:undo_ftplugin.='|setlocal colorcolumn<'
|
||||
8
home/vim/after/ftplugin/qf.vim
Normal file
8
home/vim/after/ftplugin/qf.vim
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
" 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>
|
||||
let b:undo_ftplugin.='|nunmap <buffer> h'
|
||||
nnoremap <silent> <buffer> l :call quickfixed#newer()<CR>
|
||||
let b:undo_ftplugin.='|nunmap <buffer> l'
|
||||
31
home/vim/after/ftplugin/rust.vim
Normal file
31
home/vim/after/ftplugin/rust.vim
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
" 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
|
||||
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_check_tests'
|
||||
|
||||
" Check examples too
|
||||
let b:ale_rust_cargo_check_examples=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_check_examples'
|
||||
|
||||
" Use clippy if it's available instead of just cargo check
|
||||
let b:ale_rust_cargo_use_clippy=executable('cargo-clippy')
|
||||
let b:undo_ftplugin='|unlet! b:ale_rust_cargo_use_clippy'
|
||||
|
||||
" Use rust-analyzer instead of RLS as a linter
|
||||
let b:ale_linters=[ 'cargo', 'analyzer' ]
|
||||
let b:undo_ftplugin='|unlet! b:ale_linters'
|
||||
|
||||
|
||||
" Use rustfmt as ALE fixer for rust
|
||||
let b:ale_fixers=[ 'rustfmt' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" Automatically format files when saving them
|
||||
let b:ale_fix_on_save=1
|
||||
let b:undo_ftplugin='|unlet! b:ale_lint_on_save'
|
||||
|
||||
" Change max length of a line to 99 for this buffer to match official guidelines
|
||||
setlocal colorcolumn=99
|
||||
let b:undo_ftplugin.='|setlocal colorcolumn<'
|
||||
14
home/vim/after/ftplugin/sh.vim
Normal file
14
home/vim/after/ftplugin/sh.vim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
" 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' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" 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:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
|
||||
|
||||
" Require explicit empty string test
|
||||
let b:ale_sh_shellcheck_options='-o avoid-nullary-conditions'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'
|
||||
6
home/vim/after/ftplugin/tex.vim
Normal file
6
home/vim/after/ftplugin/tex.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use 2 spaces indentation inside TeX files
|
||||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
6
home/vim/after/ftplugin/yaml.vim
Normal file
6
home/vim/after/ftplugin/yaml.vim
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
" Create the `b:undo_ftplugin` variable if it doesn't exist
|
||||
call ftplugined#check_undo_ft()
|
||||
|
||||
" Use a small indentation value on YAML files
|
||||
setlocal shiftwidth=2
|
||||
let b:undo_ftplugin.='|setlocal shiftwidth<'
|
||||
14
home/vim/after/ftplugin/zsh.vim
Normal file
14
home/vim/after/ftplugin/zsh.vim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
" 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' ]
|
||||
let b:undo_ftplugin.='|unlet! b:ale_fixers'
|
||||
|
||||
" 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:undo_ftplugin.='|unlet! b:ale_sh_shfmt_options'
|
||||
|
||||
" Use bash dialect explicitly, require explicit empty string test
|
||||
let b:ale_sh_shellcheck_options='-s bash -o avoid-nullary-conditions'
|
||||
let b:undo_ftplugin.='|unlet! b:ale_sh_shellcheck_options'
|
||||
Loading…
Add table
Add a link
Reference in a new issue