2021-06-11 22:55:32 +02:00
|
|
|
""" ALE configuration
|
|
|
|
|
2021-07-21 20:41:08 +02:00
|
|
|
let s:user_dir = has('win32') ? expand('~/vimfiles') : expand('~/.vim')
|
2021-06-15 16:26:37 +02:00
|
|
|
let g:ale_completion_enabled = 0
|
2021-06-11 22:55:32 +02:00
|
|
|
let g:ale_sign_error = '->'
|
|
|
|
let g:ale_sign_warning = '~>'
|
|
|
|
" let g:ale_sign_error = '✘'
|
|
|
|
" let g:ale_sign_warning = '⚠'
|
|
|
|
|
2021-07-21 20:41:08 +02:00
|
|
|
let g:ale_elixir_elixir_ls_release = s:user_dir . './pack/vendor/start/vim-elixirls/elixir-ls/release'
|
2021-06-11 22:55:32 +02:00
|
|
|
|
|
|
|
let g:ale_linters = {
|
|
|
|
\ 'javascript': ['eslint'],
|
2021-07-21 20:42:01 +02:00
|
|
|
\ 'javascriptreact': ['eslint'],
|
|
|
|
\ 'typescript': ['deno', 'tsserver', 'tslint'],
|
|
|
|
\ 'typescriptreact': ['deno', 'tsserver', 'tslint'],
|
2021-06-11 22:55:32 +02:00
|
|
|
\ 'python': ['pyls', 'pylint'],
|
|
|
|
\ 'rust': ['rls'],
|
2021-07-21 20:41:08 +02:00
|
|
|
\ 'elixir': ['credo', 'elixir-ls'],
|
2021-06-11 22:55:32 +02:00
|
|
|
\ 'go': ['gopls'],
|
|
|
|
\ 'json': ['jsonlint'],
|
|
|
|
\ 'dockerfile': ['hadolint'],
|
|
|
|
\ 'vala': ['vala-language-server'],
|
|
|
|
\ 'scss': ['eslint'],
|
|
|
|
\ 'elm': ['elm_ls'],
|
2021-07-21 20:42:25 +02:00
|
|
|
\ 'sql': ['sql-lint'],
|
2021-06-11 22:55:32 +02:00
|
|
|
\}
|
|
|
|
|
|
|
|
let g:ale_fixers = {
|
|
|
|
\ 'javascript': ['prettier'],
|
|
|
|
\ 'typescript': ['prettier'],
|
2021-07-21 20:42:01 +02:00
|
|
|
\ 'javascriptreact': ['prettier'],
|
|
|
|
\ 'typescriptreact': ['prettier'],
|
2021-06-11 22:55:32 +02:00
|
|
|
\ 'python': ['black', 'pyls'],
|
|
|
|
\ 'rust': ['rustfmt'],
|
|
|
|
\ 'elixir': ['mix_format'],
|
|
|
|
\ 'graphql': ['prettier'],
|
|
|
|
\ 'perl': ['perltidy'],
|
|
|
|
\ 'go': ['gofmt'],
|
|
|
|
\ 'json': ['prettier'],
|
|
|
|
\ 'vala': ['uncrustify'],
|
|
|
|
\ 'dart': ['dartfmt'],
|
|
|
|
\ 'scss': ['prettier'],
|
|
|
|
\}
|
|
|
|
|
|
|
|
function! s:getValaProjectRoot(buffer) abort
|
|
|
|
let l:cur_path_abs = fnamemodify(a:buffer, ':p:h')
|
|
|
|
let l:maybe_doap_file = expand(l:cur_path_abs . s:sep . '*.doap')
|
|
|
|
if !empty(l:maybe_doap_file)
|
|
|
|
return l:cur_path_abs
|
|
|
|
endif
|
|
|
|
|
|
|
|
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
|
|
|
if filereadable(expand(l:path . '*.doap'))
|
|
|
|
return l:path
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
|
|
|
|
return ''
|
|
|
|
endfunction
|
|
|
|
|
2021-06-22 23:05:27 +02:00
|
|
|
packloadall
|
|
|
|
|
2021-06-11 22:55:32 +02:00
|
|
|
call ale#linter#Define('vala', {
|
|
|
|
\ 'name': 'vala-language-server',
|
|
|
|
\ 'lsp': 'stdio',
|
|
|
|
\ 'output_stream': 'both',
|
|
|
|
\ 'executable': '/usr/bin/vala-language-server',
|
|
|
|
\ 'command': '%e',
|
|
|
|
\ 'project_root': function('s:getValaProjectRoot'),
|
|
|
|
\ 'callback': 'ale#handlers#unix#HandleAsWarning',
|
|
|
|
\})
|
|
|
|
|
|
|
|
let g:ale_rust_rls_config = {
|
|
|
|
\ 'rust': {
|
|
|
|
\ 'clippy_preference': 'on'
|
|
|
|
\ }
|
|
|
|
\ }
|
|
|
|
|
|
|
|
let g:ale_echo_msg_error_str = 'Err'
|
|
|
|
let g:ale_echo_msg_warning_str = 'Warn'
|
|
|
|
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
|
|
|
|
|
|
|
|
let g:ale_go_langserver_executable = 'gopls'
|
|
|
|
" let g:ale_go_revive_executable = '/usr/bin/revive'
|
|
|
|
" let g:ale_go_revive_options = '-config ~/.vim/revive.toml'
|
|
|
|
|
|
|
|
let g:airline#extensions#ale#enabled = 1
|
|
|
|
|
2021-07-21 20:43:10 +02:00
|
|
|
let g:ale_completion_enabled = 1
|
2021-06-11 22:55:32 +02:00
|
|
|
let g:ale_lint_on_enter = 0
|
|
|
|
let g:ale_lint_on_text_changed = 'never'
|
|
|
|
highlight ALEErrorSign ctermbg=NONE ctermfg=red
|
|
|
|
highlight ALEWarningSign ctermbg=NONE ctermfg=yellow
|
|
|
|
let g:ale_linters_explicit = 1
|
|
|
|
let g:ale_lint_on_save = 1
|
|
|
|
let g:ale_fix_on_save = 1
|
|
|
|
|
2021-07-21 20:43:10 +02:00
|
|
|
" let g:ale_set_balloons = 1
|
|
|
|
let g:ale_hover_to_preview = 1
|
|
|
|
let g:ale_float_preview = 1
|
|
|
|
let g:ale_floating_window_border = ['│', '─', '╭', '╮', '╯', '╰']
|
|
|
|
|
|
|
|
set omnifunc=ale#completion#OmniFunc
|