2021-12-06 10:57:57 +00:00
|
|
|
|
|
|
|
"""Base Settings for ALE
|
|
|
|
command! ALEDisableFixers let g:ale_fix_on_save=0
|
|
|
|
let g:ale_fix_on_save = 1
|
|
|
|
|
|
|
|
"ALE defaults to all linters turned on, so this turns some off.
|
|
|
|
let g:ale_linters = {
|
2021-12-09 14:12:00 +00:00
|
|
|
\ 'python': [
|
|
|
|
\ 'pylint',
|
|
|
|
\ 'flake8',
|
|
|
|
\ 'mypy',
|
|
|
|
\ 'bandit',
|
2023-05-09 11:23:07 +00:00
|
|
|
\ 'unimport',
|
2021-12-09 14:12:00 +00:00
|
|
|
\ ],
|
2021-12-06 10:57:57 +00:00
|
|
|
\ 'php': ['phpcs'],
|
|
|
|
\ 'spec': ['rpmlint'],
|
|
|
|
\}
|
|
|
|
|
|
|
|
" Ale defaults to all fixers turned off, so this turns some on.
|
|
|
|
" Fixing AUTOMATICALLY CHANGES YOUR CODE on save.
|
|
|
|
let g:ale_fixers = {
|
|
|
|
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
|
|
|
\ 'python': ['black', 'isort'],
|
|
|
|
\ 'yaml': ['prettier'],
|
|
|
|
\ 'go': ['gofmt', 'goimports'],
|
|
|
|
\ 'php': ['php_cs_fixer'],
|
|
|
|
\ 'scss': ['prettier'],
|
|
|
|
\ 'rust': ['rustfmt'],
|
|
|
|
\ 'javascript' : ['eslint'],
|
2022-01-04 11:18:28 +00:00
|
|
|
\ 'javascriptreact' : ['eslint'],
|
2021-12-06 10:57:57 +00:00
|
|
|
\ 'typescript': ['eslint'],
|
|
|
|
\ 'vue': ['eslint'],
|
|
|
|
\ 'json' :['jq'],
|
|
|
|
\}
|
|
|
|
|
|
|
|
" ALE settings for speficic languages.
|
|
|
|
"PHP
|
|
|
|
let g:ale_php_phpcs_standard = 'PSR12'
|
|
|
|
|
|
|
|
"FORTRAN
|
|
|
|
let g:ale_fortran_gcc_use_free_form = 0
|
|
|
|
|
|
|
|
"JSON
|
|
|
|
let g:ale_json_jq_options = '--sort-keys'
|
|
|
|
|
2024-07-09 09:30:32 +00:00
|
|
|
" Spell checking
|
|
|
|
let g:ale_cspell_options = '--config ~/.alex-envion/home/.config/cspell/config.yaml'
|
|
|
|
|
2021-12-06 10:57:57 +00:00
|
|
|
"""Base Settings for COC
|
|
|
|
let g:coc_config_home = '~/.alex-environ/home/.vimrc.d/coc'
|
2024-01-25 14:00:23 +00:00
|
|
|
let g:coc_global_extensions = ['coc-jedi', 'coc-rust-analyzer', 'coc-tsserver', 'coc-json', 'coc-htmldjango']
|
2021-12-06 10:57:57 +00:00
|
|
|
"""Language Specific Options.
|
|
|
|
"Remeber that COC has it's own settings file too, so most of it's settings are
|
|
|
|
"there.
|
2022-06-10 08:29:50 +00:00
|
|
|
|
|
|
|
" VIMSPECTOR
|
|
|
|
let g:vimspector_enable_mappings = 'HUMAN'
|
|
|
|
let g:vimspector_install_gadgets = ['debugpy']
|
2023-09-26 17:48:34 +00:00
|
|
|
|
2023-09-27 22:08:36 +00:00
|
|
|
" Config for Coc originally from their github.
|
2023-09-26 17:48:34 +00:00
|
|
|
" Use tab for trigger completion with characters ahead and navigate
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
|
|
\ coc#pum#visible() ? coc#pum#next(1) :
|
|
|
|
\ CheckBackspace() ? "\<Tab>" :
|
|
|
|
\ coc#refresh()
|
|
|
|
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
|
|
|
|
|
|
|
" Make <CR> to accept selected completion item or notify coc.nvim to format
|
|
|
|
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
|
|
|
|
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
|
|
|
|
|
|
|
" Use <c-space> to trigger completion
|
|
|
|
inoremap <silent><expr> <c-@> coc#refresh()
|
2023-09-27 22:08:36 +00:00
|
|
|
|
|
|
|
" Dependenciy of the above. fom Coc github.
|
|
|
|
function! CheckBackspace() abort
|
|
|
|
let col = col('.') - 1
|
|
|
|
return !col || getline('.')[col - 1] =~# '\s'
|
|
|
|
endfunction
|