aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOxbian <got.dacs@slmail.me>2023-06-30 16:24:38 +0200
committerOxbian <got.dacs@slmail.me>2023-06-30 16:24:38 +0200
commit450cea46e25d4b14400e6ad912695b56664bd41a (patch)
tree834b2cc7ae61d43ded182e5608fb2177ba657df4
parent8b3a4051b31e50c2ccc7c52db95e87f40ccc675a (diff)
downloadvimrc-450cea46e25d4b14400e6ad912695b56664bd41a.tar.gz
vimrc-450cea46e25d4b14400e6ad912695b56664bd41a.zip
Updating LSP to working solution, need to check if all linter works & add keybinds / docu
-rw-r--r--.vim/after/ftplugin/python.vim17
-rw-r--r--.vim/plugins.vim36
2 files changed, 23 insertions, 30 deletions
diff --git a/.vim/after/ftplugin/python.vim b/.vim/after/ftplugin/python.vim
new file mode 100644
index 0000000..fe4ed31
--- /dev/null
+++ b/.vim/after/ftplugin/python.vim
@@ -0,0 +1,17 @@
+" Python
+
+let g:lsp_settings = {}
+let g:lsp_settings['pylsp'] =
+ \ {
+ \ 'workspace_config': {'pylsp': {
+ \ 'configurationSources': ['flake8'],
+ \ 'plugins': {
+ \ 'flake8': {'enabled': v:true},
+ \ 'mypy-ls': {'enabled': v:true, 'live_mode': v:false},
+ \ 'pylint': {'enabled': v:true},
+ \ 'pydocstyle': {'enabled': v:true},
+ \ 'pyls_isort': {'enabled': v:true},
+ \ 'black': {'enabled': v:true},
+ \ }
+ \ }}
+ \ }
diff --git a/.vim/plugins.vim b/.vim/plugins.vim
index 8bf05eb..bda960d 100644
--- a/.vim/plugins.vim
+++ b/.vim/plugins.vim
@@ -25,9 +25,10 @@ Plug 'tiagofumo/vim-nerdtree-syntax-highlight' " Syntax in nerdtree for files ex
Plug 'airblade/vim-gitgutter' " Git diff
" Autocompletion, linter, syntax
-Plug 'dense-analysis/ale' " Swiss-knife for all this
+Plug 'prabirshrestha/vim-lsp' " Linter & formatter
+Plug 'mattn/vim-lsp-settings' " Automatic vim-lsp installation
Plug 'prabirshrestha/asyncomplete.vim' " Autocompletion
-Plug 'andreypopp/asyncomplete-ale.vim' " Autocompletion with ale
+Plug 'prabirshrestha/asyncomplete-lsp.vim' " Autocompletion & connection with vim-lsp
call plug#end()
@@ -60,33 +61,9 @@ let g:airline_symbols.notexists = 'Ɇ'
let g:airline_symbols.notexists = '∄'
let g:airline_symbols.whitespace = ' Ξ'
-" ALE
-" ALE linter
-let g:ale_linters = {
-\ 'javascript': ['eslint'],
-\ 'python': ['flake8', 'pylint', 'pydocstyle', 'bandit', 'mypy']
-\ }
-
-let g:ale_lint_on_save = 1
-let g:ale_lint_on_text_changed = 0
-let g:ale_open_list = 1
-
-" ALE fixer
-let g:ale_fixers = {
-\ '*': ['remove_trailing_lines', 'trim_whitespace'],
-\ 'python': ['black', 'isort']
-\}
-let g:ale_fix_on_save = 1
-
-let g:ale_echo_msg_error_str = 'E'
-let g:ale_echo_msg_warning_str = 'W'
-let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
-
-let g:ale_set_loclist = 0
-let g:ale_set_signs = 1
-let g:ale_set_highlights = 1
-
-let g:ale_completion_enabled = 0
+" VIM lsp
+let g:lsp_diagnostics_echo_cursor = 1
+let g:lsp_diagnostics_virtual_text_enabled = 0
" NerdTree
let NERDTreeShowHidden=1 " Show hidden files
@@ -101,4 +78,3 @@ autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_
" If more than one window and previous buffer was NERDTree, go back to it.
autocmd BufEnter * if bufname('#') =~# "^NERD_tree_" && winnr('$') > 1 | b# | endif
-let g:plug_window = 'noautocmd vertical topleft new' " Stop crash if vimplug command called on the nerdtree window
ArKa projects. All rights to me, and your next child right arm.