diff --git a/.config/nvim/lua/plugins/avante.lua b/.config/nvim/lua/plugins/avante.lua index 255b5b6..77c5a5b 100644 --- a/.config/nvim/lua/plugins/avante.lua +++ b/.config/nvim/lua/plugins/avante.lua @@ -1,22 +1,18 @@ return { "yetone/avante.nvim", event = "VeryLazy", - version = false, -- Set this to "*" to always pull the latest release version, or set it to false to update to the latest code changes. + version = false, opts = { }, - -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` build = "make", - -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows dependencies = { "nvim-treesitter/nvim-treesitter", "stevearc/dressing.nvim", "nvim-lua/plenary.nvim", "MunifTanjim/nui.nvim", - --- The below dependencies are optional, - "echasnovski/mini.pick", -- for file_selector provider mini.pick - "nvim-telescope/telescope.nvim", -- for file_selector provider telescope - "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + "echasnovski/mini.pick", + "nvim-telescope/telescope.nvim", + "nvim-tree/nvim-web-devicons", { -- support for image pasting "HakonHarnes/img-clip.nvim", diff --git a/.config/nvim/lua/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua index 2675146..b6fd5e0 100644 --- a/.config/nvim/lua/plugins/blink.lua +++ b/.config/nvim/lua/plugins/blink.lua @@ -1,13 +1,32 @@ return { 'saghen/blink.cmp', - enabled = false, + lazy = false, dependencies = { 'rafamadriz/friendly-snippets', 'mikavilpas/blink-ripgrep.nvim', }, - version = '*', + version = '1.*', opts = { + completion = { + menu = { + auto_show = true, + + winblend = vim.o.pumblend, + + draw = { + columns = { + { "label", "label_description", gap = 1 }, + { "kind_icon", "kind", gap = 1 } + }, + } + }, + + documentation = { auto_show = true, auto_show_delay_ms = 500 }, + + ghost_text = { enabled = false }, + }, + appearance = { use_nvim_cmp_as_default = true, nerd_font_variant = 'mono' @@ -22,11 +41,7 @@ return { }, }, - completion = { - menu = { - winblend = vim.o.pumblend, - }, - }, + signature = { enabled = true, window = { diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua deleted file mode 100644 index a052d34..0000000 --- a/.config/nvim/lua/plugins/cmp.lua +++ /dev/null @@ -1,112 +0,0 @@ -return { - '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').lazy_load() - -- 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', - 'hrsh7th/cmp-nvim-lsp-signature-help', - }, - 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' }, - { name = 'nvim_lsp_signature_help' }, - }, - } - end, -} diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 6b05e18..453fa36 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -2,6 +2,7 @@ return { "neovim/nvim-lspconfig", event = { "BufReadPre", "BufNewFile" }, dependencies = { + { "saghen/blink.cmp" }, { "antosha417/nvim-lsp-file-operations", config = true }, { "williamboman/mason.nvim", config = true }, { "williamboman/mason-lspconfig.nvim" }, @@ -47,19 +48,23 @@ return { keymap.set("n", "d", vim.diagnostic.open_float, opts) opts.desc = "Go to previous diagnostic" - keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) + keymap.set("n", "[d", function() + vim.diagnostic.jump({ count=-1, float=true }) + end, opts) opts.desc = "Go to next diagnostic" - keymap.set("n", "]d", vim.diagnostic.goto_next, opts) + keymap.set("n", "]d", function() + vim.diagnostic.jump({ count=1, float=true }) + end, opts) opts.desc = "Go to previous diagnostic (error only)" keymap.set("n", "[e", function() - vim.diagnostic.goto_prev({ severity = vim.diagnostic.severity.ERROR }) + vim.diagnostic.jump({ count=-1, float=true, severity = vim.diagnostic.severity.ERROR }) end, opts) opts.desc = "Go to next diagnostic (error only)" keymap.set("n", "]e", function() - vim.diagnostic.goto_next({ severity = vim.diagnostic.severity.ERROR }) + vim.diagnostic.jump({ count=1, float=true, severity = vim.diagnostic.severity.ERROR }) end, opts) opts.desc = "Show documentation for what is under cursor" @@ -69,7 +74,7 @@ return { if client and client.server_capabilities.documentHighlightProvider then vim.api.nvim_create_autocmd("LspDetach", { group = vim.api.nvim_create_augroup("lsp-detach", { clear = true }), - callback = function(event2) + callback = function() vim.lsp.buf.clear_references() end, }) @@ -81,8 +86,7 @@ return { capabilities = vim.tbl_deep_extend( "force", capabilities, - -- require('blink.cmp').get_lsp_capabilities(), - require('cmp_nvim_lsp').default_capabilities() + require('blink.cmp').get_lsp_capabilities() ) local base_path = "" @@ -98,7 +102,7 @@ return { local global_ts = base_path .. "/typescript/lib" local found_ts = "" local function check_dir(path) - found_ts = util.path.join(path, "node_modules", "typescript", "lib") + found_ts = table.concat({path, "node_modules", "typescript", "lib"}, "/") if vim.loop.fs_stat(found_ts) then return path end @@ -115,8 +119,6 @@ return { return global_ts end - local path = util.path - local function organize_imports() local params = { command = "_typescript.organizeImports",