diff --git a/lua/custom/plugins/auto-complete.lua b/lua/custom/plugins/auto-complete.lua index e410843..2fd5346 100644 --- a/lua/custom/plugins/auto-complete.lua +++ b/lua/custom/plugins/auto-complete.lua @@ -1,87 +1,112 @@ return { -- Autocompletion - -- 'hrsh7th/nvim-cmp', - -- event = 'InsertEnter', - -- dependencies = { - -- -- Snippet Engine & its associated nvim-cmp source - -- 'saadparwaiz1/cmp_luasnip', - -- - -- -- Adds other completion capabilities. - -- -- nvim-cmp does not ship with all sources by default. They are split - -- -- into multiple repos for maintenance purposes. - -- 'hrsh7th/cmp-nvim-lsp', - -- 'hrsh7th/cmp-path', - -- }, - -- config = function() - -- -- See `:help cmp` - -- local cmp = require 'cmp' - -- local luasnip = require 'luasnip' - -- luasnip.config.setup {} - -- - -- cmp.setup { - -- snippet = { - -- expand = function(args) - -- luasnip.lsp_expand(args.body) - -- end, - -- }, - -- completion = { completeopt = 'menu,menuone,noinsert' }, - -- - -- -- For an understanding of why these mappings were - -- -- chosen, you will need to read `:help ins-completion` - -- -- - -- -- No, but seriously. Please read `:help ins-completion`, it is really good! - -- mapping = cmp.mapping.preset.insert { - -- -- Select the [n]ext item - -- [''] = cmp.mapping.select_next_item(), - -- -- Select the [p]revious item - -- [''] = cmp.mapping.select_prev_item(), - -- - -- -- Scroll the documentation window [b]ack / [f]orward - -- [''] = cmp.mapping.scroll_docs(-4), - -- [''] = cmp.mapping.scroll_docs(4), - -- - -- -- Accept ([y]es) the completion. - -- -- This will auto-import if your LSP supports it. - -- -- This will expand snippets if the LSP sent a snippet. - -- [''] = cmp.mapping.confirm { select = true }, - -- - -- -- If you prefer more traditional completion keymaps, - -- -- you can uncomment the following lines - -- --[''] = cmp.mapping.confirm { select = true }, - -- --[''] = cmp.mapping.select_next_item(), - -- --[''] = cmp.mapping.select_prev_item(), - -- - -- -- Manually trigger a completion from nvim-cmp. - -- -- Generally you don't need this, because nvim-cmp will display - -- -- completions whenever it has completion options available. - -- [''] = cmp.mapping.complete {}, - -- - -- -- Think of as moving to the right of your snippet expansion. - -- -- So if you have a snippet that's like: - -- -- function $name($args) - -- -- $body - -- -- end - -- -- - -- -- will move you to the right of each of the expansion locations. - -- -- is similar, except moving you backwards. - -- [''] = cmp.mapping(function() - -- if luasnip.expand_or_locally_jumpable() then - -- luasnip.expand_or_jump() - -- end - -- end, { 'i', 's' }), - -- [''] = cmp.mapping(function() - -- if luasnip.locally_jumpable(-1) then - -- luasnip.jump(-1) - -- end - -- end, { 'i', 's' }), - -- - -- -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - -- }, - -- sources = { - -- { name = 'nvim_lsp' }, - -- { name = 'luasnip' }, - -- { name = 'path' }, - -- }, - -- } - -- end, + 'hrsh7th/nvim-cmp', + event = 'InsertEnter', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + { + 'L3MON4D3/LuaSnip', + build = (function() + -- Build Step is needed for regex support in snippets. + -- This step is not supported in many windows environments. + -- Remove the below condition to re-enable on windows. + if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + return + end + return 'make install_jsregexp' + end)(), + dependencies = { + -- `friendly-snippets` contains a variety of premade snippets. + -- See the README about individual language/framework/plugin snippets: + -- https://github.com/rafamadriz/friendly-snippets + -- { + -- 'rafamadriz/friendly-snippets', + -- config = function() + -- require('luasnip.loaders.from_vscode').load { + -- exclude = { 'javascript' }, + -- } + -- end, + -- }, + }, + }, + 'saadparwaiz1/cmp_luasnip', + + -- Adds other completion capabilities. + -- nvim-cmp does not ship with all sources by default. They are split + -- into multiple repos for maintenance purposes. + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', + }, + config = function() + -- See `:help cmp` + local cmp = require 'cmp' + local luasnip = require 'luasnip' + luasnip.config.setup {} + + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { completeopt = 'menu,menuone,noinsert' }, + + -- For an understanding of why these mappings were + -- chosen, you will need to read `:help ins-completion` + -- + -- No, but seriously. Please read `:help ins-completion`, it is really good! + mapping = cmp.mapping.preset.insert { + -- Select the [n]ext item + [''] = cmp.mapping.select_next_item(), + -- Select the [p]revious item + [''] = cmp.mapping.select_prev_item(), + + -- Scroll the documentation window [b]ack / [f]orward + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + + -- Accept ([y]es) the completion. + -- This will auto-import if your LSP supports it. + -- This will expand snippets if the LSP sent a snippet. + [''] = cmp.mapping.confirm { select = true }, + + -- If you prefer more traditional completion keymaps, + -- you can uncomment the following lines + --[''] = cmp.mapping.confirm { select = true }, + --[''] = cmp.mapping.select_next_item(), + --[''] = cmp.mapping.select_prev_item(), + + -- Manually trigger a completion from nvim-cmp. + -- Generally you don't need this, because nvim-cmp will display + -- completions whenever it has completion options available. + [''] = cmp.mapping.complete {}, + + -- Think of as moving to the right of your snippet expansion. + -- So if you have a snippet that's like: + -- function $name($args) + -- $body + -- end + -- + -- will move you to the right of each of the expansion locations. + -- is similar, except moving you backwards. + [''] = cmp.mapping(function() + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function() + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { 'i', 's' }), + + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: + -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'path' }, + }, + } + end, } diff --git a/lua/custom/plugins/coq.lua b/lua/custom/plugins/coq.lua deleted file mode 100644 index 6e0770a..0000000 --- a/lua/custom/plugins/coq.lua +++ /dev/null @@ -1,103 +0,0 @@ -return { - 'neovim/nvim-lspconfig', -- REQUIRED: for native Neovim LSP integration - lazy = false, -- REQUIRED: tell lazy.nvim to start this plugin at startup - dependencies = { - -- main one - { 'ms-jpq/coq_nvim', branch = 'coq' }, - - -- 9000+ Snippets - { 'ms-jpq/coq.artifacts', branch = 'artifacts' }, - - -- lua & third party sources -- See https://github.com/ms-jpq/coq.thirdparty - -- Need to **configure separately** - { 'ms-jpq/coq.thirdparty', branch = '3p' }, - -- - shell repl - -- - nvim lua api - -- - scientific calculator - -- - comment banner - -- - etc - }, - init = function() - vim.g.coq_settings = { - auto_start = true, -- if you want to start COQ at startup - -- Your COQ settings here - display = { - preview = { - border = 'solid', - }, - }, - } - end, - config = function() - -- See `:help cmp` - local cmp = require 'coq' - local luasnip = require 'luasnip' - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { completeopt = 'menu,menuone,noinsert' }, - - -- For an understanding of why these mappings were - -- chosen, you will need to read `:help ins-completion` - -- - -- No, but seriously. Please read `:help ins-completion`, it is really good! - mapping = cmp.mapping.preset.insert { - -- Select the [n]ext item - [''] = cmp.mapping.select_next_item(), - -- Select the [p]revious item - [''] = cmp.mapping.select_prev_item(), - - -- Scroll the documentation window [b]ack / [f]orward - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - - -- Accept ([y]es) the completion. - -- This will auto-import if your LSP supports it. - -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, - - -- If you prefer more traditional completion keymaps, - -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, - --[''] = cmp.mapping.select_next_item(), - --[''] = cmp.mapping.select_prev_item(), - - -- Manually trigger a completion from nvim-cmp. - -- Generally you don't need this, because nvim-cmp will display - -- completions whenever it has completion options available. - [''] = cmp.mapping.complete {}, - - -- Think of as moving to the right of your snippet expansion. - -- So if you have a snippet that's like: - -- function $name($args) - -- $body - -- end - -- - -- will move you to the right of each of the expansion locations. - -- is similar, except moving you backwards. - [''] = cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, { 'i', 's' }), - - -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: - -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - }, - } - end, -} diff --git a/lua/custom/plugins/flash.lua b/lua/custom/plugins/flash.lua new file mode 100644 index 0000000..a8d36f4 --- /dev/null +++ b/lua/custom/plugins/flash.lua @@ -0,0 +1,14 @@ +return { + 'folke/flash.nvim', + event = 'VeryLazy', + ---@type Flash.Config + opts = {}, + -- stylua: ignore + keys = { + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, + { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, + { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, + }, +} diff --git a/lua/custom/plugins/lsp-config.lua b/lua/custom/plugins/lsp-config.lua index 96b782f..2659002 100644 --- a/lua/custom/plugins/lsp-config.lua +++ b/lua/custom/plugins/lsp-config.lua @@ -143,7 +143,7 @@ return { -- LSP Configuration & Plugins -- When you add nvim-cmp, luasnip, etc. Neovim now has *more* capabilities. -- So, we create new capabilities with nvim cmp, and then broadcast that to the servers. local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities = vim.tbl_deep_extend('force', capabilities, require('coq').lsp_ensure_capabilities()) + capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. diff --git a/lua/custom/plugins/noice.lua b/lua/custom/plugins/noice.lua new file mode 100644 index 0000000..29373a8 --- /dev/null +++ b/lua/custom/plugins/noice.lua @@ -0,0 +1,15 @@ +return { + 'folke/noice.nvim', + event = 'VeryLazy', + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + 'MunifTanjim/nui.nvim', + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + 'rcarriga/nvim-notify', + }, +}