From 436a3e3e9a272e98ce3a01db0208e268b9e382bd Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Wed, 30 Dec 2020 07:29:18 -0800 Subject: [PATCH] Update the help text --- doc/lsp.txt | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/doc/lsp.txt b/doc/lsp.txt index 0a4bef4..552fade 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -2,7 +2,7 @@ Author: Yegappan Lakshmanan (yegappan AT yahoo DOT com) For Vim version 8.2.2082 and above -Last change: Dec 19, 2020 +Last change: Dec 30, 2020 ============================================================================== *lsp-license* @@ -80,9 +80,58 @@ The following commands are provided: cursor in a new quickfix list. :LspHighlight Highlight all the matches for the keyword under cursor :LspHighlightClear Clear all the matches highlighted by :LspHighlight +:LspShowSymbols Show the list of symbols defined in the current file + in a separate window. +:LspFormat Format the current file using the LSP server. +:{range}LspFormat Format the specified range of files. +:LspCalledBy Display the list of symbols called by the current + symbol. (NOT IMPLEMENTED YET). +:LspCalling Display the list of symbols calling the current symbol + (NOT IMPLEMENTED YET). +:LspRename Rename the current symbol +:LspCodeAction Apply the code action supplied by the LSP server to + the diagnostic in the current line. ============================================================================== 4. Configuration *lsp-configuration* +To register a LSP server, add the following lines to your .vimrc file: +> + let lspServers = [ + \ { + \ 'filetype': ['c', 'cpp'], + \ 'path': '/usr/local/bin/clangd', + \ 'args': ['--background-index'] + \ }, + \ { + \ 'filetype': ['javascript', 'typescript'], + \ 'path': '/usr/local/bin/typescript-language-server', + \ 'args': ['--stdio'] + \ } + \ { + \ 'filetype': 'sh', + \ 'path': '/usr/local/bin/bash-language-server', + \ 'args': ['start'] + \ }, + \ ] + call lsp#addServer(lspServers) +< +The above lines add the LSP servers for C, C++, Javascript, Typescript and +Shell script file types. + +To add a LSP server, the following information is needed: + + filetype One or more file types supported by the LSP server. + This can be a |String| or a |List|. To specify + multiple multiple file types, use a List. + path complete path to the LSP server executable (without + any arguments). + args a list of command-line arguments passed to the LSP + server. Each argument is a separate List item. + +The LSP servers are added using the lsp#addServer() function. This function +accepts a list of LSP servers with the above information. + +============================================================================== vim:tw=78:ts=8:noet:ft=help: -- 2.48.1