This commit is contained in:
Alicia Sykes
2021-01-31 20:45:12 +00:00
parent 1b08ccbcc0
commit afb55def37
28 changed files with 1003 additions and 12 deletions

View File

@ -0,0 +1,7 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
set spell
set spelllang=en

19
vim/ftplugin/go.vim Normal file
View File

@ -0,0 +1,19 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
let b:ale_linters = ['go build', 'gometalinter', 'gopls']
let b:ale_fixers = ['gofmt', 'goimports', 'trim_whitespace']
setlocal noexpandtab
setlocal shiftwidth=4
setlocal softtabstop=4
setlocal tabstop=4
setlocal nolisp
setlocal autoindent
setlocal nospell
set makeprg=go " point :make to go binary

18
vim/ftplugin/markdown.vim Normal file
View File

@ -0,0 +1,18 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal spell
setlocal expandtab
setlocal tabstop=4
setlocal shiftwidth=4
setlocal textwidth=99
" spellcheck
setlocal spell
" generate TOC quicker
nmap <buffer> <silent> <Leader>toc :GenTocGFM<CR>
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'prettier']

67
vim/ftplugin/python.vim Normal file
View File

@ -0,0 +1,67 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal expandtab
setlocal autoindent
setlocal smartindent
setlocal textwidth=79
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal fileformat=unix
set backspace=indent,eol,start
match BadWhitespace /^\t\+/
match BadWhitespace /\s\+$/
let b:comment_leader = '#'
let b:ale_fix_on_save = 0
let b:ale_linters = ['mypy', 'flake8']
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines']
if isdirectory($VIRTUAL_ENV)
let s:yapf_bin = expand($VIRTUAL_ENV.'/bin/yapf')
let s:black_bin = expand($VIRTUAL_ENV.'/bin/black')
if executable(s:black_bin)
call add(b:ale_fixers, 'black')
elseif executable(s:yapf_bin)
call add(b:ale_fixers, 'yapf')
endif
elseif executable('yapf')
call add(b:ale_fixers, 'yapf')
elseif executable('black')
call add(b:ale_fixers, 'black')
endif
" if enabled, it makes flake8 loose its configuration file in project root
let b:ale_python_flake8_change_directory = 0
" always load pyls from neovim3 virtualenv :)
let b:ale_python_pyls_executable = expand(fnamemodify(g:python3_host_prog, ':h') . '/' . 'pyls')
if executable(b:ale_python_pyls_executable)
call add(b:ale_linters, 'pyls')
let b:ale_python_pyls_config = {
\ 'pyls': {
\ 'plugins': {
\ 'flake8': {'enabled': v:true},
\ 'mypy': {'enabled': v:true},
\ 'yapf': {'enabled': v:true},
\ 'pyflakes': {'enabled': v:false},
\ 'pycodestyle': {'enabled': v:false},
\ 'jedi': {'enabled': v:true},
\ 'rope': {'enabled': v:true},
\ 'jedi_definition': {
\ 'follow_imports': v:true,
\ 'follow_builtin_imports': v:true,
\ },
\ }
\ }}
endif

13
vim/ftplugin/scss.vim Normal file
View File

@ -0,0 +1,13 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal autoindent
setlocal expandtab
setlocal tabstop=2
setlocal shiftwidth=2
setlocal softtabstop=2
" ale fixer settings
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'prettier']

11
vim/ftplugin/vue.vim Normal file
View File

@ -0,0 +1,11 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
let b:ale_fix_on_save = 1
let b:ale_fixers = ['prettier', 'trim_whitespace', 'remove_trailing_lines']

38
vim/ftplugin/yaml.vim Normal file
View File

@ -0,0 +1,38 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal expandtab
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal foldmethod=indent
setlocal nowrap
setlocal indentexpr=GetYamlIndent()
setlocal indentkeys=o,O,*<Return>,!^F
function! GetYamlIndent()
let prevlnum = v:lnum - 1
if prevlnum == 0
return 0
endif
let line = substitute(getline(v:lnum),'\s\+$','','')
let prevline = substitute(getline(prevlnum),'\s\+$','','')
let indent = indent(prevlnum)
let increase = indent + &shiftwidth
let decrease = indent - &shiftwidth
if prevline =~# ':$'
return increase
elseif prevline =~# '^\s\+\-' && line =~# '^\s\+[^-]\+:'
return decrease
else
return indent
endif
endfunction
let b:ale_linters = ['yamllint', 'cloudformation']
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'prettier']