diff --git a/nvim/ftdetect/nu.vim b/nvim/ftdetect/nu.vim new file mode 100644 index 0000000..b1dfcce --- /dev/null +++ b/nvim/ftdetect/nu.vim @@ -0,0 +1,2 @@ +au BufRead,BufNewFile *.nu set filetype=nu + diff --git a/nvim/init.lua b/nvim/init.lua index 118bdee..cce7eaa 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -34,6 +34,7 @@ vim.o.updatetime = 100 vim.keymap.set("n", "", ":noh", { silent = true }) vim.keymap.set("v", "ga", ":EasyAlign") +vim.keymap.set("v", "c", '"+y', { desc = "Copy to system clipboard" }) -- COLORSCHEME -- vim.cmd.colorscheme "habamax.nvim" @@ -61,6 +62,7 @@ require("lspconfig").clangd.setup({ }) vim.lsp.enable('gopls') +vim.lsp.enable('rust-analyzer') vim.diagnostic.config({ virtual_text = false, diff --git a/nvim/lua/plugins/main.lua b/nvim/lua/plugins/main.lua index 7d20e60..56a0d28 100644 --- a/nvim/lua/plugins/main.lua +++ b/nvim/lua/plugins/main.lua @@ -50,4 +50,14 @@ return { end }, { "junegunn/vim-easy-align" }, + { + 'LhKipp/nvim-nu', + build = ':TSInstall nu', + opts = {}, + config = function() + -- vim.g.nu_enable_treesitter = false + -- vim.g.nu_enable_lsp = false + end + }, + { "nvimtools/none-ls.nvim" }, } diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index e2e64c6..310fac8 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -4,7 +4,8 @@ return { branch = 'main', build = ':TSUpdate', opts = { - ensure_installed = { "lua", "vim", "json" }, + ensure_installed = { "lua", "vim", "json", "nu", "c" }, + auto_install = true, highlight = { enable = true }, indent = { enable = true }, config = function(_, opts) diff --git a/nvim/syntax/nu.vim b/nvim/syntax/nu.vim new file mode 100644 index 0000000..b4b3d43 --- /dev/null +++ b/nvim/syntax/nu.vim @@ -0,0 +1,23 @@ +" Basic Nushell syntax highlighting — minimal version + +" Comments +syn match nuComment "#.*$" +hi def link nuComment Comment + +" Strings +syn region nuString start=+"+ skip=+\\\\\|\\"+ end=+"+ +syn region nuString start=+'+ skip=+\\\\\|\\'+ end=+'+ +hi def link nuString String + +" Numbers +syn match nuNumber "\v\d+(\.\d+)?" +hi def link nuNumber Number + +" Keywords (you can expand this list) +syn keyword nuKeyword def let mut const if else for while match return +hi def link nuKeyword Keyword + +" Built-ins and operators +syn match nuOperator "[|=<>:+*/-]" +hi def link nuOperator Operator +