-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
50 lines (44 loc) · 1.52 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
syntax on
"{{ Leader key
let mapleader = ","
"}}
call plug#begin('~/.vim/plugged')
"{{ More languages
Plug 'sheerun/vim-polyglot'
"}}
"{{ LSP
Plug 'prabirshrestha/vim-lsp'
Plug 'mattn/vim-lsp-settings'
function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
setlocal signcolumn=yes
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
nmap <buffer> gd <plug>(lsp-definition)
nmap <buffer> gs <plug>(lsp-document-symbol-search)
nmap <buffer> gS <plug>(lsp-workspace-symbol-search)
nmap <buffer> gr <plug>(lsp-references)
nmap <buffer> gi <plug>(lsp-implementation)
nmap <buffer> gt <plug>(lsp-type-definition)
nmap <buffer> <leader>r <plug>(lsp-rename)
nmap <buffer> <leader>c <plug>(lsp-code-action)
nmap <buffer> [g <plug>(lsp-previous-diagnostic)
nmap <buffer> ]g <plug>(lsp-next-diagnostic)
nmap <buffer> K <plug>(lsp-hover)
nmap <buffer> W <plug>(lsp-document-diagnostics)
map <buffer> f <plug>(lsp-document-range-format)
nmap <buffer> f <plug>(lsp-document-range-format)
nmap <S-f> <plug>(lsp-document-format)
nnoremap <buffer> <expr><M-u> lsp#scroll(+4)
nnoremap <buffer> <expr><M-d> lsp#scroll(-4)
endfunction
augroup lsp_install
au!
let g:lsp_signs_enabled = 1
let g:lsp_diagnostics_echo_cursor = 1
let g:lsp_highlight_references_enabled = 1
let g:lsp_document_highlight_enabled = 1
"let g:polyglot_disabled = ['folds']
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END
"}}
call plug#end()