diff --git a/home/common/nvim/default.nix b/home/common/nvim/default.nix index fde0dd9..146c3ba 100644 --- a/home/common/nvim/default.nix +++ b/home/common/nvim/default.nix @@ -51,6 +51,16 @@ targets-vim ts-comments-nvim + { + plugin = blink-cmp; + type = "lua"; + config = '' + require'blink-cmp'.setup({ + keymap = 'super-tab', + }) + ''; + } + { plugin = codeium-nvim; type = "lua"; diff --git a/home/common/nvim/init.lua b/home/common/nvim/init.lua index 682ef71..bc847e8 100644 --- a/home/common/nvim/init.lua +++ b/home/common/nvim/init.lua @@ -53,17 +53,16 @@ vim.opt.foldexpr = "nvim_treesitter#foldexpr()" -- vim.o.autochdir = true +vim.o.cia = 'kind,abbr,menu' vim.o.fillchars = "stl: ,stlnc: ,eob:░,vert:│" +vim.o.icm = "split" vim.o.list = false vim.o.scrolloff = 7 -vim.o.splitkeep = "screen" -vim.o.updatetime = 50 -vim.o.timeout = true -vim.o.timeoutlen = 10 -vim.o.icm = "split" -vim.o.cia = 'kind,abbr,menu' - vim.o.showmode = false +vim.o.splitkeep = "screen" +vim.o.timeoutlen = 10 +vim.o.timeout = true +vim.o.updatetime = 50 -- Use rg @@ -124,6 +123,8 @@ vim.keymap.set("n", 'k', vim.lsp.buf.hover, opts("Show docs for item und vim.keymap.set('n', 'q', require('mini.bufremove').delete, opts("Delete buffer")) vim.keymap.set('n', 's', "Pick lsp scope='document_symbol'", opts("Open symbol picker")) vim.keymap.set('n', 'S', "Pick lsp scope='workspace_symbol'", opts("Open workspace symbol picker")) +vim.keymap.set("n", "ws", "s", opts("Horizontal split")) +vim.keymap.set("n", "wv", "v", opts("Vertical split")) vim.keymap.set('n', '', "Pick buffers include_current=false", opts("Buffers")) vim.keymap.set("n", "zz", "zt", { remap = true }) vim.keymap.set({ "n", "v" }, "y", '"+y', opts("Yank to clipboard")) @@ -135,33 +136,3 @@ vim.keymap.set("n", "gr", vim.lsp.buf.references, opts("Buffer References")) vim.keymap.set("n", "gt", vim.lsp.buf.type_definition, opts("Type Definition")) vim.keymap.set({"n", "i"}, "", vim.lsp.buf.signature_help, opts("Signature Help")) vim.keymap.set({ "n", "v" }, "aa", vim.lsp.buf.code_action, opts("Code Action")) -vim.keymap.set("n", "ws", "s", opts("Horizontal split")) -vim.keymap.set("n", "wv", "v", opts("Vertical split")) - --- Completion -vim.keymap.set('i', '', [[pumvisible() ? "\" : "\"]], { expr = true }) -vim.keymap.set('i', '', [[pumvisible() ? "\" : "\"]], { expr = true }) - -local keycode = vim.keycode or function(x) - return vim.api.nvim_replace_termcodes(x, true, true, true) -end -local keys = { - ['cr'] = keycode(''), - ['ctrl-y'] = keycode(''), - ['ctrl-y_cr'] = keycode(''), -} - -_G.cr_action = function() - if vim.fn.pumvisible() ~= 0 then - -- If popup is visible, confirm selected item or add new line otherwise - local item_selected = vim.fn.complete_info()['selected'] ~= -1 - return item_selected and keys['ctrl-y'] or keys['ctrl-y_cr'] - else - -- If popup is not visible, use plain ``. You might want to customize - -- according to other plugins. For example, to use 'mini.pairs', replace - -- next line with `return require('mini.pairs').cr()` - return keys['cr'] - end -end - -vim.keymap.set('i', '', 'v:lua._G.cr_action()', { expr = true }) diff --git a/home/common/nvim/mini.lua b/home/common/nvim/mini.lua index c37cb52..0b41ecd 100644 --- a/home/common/nvim/mini.lua +++ b/home/common/nvim/mini.lua @@ -15,14 +15,6 @@ require('mini.cursorword').setup({ delay = 800 }) -require('mini.completion').setup({ - window = { - info = { height = 25, width = 80, border = 'rounded' }, - signature = { height = 25, width = 80, border = 'rounded' }, - }, -}) - - local hipatterns = require('mini.hipatterns') hipatterns.setup({ highlighters = { @@ -49,8 +41,8 @@ require('mini.jump2d').setup({ }) local picker_win_config = function() - height = vim.o.lines - 8 - width = 80 + local height = vim.o.lines - 8 + local width = 80 return { border = 'rounded', anchor = 'NW', @@ -70,10 +62,6 @@ require('mini.pick').setup({ options = { use_cache = true }, window = { config = picker_win_config, - -- config = { - -- border = 'rounded', - -- width = 'auto', - -- }, }, }) MiniPick.registry.files_root = function(local_opts)