]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add a global example of the features configuration into README
authorGuillaume Démurgé <Guillaume Démurgé>
Thu, 18 May 2023 13:09:18 +0000 (15:09 +0200)
committerGuillaume Démurgé <Guillaume Démurgé>
Thu, 18 May 2023 13:12:22 +0000 (15:12 +0200)
README.md

index 28527cbc22c04e311abace2acb55f0d5ed0de55f..daf721ae17cfdef345d589a4f16da8307176f97d 100644 (file)
--- a/README.md
+++ b/README.md
@@ -103,19 +103,57 @@ features|A dictionary of booleans that can be specified to toggle what things a
 
 The LspAddServer() function accepts a list of LSP servers with the above information.
 
+Some of the LSP plugin features can be enabled or disabled by using the LspOptionsSet() function, detailed in `:help lsp-options`.
+Here is an example of configuration with default values:
+```viml
+call LspOptionsSet(#{
+       \   autoComplete: v:true,
+       \   autoHighlight: v:false,
+       \   autoHighlightDiags: v:true,
+       \   autoPopulateDiags: v:false,
+       \   completionMatcher: 'case',
+       \   completionTextEdit: v:true,
+       \   completionKinds: {},
+       \   customCompletionKinds: v:false,
+       \   diagSignErrorText: 'E>',
+       \   diagSignInfoText: 'I>',
+       \   diagSignHintText: 'H>',
+       \   diagSignWarningText: 'W>',
+       \   diagVirtualTextAlign: 'above',
+       \   echoSignature: v:false,
+       \   hideDisabledCodeActions: v:false,
+       \   highlightDiagInline: v:false,
+       \   hoverInPreview: v:false,
+       \   ignoreMissingServer: v:false,
+       \   keepFocusInReferences: v:false,
+       \   noDiagHoverOnLine: v:true,
+       \   noNewlineInCompletion: v:false,
+       \   outlineOnRight: v:false,
+       \   outlineWinSize: 20,
+       \   useQuickfixForLocations: v:false,
+       \   showDiagInPopup: v:true,
+       \   showDiagOnStatusLine: v:false,
+       \   showDiagWithVirtualText: v:false,
+       \   showInlayHints: v:false,
+       \   showSignature: v:true,
+       \   snippetSupport: v:false,
+       \   ultisnipsSupport: v:false,
+       \   usePopupInCodeAction: v:false,
+       \   useBufferCompletion: v:false,
+       \ })
+```
+
 If you used [vim-plug](https://github.com/junegunn/vim-plug) to install the LSP plugin, then you need to use the VimEnter autocmd to initialize the LSP server and to set the LSP server options.  For example:
 ```viml
-let lspServers = [
-       \     #{
-       \        name: 'clang',
-       \        filetype: ['c', 'cpp'],
-       \        path: '/usr/local/bin/clangd',
-       \        args: ['--background-index']
-       \      }
-       \   ]
+let lspServers = [#{
+       \         name: 'clang',
+       \         filetype: ['c', 'cpp'],
+       \         path: '/usr/local/bin/clangd',
+       \         args: ['--background-index']
+       \ }]
 autocmd VimEnter * call LspAddServer(lspServers)
 
-let lspOpts = {'autoHighlightDiags': v:true}
+let lspOpts = #{autoHighlightDiags: v:true}
 autocmd VimEnter * call LspOptionsSet(lspOpts)
 ```