document lsp_buffer_enabled in README.md (#627)

This commit is contained in:
Prabir Shrestha
2019-12-25 23:43:56 -08:00
committed by GitHub
parent 9becd620b7
commit 6dd95bbcab

View File

@@ -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.