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)
```