summaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim')
-rw-r--r--vim/.vimrc23
1 files changed, 13 insertions, 10 deletions
diff --git a/vim/.vimrc b/vim/.vimrc
index d5182d9..d9edeec 100644
--- a/vim/.vimrc
+++ b/vim/.vimrc
@@ -14,8 +14,6 @@ Plug 'ap/vim-buftabline'
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-commentary'
Plug 'yegappan/lsp'
-Plug 'mattn/vim-lsp-settings'
-Plug 'normen/vim-lsp-settings-adapter'
Plug 'dense-analysis/ale'
Plug 'kalbasit/vim-colemak'
call plug#end()
@@ -71,14 +69,16 @@ let g:ale_linters = {
\'vim': ['vint'],
\'css': ['stylelint'],
\'html': ['tidy', 'htmlhint'],
- \'js': ['eslint']
+ \'js': ['eslint'],
+ \'go': ['golangci-lint'],
+ \'markdown': [],
\}
let g:ale_fixers = {
\'html': ['tidy'],
\}
let g:ale_html_tidy_options = '-indent -asxhtml -q '
let g:ale_sign_column_always = 1
-let g:ale_lint_on_text_changed = 'normal'
+let g:lsp_settings_filetype_markdown = []
let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 1
let g:buftabline_show = 2
@@ -99,13 +99,12 @@ let g:which_key_map.b = {
\ 'b' : ['Buffers', 'fuzzy find buffers'],
\ }
call which_key#register('<Space>', 'g:which_key_map')
-" lsp
+
augroup lsp
- autocmd!
autocmd User LspSetup call LspOptionsSet(#{
\ autoComplete: v:true,
\ autoHighlightDiags: v:true,
- \ noNewlineInCompletion: v:true,
+ \ noNewlineCompletion: v:true,
\ formatFallback: v:false,
\ })
@@ -115,8 +114,12 @@ autocmd User LspSetup call LspAddServer([
\ #{name: 'clangd', filetype: ['c', 'cpp', 'objc', 'objcpp'], path: 'clangd', args: ['--background-index']},
\ #{name: 'html', filetype: 'html', path: 'vscode-html-language-server', args: ['--stdio']},
\ #{name: 'css', filetype: ['css', 'scss', 'less'], path: 'vscode-css-language-server', args: ['--stdio']},
+ \ #{name: 'js', filetype: ['ts', 'js', 'jsx'], path: 'typescript-language-server', args: []},
+ \ #{name: 'vim', filetype: 'vim', path: 'vim-language-server', args: ['--stdio']},
+ \ #{name: 'go', filetype: 'go', path: 'gopls', args: ['--stdio']},
+ \ #{name: 'zk', filetype: 'markdown', path: 'zk', args: ['lsp']},
\])
-
+
autocmd User LspAttached call s:lsp_keymaps()
function! s:lsp_keymaps() abort
@@ -128,9 +131,9 @@ function! s:lsp_keymaps() abort
nmap <buffer> [g :LspDiagPrev<CR>
nmap <buffer> ]g :LspDiagNext<CR>
nmap <buffer> K :LspHover<CR>
- if index(['vim', 'html', 'css'], &filetype) == -1
+ if index(['vim', 'html', 'css', 'markdown'], &filetype) == -1
autocmd BufWritePre <buffer> LspFormat
- endif
+ endif
endfunction
augroup END