mirror of
https://github.com/prabirshrestha/vim-lsp.git
synced 2025-12-14 20:35:59 +01:00
document lsp_buffer_enabled in README.md (#627)
This commit is contained in:
14
README.md
14
README.md
@@ -22,6 +22,20 @@ if executable('pyls')
|
||||
\ 'whitelist': ['python'],
|
||||
\ })
|
||||
endif
|
||||
|
||||
function! s:on_lsp_buffer_enabled() abort
|
||||
setlocal omnifunc=lsp#complete
|
||||
setlocal signcolumn=yes
|
||||
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
|
||||
```
|
||||
|
||||
Refer to [vim-lsp-settings](https://github.com/mattn/vim-lsp-settings) on how to easily setup language servers using vim-lsp automatically.
|
||||
|
||||
Reference in New Issue
Block a user