From 427e265b8f7a34d9b6c475f0d937011e562bf1f3 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Tue, 27 Sep 2022 07:16:06 -0700 Subject: [PATCH] Update LSP server configuration help --- README.md | 77 +++++++++++++++++++++++++++++------------------------ doc/lsp.txt | 28 +++++++++---------- 2 files changed, 55 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 5e18a54..242adf7 100644 --- a/README.md +++ b/README.md @@ -28,41 +28,48 @@ You will also need to install one or more language servers corresponding to the 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'] - \ }, - \ { - \ 'filetype': 'vim', - \ 'path': '/usr/local/bin/vim-language-server', - \ 'args': ['--stdio'] - \ }, - \ { - \ 'filetype': ['go', 'gomod'], - \ 'path': '/usr/local/bin/gopls', - \ 'args': [] - \ }, - \ { - \ 'filetype': ['python'], - \ 'path': '/usr/local/bin/pyls', - \ 'args': [] - \ }, - \ { - \ 'filetype': ['fortran'], - \ 'path': '/usr/local/bin/fortls', - \ 'args': ['--nthreads=1', '--use_signature_help', '--hover_signature'] - \ } + \ #{ + \ 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'] + \ }, + \ #{ + \ filetype: 'vim', + \ path: '/usr/local/bin/vim-language-server', + \ args: ['--stdio'] + \ }, + \ #{ + \ filetype: ['go', 'gomod'], + \ path: '/usr/local/bin/gopls', + \ args: ['serve'] + \ syncInit: v:true, + \ }, + \ #{ + \ filetype: ['rust'], + \ path: '/usr/local/bin/rust-analyzer', + \ args: [] + \ syncInit: v:true, + \ }, + \ #{ + \ filetype: ['python'], + \ path: '/usr/local/bin/pyls', + \ args: [] + \ }, + \ #{ + \ filetype: ['fortran'], + \ path: '/usr/local/bin/fortls', + \ args: ['--nthreads=1', '--use_signature_help', '--hover_signature'] + \ } \ ] call LspAddServer(lspServers) ``` diff --git a/doc/lsp.txt b/doc/lsp.txt index 1511f0e..ccf282a 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.2342 and above -Last change: Sep 9, 2022 +Last change: Sep 27, 2022 ============================================================================== *lsp-license* @@ -139,16 +139,16 @@ For example, to add the LSP servers for the Javascript, Typescript and Python file types, add the following commands to the .vimrc file: > let lspServers = [ - \ { - \ 'filetype': ['javascript', 'typescript'], - \ 'path': '/usr/local/bin/typescript-language-server', - \ 'args': ['--stdio'] - \ }, - \ { - \ 'filetype': 'python', - \ 'path': '/usr/local/bin/pyls', - \ 'args': ['--check-parent-process', '-v'] - \ } + \ #{ + \ filetype: ['javascript', 'typescript'], + \ path: '/usr/local/bin/typescript-language-server', + \ args: ['--stdio'] + \ }, + \ #{ + \ filetype: 'python', + \ path: '/usr/local/bin/pyls', + \ args: ['--check-parent-process', '-v'] + \ } \ ] call LspAddServer(lspServers) < @@ -167,17 +167,15 @@ Shell script and Vim file types: > \ }, \ #{ \ filetype: ['go', 'gomod', 'gohtmltmpl', 'gotexttmpl'], - \ path: '/home/dza/.go/bin/gopls', + \ path: '/path/to/.go/bin/gopls', \ args: [], \ syncInit: v:true, - \ omnicompl: v:true, \ }, \ #{ \ filetype: ['rust'], - \ path: '/home/dza/.cargo/bin/rust-analyzer', + \ path: '/path/to/.cargo/bin/rust-analyzer', \ args: [], \ syncInit: v:true, - \ omnicompl: v:true, \ }, \ #{ \ filetype: 'sh', -- 2.48.1