vim9script
# Clangd language server
-call LspAddServer([{
+LspAddServer([{
name: 'clangd',
filetype: ['c', 'cpp'],
path: '/usr/local/bin/clangd',
}])
# Javascript/Typescript language server
-call LspAddServer([{
+LspAddServer([{
name: 'typescriptlang',
filetype: ['javascript', 'typescript'],
path: '/usr/local/bin/typescript-language-server',
}])
# Go language server
-call LspAddServer([{
+LspAddServer([{
name: 'golang',
filetype: ['go', 'gomod'],
path: '/usr/local/bin/gopls',
}])
# Rust language server
-call LspAddServer([{
+LspAddServer([{
name: 'rustlang',
filetype: ['rust'],
path: '/usr/local/bin/rust-analyzer',
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
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
}
}
]
- call LspAddServer(lspServers)
+ LspAddServer(lspServers)
<
To add a language server, the following information is needed:
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*
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: >
documentation in the preview window instead of in a
popup set >
- call LspOptionsSet({'hoverInPreview': v:true})
+ LspOptionsSet({'hoverInPreview': v:true})
<
Default is false.
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
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.
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|).
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.