nvim: Add experimental nushell lsp and treesitter

HACK
Added support for nushell lsp (not yet available to automatically install
through mason integration) and for nushell treesitter (VERY manual
installation as of right now).

Will work for testing out the shell and its nvim integration but
definitely has to be integrated better in the future.
This commit is contained in:
Marty Oehme 2023-12-04 09:28:22 +01:00
parent 78f7112c11
commit 4d886e7e6d
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 15 additions and 0 deletions

View file

@ -137,6 +137,7 @@ lsp.setup({
}) })
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
lspconfig.nushell.setup({})
local python_path local python_path
-- ensure python virtualenv is determined automatically on lsp start -- ensure python virtualenv is determined automatically on lsp start

View file

@ -39,6 +39,20 @@ return {
enable = true, enable = true,
enable_autocmd = false, -- since we run it as a hook from the mini.comment plugin enable_autocmd = false, -- since we run it as a hook from the mini.comment plugin
}) })
-- treesitter parser for nushell. To fully get e.g. syntax highlight
-- working you need a highlight file too. For now I installed manually, see:
-- https://github.com/nushell/tree-sitter-nu/blob/main/installation/neovim.md
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.nu = {
install_info = {
url = "https://github.com/nushell/tree-sitter-nu",
files = { "src/parser.c" },
branch = "main",
},
filetype = "nu",
}
end, end,
event = "BufReadPost", event = "BufReadPost",
cmd = { cmd = {