From 6d6c04a71eff7bb7808dfd71d6d8d4b8b547dccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 1 Oct 2018 11:31:22 +0200 Subject: vim: configure completion using ale --- vim/ftplugin/c.vim | 2 ++ vim/ftplugin/cpp.vim | 3 +++ vim/ftplugin/python.vim | 3 +++ vimrc | 8 ++------ 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 vim/ftplugin/c.vim create mode 100644 vim/ftplugin/cpp.vim diff --git a/vim/ftplugin/c.vim b/vim/ftplugin/c.vim new file mode 100644 index 0000000..1f57627 --- /dev/null +++ b/vim/ftplugin/c.vim @@ -0,0 +1,2 @@ +let b:ale_linters = ['cppcheck', 'gcc', 'cquery'] +let b:ale_fixers = ['remove_trailing_lines', 'trim_whitespace'] diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim new file mode 100644 index 0000000..8b20787 --- /dev/null +++ b/vim/ftplugin/cpp.vim @@ -0,0 +1,3 @@ +" This is for C but vim defines *.h as cpp type so here we have it +let b:ale_linters = ['cppcheck', 'gcc', 'cquery'] +let b:ale_fixers = ['remove_trailing_lines', 'trim_whitespace'] diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim index 03b655f..42d5eff 100644 --- a/vim/ftplugin/python.vim +++ b/vim/ftplugin/python.vim @@ -1,2 +1,5 @@ setlocal colorcolumn=79 setlocal textwidth=79 + +let b:ale_linters = ['flake8', 'pylint', 'pyls'] +let b:ale_fixers = ['autopep8', 'isort', 'black', 'add_blank_lines_for_python_control_statements', 'remove_trailing_lines', 'trim_whitespace'] diff --git a/vimrc b/vimrc index 544e18d..3deb955 100644 --- a/vimrc +++ b/vimrc @@ -152,12 +152,8 @@ let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" " Ale -let g:ale_lint_on_text_changed = 'never' -let g:ale_linters = {'c': ['cppcheck', 'gcc']} -let g:ale_fixers = { -\ 'c': ['remove_trailing_lines', 'trim_whitespace'], -\ 'python': ['autopep8', 'isort', 'add_blank_lines_for_python_control_statements', 'remove_trailing_lines', 'trim_whitespace'], -\} +let g:ale_completion_enabled = 1 +let g:ale_set_highlights = 0 " YouCompleteMe let g:ycm_autoclose_preview_window_after_completion = 1 -- cgit v1.2.3