diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index d67b5ac..6155355 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,17 +1,23 @@ { + "LuaSnip": { "branch": "master", "commit": "faf3c94a44508cec1b961406d36cc65113ff3b98" }, + "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, + "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, + "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, "conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" }, "fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "luau-lsp.nvim": { "branch": "main", "commit": "f81c6c713e4598abc484cbeabca918475d176c54" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "3856bbb0da214d1f2f3d5a2dd3fea26591f930f9" }, - "mason.nvim": { "branch": "main", "commit": "9eaedb864cdadc29c6eb7d761a6c0d8aee26c91b" }, - "mini.nvim": { "branch": "main", "commit": "14ce72476995255fc5cb919da8067f65865e1225" }, - "nvim-lspconfig": { "branch": "master", "commit": "562487bc108bf73c2493f9e701b9334b48163216" }, - "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "87888865fa1ce1928a25b9abbea8c8f7839bf522" }, + "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, + "mini.nvim": { "branch": "main", "commit": "d90adc96b68b310cf17d8ebcc8e2e4626c6bb8cc" }, + "neovim": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" }, + "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, + "nvim-lspconfig": { "branch": "master", "commit": "d45702594afc661a9dfa95e96acf18c56006d4d9" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "rose-pine": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" } } diff --git a/.config/nvim/lua/rocketcamel/plugins/lsp.lua b/.config/nvim/lua/rocketcamel/plugins/lsp.lua index 0ebdbdf..a62f8b1 100755 --- a/.config/nvim/lua/rocketcamel/plugins/lsp.lua +++ b/.config/nvim/lua/rocketcamel/plugins/lsp.lua @@ -6,6 +6,11 @@ return { "williamboman/mason-lspconfig.nvim", "j-hui/fidget.nvim", "lopi-py/luau-lsp.nvim", + "hrsh7th/nvim-cmp", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-path", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-nvim-lsp", }, config = function() require("mason").setup() @@ -23,24 +28,53 @@ return { "gopls", "templ", }, - handlers = { - function(server) - require("lspconfig")[server].setup({}) - end, - luau_lsp = function() - require("luau-lsp").setup({ - fflags = { - enable_new_solver = true, - }, - platform = { - type = "roblox", - }, - types = { - roblox_security_level = "PluginSecurity", - }, - }) + automatic_enable = { + exclude = { "luau_lsp" }, + }, + }) + local cmp = require("cmp") + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) end, }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + local capabilities = require("cmp_nvim_lsp").default_capabilities() + vim.lsp.config("*", { + capabilities = capabilities, + }) + cmp.setup.cmdline({ "/", "?" }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = "buffer" }, + }, + }) + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + matching = { disallow_symbol_nonprefix_matching = false }, }) end, }, diff --git a/.config/nvim/lua/rocketcamel/plugins/luasnip.lua b/.config/nvim/lua/rocketcamel/plugins/luasnip.lua new file mode 100644 index 0000000..432a7bd --- /dev/null +++ b/.config/nvim/lua/rocketcamel/plugins/luasnip.lua @@ -0,0 +1,5 @@ +return { + { + "L3MON4D3/LuaSnip", + }, +} diff --git a/.config/nvim/lua/rocketcamel/plugins/mini.lua b/.config/nvim/lua/rocketcamel/plugins/mini.lua index 4b3805a..194739f 100755 --- a/.config/nvim/lua/rocketcamel/plugins/mini.lua +++ b/.config/nvim/lua/rocketcamel/plugins/mini.lua @@ -3,7 +3,6 @@ return { "echasnovski/mini.nvim", version = false, config = function() - require("mini.completion").setup() require("mini.fuzzy").setup() require("mini.pairs").setup() require("mini.comment").setup() diff --git a/.config/nvim/lua/rocketcamel/plugins/rose-pine.lua b/.config/nvim/lua/rocketcamel/plugins/rose-pine.lua index 6bf228f..2f356c6 100755 --- a/.config/nvim/lua/rocketcamel/plugins/rose-pine.lua +++ b/.config/nvim/lua/rocketcamel/plugins/rose-pine.lua @@ -1,7 +1,6 @@ return { { "rose-pine/neovim", - name = "rose-pine", config = function() require("rose-pine").setup({ styles = { diff --git a/.config/nvim/lua/rocketcamel/plugins/treesitter.lua b/.config/nvim/lua/rocketcamel/plugins/treesitter.lua index 0018406..9d1c178 100755 --- a/.config/nvim/lua/rocketcamel/plugins/treesitter.lua +++ b/.config/nvim/lua/rocketcamel/plugins/treesitter.lua @@ -1,32 +1,35 @@ return { { "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = { - "c", - "lua", - "vim", - "vimdoc", - "query", - "markdown", - "markdown_inline", - "javascript", - "typescript", - "tsx", - "rust", - "zig", - "svelte", - "html", - }, - sync_install = true, - auto_install = true, - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { - enable = true, - }, - }, + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { + "c", + "lua", + "vim", + "vimdoc", + "query", + "markdown", + "markdown_inline", + "javascript", + "typescript", + "tsx", + "rust", + "zig", + "svelte", + "html", + "templ", + "go", + }, + auto_install = true, + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + indent = { + enable = true, + }, + }) + end, }, } diff --git a/nix/modules/commonPackages.nix b/nix/modules/commonPackages.nix index c87fb8d..f9ac9b9 100644 --- a/nix/modules/commonPackages.nix +++ b/nix/modules/commonPackages.nix @@ -41,6 +41,11 @@ bluetui go templ + bun + air + tailwindcss_4 + gnumake + watchman ]; programs.nix-ld.enable = lib.mkDefault true; programs.zsh.enable = lib.mkDefault true; diff --git a/nix/users/luca/zsh.nix b/nix/users/luca/zsh.nix index 9db6173..5d16c34 100644 --- a/nix/users/luca/zsh.nix +++ b/nix/users/luca/zsh.nix @@ -20,6 +20,9 @@ in envExtra = '' export PATH="$PATH:$HOME/.rokit/bin" + export GOPATH="$HOME/go" + export GOBIN="$HOME/go/bin" + export PATH="$GOBIN:$PATH" '' + "\n" + aliases;