diff --git a/flake.lock b/flake.lock index 97c935c..d4343f4 100644 --- a/flake.lock +++ b/flake.lock @@ -181,48 +181,14 @@ "type": "github" } }, - "nvim-early-retirement": { - "flake": false, - "locked": { - "lastModified": 1723897376, - "narHash": "sha256-+W3AG99nzgr36t9Sg192hb/MH8s0uGAPD0cLBnil+og=", - "owner": "chrisgrieser", - "repo": "nvim-early-retirement", - "rev": "2c36a5671b9d8f0d9e11b77c5a55de802bc45e34", - "type": "github" - }, - "original": { - "owner": "chrisgrieser", - "repo": "nvim-early-retirement", - "type": "github" - } - }, "root": { "inputs": { "flake-utils": "flake-utils", "gen-luarc": "gen-luarc", "nixpkgs": "nixpkgs", - "nvim-early-retirement": "nvim-early-retirement", - "snipe-nvim": "snipe-nvim", "workspace-diagnostics-nvim": "workspace-diagnostics-nvim" } }, - "snipe-nvim": { - "flake": false, - "locked": { - "lastModified": 1722790509, - "narHash": "sha256-DhJ2ss0p64mpaVo9rri72pEoaWbOOL05klM9AydnqJk=", - "owner": "leath-dub", - "repo": "snipe.nvim", - "rev": "854a47c970413405361487c13e2b1e9aa9a3696e", - "type": "github" - }, - "original": { - "owner": "leath-dub", - "repo": "snipe.nvim", - "type": "github" - } - }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index d578306..c48db06 100644 --- a/flake.nix +++ b/flake.nix @@ -8,14 +8,6 @@ url = "github:mrcjkb/nix-gen-luarc-json"; inputs.nixpkgs.follows = "nixpkgs"; }; - snipe-nvim = { - url = "github:leath-dub/snipe.nvim"; - flake = false; - }; - nvim-early-retirement = { - url = "github:chrisgrieser/nvim-early-retirement"; - flake = false; - }; workspace-diagnostics-nvim = { url = "github:artemave/workspace-diagnostics.nvim"; flake = false; diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 7e579cb..1d11910 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -10,13 +10,12 @@ with final.pkgs.lib; let inherit pname src; version = src.lastModifiedDate; }; - snipe-nvim = mkNvimPlugin inputs.snipe-nvim "snipe-nvim"; - nvim-early-retirement = mkNvimPlugin inputs.nvim-early-retirement "nvim-early-retirement"; workspace-diagnostics-nvim = mkNvimPlugin inputs.workspace-diagnostics-nvim "workspace-diagnostics-nvim"; mkNeovim = pkgs.callPackage ./mkNeovim.nix { inherit pkgs-wrapNeovim; }; all-plugins = with pkgs.vimPlugins; [ + aerial-nvim cmp-buffer cmp-cmdline cmp-nvim-lsp @@ -40,7 +39,6 @@ with final.pkgs.lib; let nvim-dap nvim-dap-go nvim-dap-ui - nvim-early-retirement nvim-lspconfig nvim-nio nvim-treesitter-context @@ -72,9 +70,7 @@ with final.pkgs.lib; let tree-sitter-typescript tree-sitter-yaml ])) - outline-nvim scope-nvim - snipe-nvim telescope-fzf-native-nvim telescope-nvim toggleterm-nvim diff --git a/nvim/lua/config/init.lua b/nvim/lua/config/init.lua index 4e1ded1..ddc501b 100644 --- a/nvim/lua/config/init.lua +++ b/nvim/lua/config/init.lua @@ -1,25 +1,21 @@ vim.opt.backspace = 'indent,eol,start' vim.opt.clipboard = 'unnamedplus' -vim.opt.completeopt = {'menu', 'menuone', 'noselect'} -vim.opt.expandtab = true -- insert tabs as spaces -vim.opt.inccommand = 'split' -- incremental live completion +vim.opt.completeopt = { 'menu', 'menuone', 'noselect' } +vim.opt.expandtab = true -- insert tabs as spaces +vim.opt.inccommand = 'split' -- incremental live completion vim.opt.list = true vim.opt.nrformats:append('alpha') -- let Ctrl-a do letters as well -vim.opt.path:append('**') -- enable fuzzy :find ing +vim.opt.path:append('**') -- enable fuzzy :find ing vim.opt.relativenumber = true -vim.opt.shadafile = 'NONE' -- disable shada -vim.opt.shiftwidth = 0 -- >> shifts by tabstop -vim.opt.showmatch = true -- highlight matching brackets -vim.opt.showmode = false +vim.opt.shadafile = 'NONE' -- disable shada +vim.opt.shiftwidth = 0 -- >> shifts by tabstop +vim.opt.showmatch = true -- highlight matching brackets vim.opt.signcolumn = 'no' -vim.opt.spell = false -vim.opt.softtabstop = -1 -- backspace removes tabstop +vim.opt.softtabstop = -1 -- backspace removes tabstop vim.opt.swapfile = false -vim.opt.tabstop = 2 -- 2 space tabs are based -vim.opt.updatetime = 250 -- decrease update time +vim.opt.tabstop = 2 -- 2 space tabs are based +vim.opt.updatetime = 250 -- decrease update time vim.opt.virtualedit = 'onemore' -vim.opt.wrap = true -vim.g.fzf_layout = { window = { width = 0.9, height = 0.6 } } -- Switch tab length on the fly vim.keymap.set('n', '\\t', function() diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 938be4b..4ac9df8 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -30,7 +30,7 @@ return { }, }, sources = cmp.config.sources({ - { name = 'nvim_lsp', keyword_length = 1 }, + { name = 'nvim_lsp', keyword_length = 1 }, { name = 'luasnip' }, { name = 'buffer' }, { name = 'path' }, diff --git a/nvim/lua/plugins/debug.lua b/nvim/lua/plugins/debug.lua index 9de41c8..852e1c9 100644 --- a/nvim/lua/plugins/debug.lua +++ b/nvim/lua/plugins/debug.lua @@ -25,7 +25,6 @@ return { ui.toggle() end, { desc = 'toggle dapui' }) vim.keymap.set('n', 'zz', function() - scopes = w.sidebar(w.scopes, {}, 'split') d.continue() end, { desc = 'start debugger' }) vim.keymap.set('n', 'zn', function() @@ -53,9 +52,6 @@ return { local widgets = require('dap.ui.widgets') widgets.centered_float(widgets.frames) end, { desc = 'view frames' }) - vim.keymap.set('n', 'zs', function() - scopes.toggle() - end, { desc = 'toggle scope view' }) end, }, } diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index 660e486..32f3837 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -31,6 +31,7 @@ return { event = 'VeryLazy', dependencies = { 'hrsh7th/cmp-nvim-lsp', + 'artemave/workspace-diagnostics.nvim', }, config = function() local lspconfig = require('lspconfig') @@ -133,12 +134,6 @@ return { 'Telescope lsp_references', { buffer = ev.buf, noremap = true, silent = true, desc = 'LSP references' } ) - vim.keymap.set( - 'n', - 'dt', - 'Telescope lsp_type_definitions', - { buffer = ev.buf, noremap = true, silent = true, desc = 'LSP type defs' } - ) vim.keymap.set( 'n', 'ds', diff --git a/nvim/lua/plugins/mini.lua b/nvim/lua/plugins/mini.lua index 7b035be..64d4d8a 100644 --- a/nvim/lua/plugins/mini.lua +++ b/nvim/lua/plugins/mini.lua @@ -70,7 +70,9 @@ return { { mode = 'n', keys = '' }, { mode = 'n', keys = 'z' }, }, - + window = { + config = { width = 'auto', }, + }, clues = { miniclue.gen_clues.g(), miniclue.gen_clues.marks(), @@ -110,11 +112,11 @@ return { local files = require("mini.files") files.setup { mappings = { - synchronize = "w", go_in_plus = "" }, windows = { preview = true, + width_focus = 30, width_preview = 50, } } @@ -133,6 +135,21 @@ return { ) end, }) + vim.api.nvim_create_autocmd("User", { + pattern = "MiniFilesBufferCreate", + callback = function(args) + vim.keymap.set( + "n", + "`", + function() + local cur_entry_path = MiniFiles.get_fs_entry().path + local cur_directory = vim.fs.dirname(cur_entry_path) + vim.fn.chdir(cur_directory) + end, + { buffer = args.data.buf_id } + ) + end, + }) end) end, }, diff --git a/nvim/lua/plugins/misc.lua b/nvim/lua/plugins/misc.lua index 8cc8b72..a1a87f8 100644 --- a/nvim/lua/plugins/misc.lua +++ b/nvim/lua/plugins/misc.lua @@ -13,7 +13,6 @@ return { 'akinsho/toggleterm.nvim', event = 'VeryLazy', opts = { - open_mapping = [[]], direction = 'float', close_on_exit = true, autochdir = true, @@ -35,28 +34,6 @@ return { } }, { 'tiagovla/scope.nvim', event = 'VeryLazy', config = true }, - { - 'chrisgrieser/nvim-early-retirement', - event = 'VeryLazy', - opts = { minimumBufferNum = 10 }, - }, - { - 'leath-dub/snipe.nvim', - event = 'VeryLazy', - opts = { - sort = 'last', - }, - config = function(_, opts) - local snipe = require('snipe') - snipe.setup(opts) - vim.keymap.set( - 'n', - 'fb', - snipe.open_buffer_menu, - { noremap = true, silent = true, desc = 'Pick buffers (snipe.nvim)' } - ) - end, - }, { 'sindrets/diffview.nvim', event = 'VeryLazy', @@ -149,6 +126,7 @@ return { local gs = package.loaded.gitsigns vim.keymap.set('n', 'gg', gs.preview_hunk, { desc = 'git preview hunk' }) vim.keymap.set('n', 'gr', gs.reset_hunk, { desc = 'git reset hunk' }) + vim.keymap.set('n', 'gs', gs.stage_hunk, { desc = 'git stage hunk' }) vim.keymap.set('n', 'gd', gs.diffthis, { desc = 'git diff hunk' }) vim.keymap.set('n', 'gb', function() gs.blame_line { full = true } @@ -164,7 +142,7 @@ return { return ']c' end vim.schedule(function() - gs.next_hunk() + gs.next_hunk({ target = 'all' }) end) return '' end, { expr = true }) @@ -174,7 +152,7 @@ return { return '[c' end vim.schedule(function() - gs.prev_hunk() + gs.prev_hunk({ target = 'all' }) end) return '' end, { expr = true }) @@ -182,17 +160,22 @@ return { }, }, { - 'hedyhli/outline.nvim', - cmd = { 'Outline', 'OutlineOpen' }, + 'stevearc/aerial.nvim', + cmd = { 'AerialToggle' }, keys = { - { 'no', 'Outline', desc = 'Toggle outline' }, + { 'na', 'AerialToggle', desc = 'Toggle aerial' }, }, opts = { - outline_window = { - position = 'left', - width = 30, - auto_close = true, + backends = { + "lsp", + "treesitter", + "markdown" }, + filter_kind = false, + layout = { + default_direction = "left", + }, + autojump = true, }, }, } diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 3b9c4df..f121f96 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -30,7 +30,7 @@ return { storage = "memory", }, }) - vim.keymap.set({"n","x"}, "y", "(YankyYank)") + vim.keymap.set({ "n", "x" }, "y", "(YankyYank)") end, }, }, @@ -93,12 +93,6 @@ return { b.find_files, { noremap = true, silent = true, desc = 'Fuzzy find files' } ) - vim.keymap.set( - 'n', - 'fc', - b.command_history, - { noremap = true, silent = true, desc = 'Fuzzy find command_history' } - ) vim.keymap.set( 'n', 'fa',