From 95c65a6b221fe6e1cf91e8322e7d7571dc511a71 Mon Sep 17 00:00:00 2001 From: Mathias Fußenegger Date: Sun, 10 Jul 2022 17:26:43 +0200 Subject: feat(lsp): defaults: tagfunc, omnifunc (#19003) set `tagfunc` to `vim.lsp.tagfunc` and `omnifunc` to `vim.lsp.omnifunc` if empty when attaching a server --- runtime/doc/lsp.txt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index c1d7f3a45a..78100d5277 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -51,15 +51,14 @@ Starting a LSP client will automatically report diagnostics via |vim.diagnostic|. Read |vim.diagnostic.config| to learn how to customize the display. -To get completion from the LSP server you can enable the |vim.lsp.omnifunc|: -> - vim.bo.omnifunc = 'v:lua.vim.lsp.omnifunc' -< -To trigger completion, use |i_CTRL-X_CTRL-O| - -To get features like go-to-definition you can enable the |vim.lsp.tagfunc| -which changes commands like |:tjump| to utilize the language server and also -enables keymaps like |CTLR-]|, |CTRL-W_]|, |CTRL-W_}| and many more. +It also sets some buffer options if the options are otherwise empty and if the +language server supports the functionality. + +- |omnifunc| is set to |vim.lsp.omnifunc|. This allows to trigger completion + using |i_CTRL-X_CTRL-o| +- |tagfunc| is set to |vim.lsp.tagfunc|. This enables features like + go-to-definition, |:tjump|, and keymaps like |CTRL-]|, |CTRL-W_]|, + |CTRL-W_}| to utilize the language server. To use other LSP features like hover, rename, etc. you can setup some additional keymaps. It's recommended to setup them in a |LspAttach| autocmd to -- cgit