diff --git a/after/plugin/trouble.lua b/after/plugin/trouble.lua index 584dfac..18e42f0 100644 --- a/after/plugin/trouble.lua +++ b/after/plugin/trouble.lua @@ -3,9 +3,9 @@ require("trouble").setup({ -- or leave it empty to use the default settings -- refer to the configuration section below }) -vim.api.nvim_set_keymap("n", "xx", "Trouble", { silent = true, noremap = true }) -vim.api.nvim_set_keymap("n", "xw", "Trouble workspace_diagnostics", { silent = true, noremap = true }) -vim.api.nvim_set_keymap("n", "xd", "Trouble document_diagnostics", { silent = true, noremap = true }) -vim.api.nvim_set_keymap("n", "xl", "Trouble loclist", { silent = true, noremap = true }) -vim.api.nvim_set_keymap("n", "xq", "Trouble quickfix", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "tx", "Trouble", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "tw", "Trouble workspace_diagnostics", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "td", "Trouble document_diagnostics", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "tl", "Trouble loclist", { silent = true, noremap = true }) +vim.api.nvim_set_keymap("n", "tq", "Trouble quickfix", { silent = true, noremap = true }) vim.api.nvim_set_keymap("n", "gR", "Trouble lsp_references", { silent = true, noremap = true }) diff --git a/lazy-lock.json b/lazy-lock.json index 151f88b..72e5227 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,47 +1,39 @@ { - "LuaSnip": { "branch": "master", "commit": "fb525166ccc30296fb3457441eb979113de46b00" }, "Vim-Jinja2-Syntax": { "branch": "master", "commit": "2c17843b074b06a835f88587e1023ceff7e2c7d1" }, - "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" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "8132ec733eed3bf415b97b76797ca41b59f51d7d" }, - "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, - "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, + "blink.cmp": { "branch": "main", "commit": "4e9edba1b1cef1585cc65e54287229e5d34e4df8" }, + "conform.nvim": { "branch": "master", "commit": "a0ab60ed666c56b37fd7ed1847d2ac52f2482ce0" }, "deepl.vim": { "branch": "main", "commit": "59df8cc17bb28989ce562bf4712c724d23baadcd" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "gen.nvim": { "branch": "main", "commit": "c8e1f574d4a3a839dde73a87bdc319a62ee1e559" }, "gina.vim": { "branch": "master", "commit": "ff6c2ddeca98f886b57fb42283c12e167d6ab575" }, - "gitsigns.nvim": { "branch": "main", "commit": "1b0350ab707713b2bc6c236151f1a324175347b1" }, - "hover.nvim": { "branch": "main", "commit": "07c7269c3a88751f2f36ed0563dc6e7b8b84f7f7" }, + "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "hover.nvim": { "branch": "main", "commit": "24a43e0eda924f1f32361c76ee9a1f0e8cc25650" }, "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, + "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lsp-colors.nvim": { "branch": "main", "commit": "2bbe7541747fd339bdd8923fc45631a09bb4f1e5" }, - "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, - "lsp_signature.nvim": { "branch": "master", "commit": "2923666d092300e6d03c8d895991d0bef43f1613" }, - "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, - "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, - "lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "f54e3c11fc9ebfcfc27e696182b0295b071d0811" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "neoconf.nvim": { "branch": "main", "commit": "ed993a4d945b5d37cb165df3f7172c34e7fce70e" }, - "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, - "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, - "nvim-dap": { "branch": "master", "commit": "2edd6375692d9ac1053d50acfe415c1eb2ba92d0" }, - "nvim-genghis": { "branch": "main", "commit": "16268746ae4617be8e8989748b9a0b0372f5e3b4" }, - "nvim-jdtls": { "branch": "master", "commit": "4d77ff02063cf88963d5cf10683ab1fd15d072de" }, - "nvim-lint": { "branch": "master", "commit": "2b0039b8be9583704591a13129c600891ac2c596" }, - "nvim-lspconfig": { "branch": "master", "commit": "0112e1f77983141e1453bd37d124302f1c876c46" }, + "lsp-progress.nvim": { "branch": "main", "commit": "f61cb7a788e4695ed9ae5e1b6b01bfff8f136f8b" }, + "lsp_signature.nvim": { "branch": "master", "commit": "62cadce83aaceed677ffe7a2d6a57141af7131ea" }, + "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "lush.nvim": { "branch": "main", "commit": "1be16d9002f8b2e8973a19ceac199ad394dea76a" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "1ec4da522fa49dcecee8d190efda273464dd2192" }, + "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, + "multicursor.nvim": { "branch": "1.0", "commit": "9eedebdd395bbbc4711081e33b0606c079e054c3" }, + "neoconf.nvim": { "branch": "main", "commit": "987be783f7e4cb9273e0e9b21c220f3b722b1ec6" }, + "nvim-dap": { "branch": "master", "commit": "968f89f8aac11b6bdbfc942c71d3436658c1435f" }, + "nvim-genghis": { "branch": "main", "commit": "0fccd6f547d954607083b66d08043b8ed54dee7a" }, + "nvim-jdtls": { "branch": "master", "commit": "7d1545614235cf6cf68b0839556d87c8f11c5eb5" }, + "nvim-lint": { "branch": "master", "commit": "ee04d481d4e6089892c2fb2ad8924b1a053591e1" }, + "nvim-lspconfig": { "branch": "master", "commit": "3d97ec4174bcc750d70718ddedabf150536a5891" }, "nvim-luadev": { "branch": "master", "commit": "3ba0c02c378503739f1fdb95cff3ea2aad48db3e" }, - "nvim-metals": { "branch": "main", "commit": "7b3057f85c7c76d85b9d2d3c97c9d34fcb9f1bdc" }, + "nvim-metals": { "branch": "main", "commit": "db6c9ffb32ec698b96d11cba1317dccc26f5c16d" }, "nvim-quick-switcher": { "branch": "main", "commit": "b56ba55cff165ae1551836a79313933bf4d43ae2" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "1a1a7c5d6d75cb49bf64049dafab15ebe294a79f" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "89ebe73cd2836db80a22d9748999ace0241917a5" }, - "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, + "nvim-treesitter-context": { "branch": "master", "commit": "dca8726fea2c14e1ce6adbaa76a04816fbfaff61" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "71385f191ec06ffc60e80e6b0c9a9d5daed4824c" }, + "nvim-web-devicons": { "branch": "master", "commit": "4ae47f4fb18e85b80e84b729974fe65483b06aaf" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "shipwright.nvim": { "branch": "master", "commit": "e596ab48328c31873f4f4d2e070243bf9de16ff3" }, "splice.vim": { "branch": "master", "commit": "815a28e687fdf78b67e9b9cd4c21277bbe658873" }, @@ -50,28 +42,27 @@ "telescope-lsp-handlers.nvim": { "branch": "trunk", "commit": "de02085d6af1633942549a238bc7a5524fa9b201" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, - "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, + "vim-caddyfile": { "branch": "master", "commit": "6d60d5af0d73f20b88ec388a9d70188d55ed8223" }, "vim-characterize": { "branch": "master", "commit": "a8bffac6cead6b2869d939ecad06312b187a4c79" }, "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, - "vim-fugitive": { "branch": "master", "commit": "593f831d6f6d779cbabb70a4d1e6b1b1936a88af" }, + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, "vim-gitignore": { "branch": "master", "commit": "641dfa648d2581a5e5e9b0d11ffee37da8de49d7" }, "vim-gnupg": { "branch": "main", "commit": "f9b608f29003dfde6450931dc0f495a912973a88" }, "vim-highlightedyank": { "branch": "master", "commit": "285a61425e79742997bbde76a91be6189bc988fb" }, "vim-hocon": { "branch": "main", "commit": "5df6dc1b7c8f5811afe663b0441e6304a729dcaf" }, "vim-indent-object": { "branch": "master", "commit": "8ab36d5ec2a3a60468437a95e142ce994df598c6" }, - "vim-kitty": { "branch": "main", "commit": "309b8451cff8ad77a24ee332b5d9db4162f1655d" }, + "vim-kitty": { "branch": "main", "commit": "5c3efc79af70dc2c22cad03e6a7374a5f81205d9" }, "vim-ledger": { "branch": "master", "commit": "aabf1976dfefe5665233c600421aea2798ff7ea0" }, "vim-markdown-composer": { "branch": "master", "commit": "e6f99bc20cfcb277c63041b1f766e6d5940bcc76" }, "vim-mkdir": { "branch": "master", "commit": "f0ba7a7dc190a0cedf1d827958c99f3718109cf0" }, "vim-nftables": { "branch": "master", "commit": "26f8a506c6f3e41f1e4a8d6aa94c9a79a666bbff" }, - "vim-pass": { "branch": "master", "commit": "40d606f5b9488bf76273fd508addbee303f7b958" }, + "vim-pass": { "branch": "master", "commit": "bb3ab598c4730e538eb3cefa39fbb8ed5775072c" }, "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-textobj-comment": { "branch": "master", "commit": "58ae4571b76a5bf74850698f23d235eef991dd4b" }, "vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, - "vim-theme-chroma": { "branch": "lush", "commit": "0ad7be22f2244f99a877edfd6261eaba47952b6f" }, - "vimtex": { "branch": "master", "commit": "e10525a5aa65e2544f11e680dd81c77fba800248" }, + "vimtex": { "branch": "master", "commit": "dc90feacb86f7b85b0b791d8073eefc769a23725" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, "workspace-diagnostics.nvim": { "branch": "main", "commit": "60f9175b2501ae3f8b1aba9719c0df8827610c8e" } } diff --git a/lua/.luarc.json b/lua/.luarc.json deleted file mode 100644 index 841ada9..0000000 --- a/lua/.luarc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "workspace.checkThirdParty": false -} diff --git a/lua/debug.lua b/lua/debug.lua deleted file mode 100644 index fecfb51..0000000 --- a/lua/debug.lua +++ /dev/null @@ -1,39 +0,0 @@ --- Setup nvim-cmp. -local cmp = require("cmp") - -cmp.setup({ - snippet = { - expand = function(args) - --vim.fn["vsnip#anonymous"](args.body) - require("luasnip").lsp_expand(args.body) - end, - }, - mapping = { - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm({ select = true }), - }, - sources = { - { name = "nvim_lsp" }, - - -- For vsnip user. - { name = "vsnip" }, - - -- For luasnip user. - -- { name = 'luasnip' }, - - -- For ultisnips user. - -- { name = 'ultisnips' }, - - { name = "buffer" }, - }, -}) - --- Setup lsp. -metals_config = require("metals").bare_config -metals_config.init_options.statusBarProvider = "on" -metals_config.settings = { showImplicitArguments = true } -metals_config.on_attach = on_attach -metals_config.capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index a87a0ff..d956bb1 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -1,121 +1,122 @@ -return { - { - "hrsh7th/nvim-cmp", - -- load cmp on InsertEnter - event = "InsertEnter", - -- these dependencies will only be loaded when cmp loads - -- dependencies are always lazy-loaded unless specified otherwise - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "hrsh7th/cmp-cmdline", - -- 'hrsh7th/cmp-vsnip', - -- 'hrsh7th/vim-vsnip', - -- 'hrsh7th/vim-vsnip-integ', - "L3MON4D3/LuaSnip", - "saadparwaiz1/cmp_luasnip", - "onsails/lspkind.nvim", - { - "zbirenbaum/copilot-cmp", - dependencies = { - "hrsh7th/nvim-cmp", - { - "zbirenbaum/copilot.lua", - opts = { - suggestion = { enabled = false }, - panel = { enabled = false }, - filetypes = { - mail = false, - text = false, - }, - }, - }, - }, - config = function() - require("copilot_cmp").setup() - end, - }, - }, - config = function() - local cmp = require("cmp") - local lspkind = require("lspkind") - local luasnip = require("luasnip") - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 - and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - cmp.setup({ - snippet = { - expand = function(args) - --vim.fn["vsnip#anonymous"](args.body) - require("luasnip").lsp_expand(args.body) - end, - }, - mapping = { - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - [""] = cmp.mapping({ - i = function(fallback) - if cmp.visible() and cmp.get_active_entry() then - cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) - else - fallback() - end - end, - s = cmp.mapping.confirm({ select = true }), - c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "copilot" }, - }, { - { name = "buffer", option = { keyword_pattern = [[\k\+]] } }, - --{ name = 'path' }, - }), - formatting = { - format = lspkind.cmp_format({ - mode = "symbol_text", -- show only symbol annotations - maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) - ellipsis_char = "…", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) - symbol_map = { Copilot = "" }, - }), - }, - }) - end, - }, -} +return {} +--return { +-- { +-- "hrsh7th/nvim-cmp", +-- -- load cmp on InsertEnter +-- event = "InsertEnter", +-- -- these dependencies will only be loaded when cmp loads +-- -- dependencies are always lazy-loaded unless specified otherwise +-- dependencies = { +-- "hrsh7th/cmp-nvim-lsp", +-- "hrsh7th/cmp-buffer", +-- "hrsh7th/cmp-path", +-- "hrsh7th/cmp-cmdline", +-- -- 'hrsh7th/cmp-vsnip', +-- -- 'hrsh7th/vim-vsnip', +-- -- 'hrsh7th/vim-vsnip-integ', +-- "L3MON4D3/LuaSnip", +-- "saadparwaiz1/cmp_luasnip", +-- "onsails/lspkind.nvim", +-- { +-- "zbirenbaum/copilot-cmp", +-- dependencies = { +-- "hrsh7th/nvim-cmp", +-- { +-- "zbirenbaum/copilot.lua", +-- opts = { +-- suggestion = { enabled = false }, +-- panel = { enabled = false }, +-- filetypes = { +-- mail = false, +-- text = false, +-- }, +-- }, +-- }, +-- }, +-- config = function() +-- require("copilot_cmp").setup() +-- end, +-- }, +-- }, +-- config = function() +-- local cmp = require("cmp") +-- local lspkind = require("lspkind") +-- local luasnip = require("luasnip") +-- local has_words_before = function() +-- unpack = unpack or table.unpack +-- local line, col = unpack(vim.api.nvim_win_get_cursor(0)) +-- return col ~= 0 +-- and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil +-- end +-- +-- cmp.setup({ +-- snippet = { +-- expand = function(args) +-- --vim.fn["vsnip#anonymous"](args.body) +-- require("luasnip").lsp_expand(args.body) +-- end, +-- }, +-- mapping = { +-- [""] = cmp.mapping.confirm({ select = true }), +-- [""] = cmp.mapping.scroll_docs(-4), +-- [""] = cmp.mapping.scroll_docs(4), +-- [""] = cmp.mapping.complete(), +-- [""] = cmp.mapping.abort(), +-- [""] = cmp.mapping.confirm({ +-- behavior = cmp.ConfirmBehavior.Replace, +-- select = true, +-- }), +-- [""] = cmp.mapping({ +-- i = function(fallback) +-- if cmp.visible() and cmp.get_active_entry() then +-- cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }) +-- else +-- fallback() +-- end +-- end, +-- s = cmp.mapping.confirm({ select = true }), +-- c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), +-- }), +-- [""] = cmp.mapping(function(fallback) +-- if cmp.visible() then +-- cmp.select_next_item() +-- -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() +-- -- they way you will only jump inside the snippet region +-- elseif luasnip.expand_or_jumpable() then +-- luasnip.expand_or_jump() +-- elseif has_words_before() then +-- cmp.complete() +-- else +-- fallback() +-- end +-- end, { "i", "s" }), +-- [""] = cmp.mapping(function(fallback) +-- if cmp.visible() then +-- cmp.select_prev_item() +-- elseif luasnip.jumpable(-1) then +-- luasnip.jump(-1) +-- else +-- fallback() +-- end +-- end, { "i", "s" }), +-- }, +-- sources = cmp.config.sources({ +-- { name = "nvim_lsp" }, +-- { name = "luasnip" }, +-- { name = "copilot" }, +-- }, { +-- { name = "buffer", option = { keyword_pattern = [[\k\+]] } }, +-- --{ name = 'path' }, +-- }), +-- formatting = { +-- format = lspkind.cmp_format({ +-- mode = "symbol_text", -- show only symbol annotations +-- maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) +-- ellipsis_char = "…", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first) +-- symbol_map = { Copilot = "" }, +-- }), +-- }, +-- }) +-- end, +-- }, +--} diff --git a/lua/plugins/gen.lua b/lua/plugins/gen.lua index eaabe4c..06422de 100644 --- a/lua/plugins/gen.lua +++ b/lua/plugins/gen.lua @@ -1,7 +1,7 @@ return { "David-Kunz/gen.nvim", opts = { - model = "mistral", -- The default model to use. + model = "gemma3:12b-it-qat", -- The default model to use. init = false, }, cmd = "Gen", diff --git a/lua/plugins/lazydev.lua b/lua/plugins/lazydev.lua new file mode 100644 index 0000000..571212f --- /dev/null +++ b/lua/plugins/lazydev.lua @@ -0,0 +1,55 @@ +return { + { + "folke/lazydev.nvim", + ft = "lua", -- only load on lua files + opts = { + library = { + -- See the configuration section for more details + -- Load luvit types when the `vim.uv` word is found + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, + }, + }, + { -- optional blink completion source for require statements and module annotations + "saghen/blink.cmp", + --version = "1.*", + build = "cargo build --release", + ---@module 'blink.cmp' + ---@type blink.cmp.Config + opts = { + sources = { + -- add lazydev to your completion providers + default = { "lazydev", "lsp", "path", "snippets", "buffer" }, + providers = { + lazydev = { + name = "LazyDev", + module = "lazydev.integrations.blink", + -- make lazydev completions top priority (see `:h blink.cmp`) + score_offset = 100, + }, + }, + }, + -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) + -- 'super-tab' for mappings similar to vscode (tab to accept) + -- 'enter' for enter to accept + -- 'none' for no mappings + -- + -- All presets have the following mappings: + -- C-space: Open menu or open docs if already open + -- C-n/C-p or Up/Down: Select next/previous item + -- C-e: Hide menu + -- C-k: Toggle signature help (if signature.enabled = true) + -- + -- See :h blink-cmp-config-keymap for defining your own keymap + keymap = { preset = "super-tab" }, + appearance = { nerd_font_variant = "mono" }, + completion = { + documentation = { auto_show = false }, + list = { selection = { preselect = false, auto_insert = true } }, + }, + fuzzy = { implementation = "prefer_rust_with_warning" }, + ghost_text = { enabled = true }, + }, + opts_extend = { "sources.default" }, + }, +} diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index c5be928..ad19e3a 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -5,9 +5,7 @@ return { event = { "BufReadPre", "BufNewFile" }, dependencies = { { "folke/neoconf.nvim", cmd = "Neoconf", config = true }, - { "folke/neodev.nvim", opts = {} }, "mason-org/mason.nvim", - "hrsh7th/cmp-nvim-lsp", }, ---@class PluginLspOpts opts = function() diff --git a/lua/plugins/metals.lua b/lua/plugins/metals.lua index cab27e8..9cafd1d 100644 --- a/lua/plugins/metals.lua +++ b/lua/plugins/metals.lua @@ -3,7 +3,7 @@ return { dependencies = { "nvim-lua/plenary.nvim", "mfussenegger/nvim-dap", - "hrsh7th/cmp-nvim-lsp", + --"hrsh7th/cmp-nvim-lsp", }, ft = { "scala", "sbt" }, config = function() @@ -16,7 +16,7 @@ return { metals_config.on_attach = function(client, bufnr) require("metals").setup_dap() end - metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() + --metals_config.capabilities = require("cmp_nvim_lsp").default_capabilities() -- Debug settings if you're using nvim-dap local dap = require("dap") dap.configurations.scala = { diff --git a/lua/plugins/multicursor.lua b/lua/plugins/multicursor.lua new file mode 100644 index 0000000..080249e --- /dev/null +++ b/lua/plugins/multicursor.lua @@ -0,0 +1,76 @@ +return { + "jake-stewart/multicursor.nvim", + branch = "1.0", + config = function() + local mc = require("multicursor-nvim") + mc.setup() + + local set = vim.keymap.set + + -- Add or skip cursor above/below the main cursor. + set({ "n", "x" }, "", function() + mc.lineAddCursor(-1) + end) + set({ "n", "x" }, "", function() + mc.lineAddCursor(1) + end) + set({ "n", "x" }, "", function() + mc.lineSkipCursor(-1) + end) + set({ "n", "x" }, "", function() + mc.lineSkipCursor(1) + end) + + -- Add or skip adding a new cursor by matching word/selection + set({ "n", "x" }, "", function() + mc.matchAddCursor(1) + end) + set({ "n", "x" }, "", function() + mc.matchSkipCursor(1) + end) + set({ "n", "x" }, "", function() + mc.matchAddCursor(-1) + end) + set({ "n", "x" }, "", function() + mc.matchSkipCursor(-1) + end) + + -- Add and remove cursors with control + left click. + set("n", "", mc.handleMouse) + set("n", "", mc.handleMouseDrag) + set("n", "", mc.handleMouseRelease) + + -- Disable and enable cursors. + set({ "n", "x" }, "", mc.toggleCursor) + + -- Mappings defined in a keymap layer only apply when there are + -- multiple cursors. This lets you have overlapping mappings. + mc.addKeymapLayer(function(layerSet) + -- Select a different cursor as the main one. + layerSet({ "n", "x" }, "h", mc.prevCursor) + layerSet({ "n", "x" }, "l", mc.nextCursor) + + -- Delete the main cursor. + layerSet({ "n", "x" }, "x", mc.deleteCursor) + + -- Enable and clear cursors using escape. + layerSet("n", "", function() + if not mc.cursorsEnabled() then + mc.enableCursors() + else + mc.clearCursors() + end + end) + end) + + -- Customize how cursors look. + local hl = vim.api.nvim_set_hl + hl(0, "MultiCursorCursor", { reverse = true }) + hl(0, "MultiCursorVisual", { link = "Visual" }) + hl(0, "MultiCursorSign", { link = "SignColumn" }) + hl(0, "MultiCursorMatchPreview", { link = "Search" }) + hl(0, "MultiCursorDisabledCursor", { reverse = true }) + hl(0, "MultiCursorDisabledVisual", { link = "Visual" }) + hl(0, "MultiCursorDisabledSign", { link = "SignColumn" }) + end, +}