README.md | 12 ++++++------ doc/lsp.txt | 22 +++++++++++----------- diff --git a/README.md b/README.md index b67accb7746858ae91301ccf7e3c81abe0fa6a82..e4c16ba080228eef93f1acd5a20e69955ebd6b0c 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ ```viml vim9script # Clangd language server -call LspAddServer([{ +LspAddServer([{ name: 'clangd', filetype: ['c', 'cpp'], path: '/usr/local/bin/clangd', @@ -63,7 +63,7 @@ args: ['--background-index'] }]) # Javascript/Typescript language server -call LspAddServer([{ +LspAddServer([{ name: 'typescriptlang', filetype: ['javascript', 'typescript'], path: '/usr/local/bin/typescript-language-server', @@ -71,7 +71,7 @@ args: ['--stdio'], }]) # Go language server -call LspAddServer([{ +LspAddServer([{ name: 'golang', filetype: ['go', 'gomod'], path: '/usr/local/bin/gopls', @@ -80,7 +80,7 @@ syncInit: v:true }]) # Rust language server -call LspAddServer([{ +LspAddServer([{ name: 'rustlang', filetype: ['rust'], path: '/usr/local/bin/rust-analyzer', @@ -115,10 +115,10 @@ path: '/usr/local/bin/clangd', args: ['--background-index'] } ] -autocmd VimEnter * call LspAddServer(lspServers) +autocmd VimEnter * LspAddServer(lspServers) var lspOpts = {'autoHighlightDiags': v:true} -autocmd VimEnter * call LspOptionsSet(lspOpts) +autocmd VimEnter * LspOptionsSet(lspOpts) ``` ## Supported Commands diff --git a/doc/lsp.txt b/doc/lsp.txt index ef8223a630c1493aaffd2c6735e5c4d1e6a59096..953a3cf944da1d4875320c0eb58df388ad224acd 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -179,7 +179,7 @@ path: '/usr/local/bin/pyls', args: ['--check-parent-process', '-v'] } ] - call LspAddServer(lspServers) + LspAddServer(lspServers) < Depending on the location of the typescript and python pyls language servers installed in your system, update the "path" in the above snippet @@ -233,7 +233,7 @@ licenceKey: 'xxxxxxxxxxxxxxx' } } ] - call LspAddServer(lspServers) + LspAddServer(lspServers) < To add a language server, the following information is needed: @@ -363,10 +363,10 @@ path: '/usr/local/bin/clangd', args: ['--background-index'] } ] - autocmd VimEnter * call LspAddServer(lspServers) + autocmd VimEnter * LspAddServer(lspServers) var lspOpts = {'autoHighlightDiags': v:true} - autocmd VimEnter * call LspOptionsSet(lspOpts) + autocmd VimEnter * LspOptionsSet(lspOpts) < *lsp-options* *LspOptionsSet* *g:LspOptionsSet* @@ -521,7 +521,7 @@ For example, to disable the automatic placement of signs for the LSP diagnostic messages, you can add the following line to your .vimrc file: > - call LspOptionsSet({'autoHighlightDiags': v:false}) + LspOptionsSet({'autoHighlightDiags': v:false}) < The LspOptionsGet() function returns a |Dict| of all the LSP plugin options, To get a particular option value you can use the following: > @@ -710,7 +710,7 @@ in a popup window. If you want to show the symbol documentation in the preview window instead of in a popup set > - call LspOptionsSet({'hoverInPreview': v:true}) + LspOptionsSet({'hoverInPreview': v:true}) < Default is false. @@ -925,7 +925,7 @@ opens the location window. If you want to show the references in a quickfix list instead of in a location list set > - call LspOptionsSet({'useQuickfixForLocations': v:true}) + LspOptionsSet({'useQuickfixForLocations': v:true}) < *:LspShowSignature* :LspShowSignature Displays the signature of the symbol (e.g. a function @@ -937,14 +937,14 @@ separator (e.g. a opening parenthesis). To disable this, you can set the showSignature option to false in your .vimrc file: > - call LspOptionsSet({'showSignature': v:false}) + LspOptionsSet({'showSignature': v:false}) < Default is true. You can get the function signature echoed in cmdline rather than displayed in popup if you use > - call LspOptionsSet({'echoSignature': v:true}) + LspOptionsSet({'echoSignature': v:true}) < Default is false. @@ -1034,7 +1034,7 @@ To disable the auto-completion for all the files, you can set the 'autoComplete' option to v:false in your .vimrc file: > - call LspOptionsSet({'autoComplete': v:false}) + LspOptionsSet({'autoComplete': v:false}) < If this variable is set, then the LSP plugin will not automatically start completion in insert mode and instead supports omni-completion (|compl-omni|). @@ -1099,7 +1099,7 @@ To disable the automatic placement of signs on the lines with a diagnostic message, you can set the 'autoHighlightDiags' option to v:false: > - call LspOptionsSet({'autoHighlightDiags': v:false}) + LspOptionsSet({'autoHighlightDiags': v:false}) < By default the 'autoHighlightDiags' option is set to v:true.