Language Support
Language specific support means there is a combination of language specific
plugins, treesitter
support, nvim-lspconfig
language servers, and null-ls
integration. This gets you capabilities ranging from autocompletion to
formatting to diagnostics. The following languages have sections under the
vim.languages
attribute.
- Rust: vim.languages.rust.enable
- Nix: vim.languages.nix.enable
- SQL: vim.languages.sql.enable
- C/C++: vim.languages.clang.enable
- Typescript/Javascript: vim.languages.ts.enable
- Python: vim.languages.python.enable:
- Zig: vim.languages.zig.enable
- Markdown: vim.languages.markdown.enable
- HTML: vim.languages.html.enable
- Dart: vim.languages.dart.enable
- Go: vim.languages.go.enable
- Lua: vim.languages.lua.enable
- PHP: vim.languages.php.enable
- F#: vim.languages.fsharp.enable
Adding support for more languages, and improving support for existing ones are great places where you can contribute with a PR.
LSP Custom Packages/Command
One of the strengths of nvf is convenient aliases to quickly configure LSP
servers through the Nix module system. By default the LSP packages for relevant
language modules will be pulled into the closure. If this is not desirable, you
may provide a custom LSP package (e.g., a Bash script that calls a command)
or a list of strings to be interpreted as the command to launch the language
server. By using a list of strings, you can use this to skip automatic
installation of a language server, and instead use the one found in your $ PATH
during runtime, for example:
vim.languages.java = {
lsp = {
enable = true;
# This expects 'jdt-language-server' to be in your PATH or in
# 'vim.extraPackages.' There are no additional checks performed to see
# if the command provided is valid.
package = ["jdt-language-server" "-data" "~/.cache/jdtls/workspace"];
};
}