Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Plug 'prabirshrestha/asyncomplete.vim'
- Plug 'prabirshrestha/async.vim'
- Plug 'prabirshrestha/vim-lsp'
- Plug 'prabirshrestha/asyncomplete-lsp.vim'
- if executable('clangd')
- au User lsp_setup call lsp#register_server({
- \ 'name': 'clangd',
- \ 'cmd': {server_info->['clangd', '-background-index']},
- \ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
- \ })
- endif
- 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> <f2> <plug>(lsp-rename)
- " refer to doc to add more commands
- endfunction
- augroup lsp_install
- au!
- " call s:on_lsp_buffer_enabled only for languages that has the server registered.
- autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
- augroup END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement