diff --git a/config/nvim/lua/plugins/dap.lua b/config/nvim/lua/plugins/dap.lua deleted file mode 100644 index 63ff977..0000000 --- a/config/nvim/lua/plugins/dap.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - { - 'rcarriga/nvim-dap-ui', - dependencies = { - 'mfussenegger/nvim-dap', - 'nvim-neotest/nvim-nio', - 'theHamsta/nvim-dap-virtual-text', - 'ray-x/go.nvim', - 'ray-x/guihua.lua', - 'leoluz/nvim-dap-go', - }, - setup = function() - require('dapui').setup() - require('dap-go').setup() - require('nvim-dap-virtual-text').setup {} - - vim.fn.sign_define('DapBreakpoint', { - text = '🔴', - texthl = 'DapBreakpoint', - linehl = 'DapBreakpoint', - numhl = 'DapBreakpoint', - }) - end, - }, -} diff --git a/config/nvim/lua/plugins/flash.lua b/config/nvim/lua/plugins/flash.lua index 9c0bc45..fc0e1b9 100644 --- a/config/nvim/lua/plugins/flash.lua +++ b/config/nvim/lua/plugins/flash.lua @@ -1,3 +1,6 @@ +-- Navigate your code with search labels, enhanced +-- character motions and Treesitter integration +-- https://github.com/folke/flash.nvim return { 'folke/flash.nvim', event = 'VeryLazy', diff --git a/config/nvim/lua/plugins/lualine.lua b/config/nvim/lua/plugins/lualine.lua index 0256e85..9081c97 100644 --- a/config/nvim/lua/plugins/lualine.lua +++ b/config/nvim/lua/plugins/lualine.lua @@ -38,15 +38,13 @@ return { 'diagnostics', }, lualine_c = { - 'buffers', - -- 'filename', + 'filename', }, lualine_x = { - -- 'fileformat', 'filetype', }, lualine_y = { - -- 'progress' + 'location', }, lualine_z = { { diff --git a/config/nvim/lua/plugins/mini.lua b/config/nvim/lua/plugins/mini.lua new file mode 100644 index 0000000..e216404 --- /dev/null +++ b/config/nvim/lua/plugins/mini.lua @@ -0,0 +1,40 @@ +-- https://github.com/echasnovski/mini.nvim +-- https://github.com/echasnovski/mini.nvim/tree/main?tab=readme-ov-file#modules +return { + -- Presets for common options and mappings + { 'echasnovski/mini.basics', version = '*' }, + + -- Visualize and work with indent scope + -- Replaced lukas-reineke/indent-blankline.nvim + { 'echasnovski/mini.indentscope', version = '*', opts = {} }, + + -- Animate common Neovim actions + -- Replaced anuvyklack/windows.nvim + { 'echasnovski/mini.animate', version = '*', opts = {} }, + + -- Fast and feature-rich surround actions + -- Replaced kylechui/nvim-surround + { 'echasnovski/mini.surround', version = '*', opts = {} }, + + -- Icons + { + 'echasnovski/mini.icons', + opts = { + file = { + ['.keep'] = { glyph = '󰊢', hl = 'MiniIconsGrey' }, + ['devcontainer.json'] = { glyph = '', hl = 'MiniIconsAzure' }, + }, + filetype = { + dotenv = { glyph = '', hl = 'MiniIconsYellow' }, + }, + }, + }, + + -- Split and join arguments, lists, and other sequences + -- Replaced Wansmer/treesj + { 'echasnovski/mini.splitjoin', version = '*', opts = {} }, + + -- Work with diff hunks + -- Replaced lewis6991/gitsigns.nvim + { 'echasnovski/mini.diff', version = '*', opts = {} }, +} diff --git a/config/nvim/lua/plugins/refactoring.lua b/config/nvim/lua/plugins/refactoring.lua deleted file mode 100644 index cde56ed..0000000 --- a/config/nvim/lua/plugins/refactoring.lua +++ /dev/null @@ -1,8 +0,0 @@ --- The Refactoring library based off the Refactoring book by Martin Fowler --- https://github.com/ThePrimeagen/refactoring.nvim -return { - 'ThePrimeagen/refactoring.nvim', - version = '*', - dependencies = { 'nvim-lua/plenary.nvim', 'nvim-treesitter/nvim-treesitter' }, - opts = {}, -} diff --git a/config/nvim/lua/plugins/surround.lua b/config/nvim/lua/plugins/surround.lua deleted file mode 100644 index 701788e..0000000 --- a/config/nvim/lua/plugins/surround.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Add/change/delete surrounding delimiter pairs with ease. --- https://github.com/kylechui/nvim-surround -return { - 'kylechui/nvim-surround', - version = '*', - event = 'VeryLazy', - opts = {}, -} diff --git a/config/nvim/lua/plugins/treesj.lua b/config/nvim/lua/plugins/treesj.lua deleted file mode 100644 index 0a7b802..0000000 --- a/config/nvim/lua/plugins/treesj.lua +++ /dev/null @@ -1,9 +0,0 @@ --- Neovim plugin for splitting/joining blocks of code --- https://github.com/Wansmer/treesj -return { - 'Wansmer/treesj', - dependencies = { 'nvim-treesitter/nvim-treesitter' }, - opts = { - use_default_keymaps = false, - }, -} diff --git a/config/nvim/lua/plugins/ui.lua b/config/nvim/lua/plugins/ui.lua index d1d6ac7..bd6e45c 100644 --- a/config/nvim/lua/plugins/ui.lua +++ b/config/nvim/lua/plugins/ui.lua @@ -100,108 +100,13 @@ return { -- https://github.com/xiyaowong/nvim-transparent { 'xiyaowong/nvim-transparent', opts = {} }, - -- Twilight is a Lua plugin for Neovim 0.5 that dims inactive - -- portions of the code you're editing using TreeSitter. - -- https://github.com/folke/twilight.nvim - { 'folke/twilight.nvim', opts = {} }, - - -- Indent guides for Neovim - -- https://github.com/lukas-reineke/indent-blankline.nvim - { - 'lukas-reineke/indent-blankline.nvim', - main = 'ibl', - opts = { - scope = { show_start = false, show_end = false }, - indent = { - char = '│', - tab_char = '│', - }, - exclude = { - filetypes = { - 'Trouble', - 'alpha', - 'dashboard', - 'help', - 'lazy', - 'lazyterm', - 'mason', - 'neo-tree', - 'notify', - 'terminal', - 'toggleterm', - 'trouble', - }, - buftypes = { 'dashboard' }, - }, - }, - }, - -- Display a character as the colorcolumn -- https://github.com/lukas-reineke/virt-column.nvim { 'lukas-reineke/virt-column.nvim', opts = {} }, - -- icons - { - 'echasnovski/mini.icons', - opts = { - file = { - ['.keep'] = { glyph = '󰊢', hl = 'MiniIconsGrey' }, - ['devcontainer.json'] = { glyph = '', hl = 'MiniIconsAzure' }, - }, - filetype = { - dotenv = { glyph = '', hl = 'MiniIconsYellow' }, - }, - }, - init = function() - package.preload['nvim-web-devicons'] = function() - require('mini.icons').mock_nvim_web_devicons() - return package.loaded['nvim-web-devicons'] - end - end, - }, - -- ui components { 'MunifTanjim/nui.nvim', lazy = true }, - -- Git integration for buffers - -- https://github.com/lewis6991/gitsigns.nvim - { - 'lewis6991/gitsigns.nvim', - version = false, - opts = { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, - current_line_blame = false, - on_attach = function(bufnr) - local gs = require 'gitsigns' - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map('n', 'gn', function() - if vim.wo.diff then return ']c' end - vim.schedule(function() gs.next_hunk() end) - return '' - end, { expr = true }) - - map('n', 'gp', function() - if vim.wo.diff then return '[c' end - vim.schedule(function() gs.prev_hunk() end) - return '' - end, { expr = true }) - end, - }, - }, - -- Seamless navigation between tmux panes and vim splits -- https://github.com/christoomey/vim-tmux-navigator { @@ -270,18 +175,6 @@ return { -- https://github.com/LudoPinelli/comment-box.nvim { 'LudoPinelli/comment-box.nvim', opts = {} }, - -- Automatically expand width of the current window. - -- Maximizes and restore it. And all this with nice animations! - -- https://github.com/anuvyklack/windows.nvim - { - 'anuvyklack/windows.nvim', - dependencies = { - 'anuvyklack/middleclass', - 'anuvyklack/animation.nvim', - }, - opts = {}, - }, - -- Plugin to improve viewing Markdown files in Neovim -- https://github.com/MeanderingProgrammer/render-markdown.nvim { diff --git a/config/nvim/lua/plugins/which-key.lua b/config/nvim/lua/plugins/which-key.lua index 0b139ca..22e4843 100644 --- a/config/nvim/lua/plugins/which-key.lua +++ b/config/nvim/lua/plugins/which-key.lua @@ -47,13 +47,6 @@ return { desc = 'Generate annotations', }, - -- Code: treesj - { 'cc', group = 'Code Split/Join' }, - -- see: lua/plugins/treesj.lua - { 'cct', 'TSJToggle', desc = 'Split/Join: Toggle' }, - { 'ccs', 'TSJSplit', desc = 'Split/Join: Split' }, - { 'ccj', 'TSJJoin', desc = 'Split/Join: Join' }, - -- ── Code: CommentBox ──────────────────────────────────────────────── { 'cb', group = 'CommentBox' }, { 'cbb', 'CBccbox', desc = 'CommentBox: Box Title' }, @@ -62,55 +55,6 @@ return { { 'cbm', 'CBllbox14', desc = 'CommentBox: Marked' }, { 'cbt', 'CBllline', desc = 'CommentBox: Titled Line' }, - -- ── Code: Refactoring ─────────────────────────────────────────────── - { 'cx', group = '[x] Refactoring' }, - { - mode = { 'x' }, - -- Extract function supports only visual mode - { - 'cxe', - "lua require('refactoring').refactor('Extract Function')", - desc = 'Extract Function', - }, - { - 'cxf', - "lua require('refactoring').refactor('Extract Function To File')", - desc = 'Extract Function to File', - }, - -- Extract variable supports only visual mode - { - 'cxv', - "lua require('refactoring').refactor('Extract Variable')", - desc = 'Extract Variable', - }, - }, - -- Inline func supports only normal - { - 'cxif', - "lua require('refactoring').refactor('Inline Function')", - desc = 'Inline Function', - }, - -- Extract block supports only normal mode - { - 'cxb', - "lua require('refactoring').refactor('Extract Block')", - desc = 'Extract Block', - }, - { - 'cxbf', - "lua require('refactoring').refactor('Extract Block To File')", - desc = 'Extract Block to File', - }, - { - mode = { 'n', 'x' }, - -- Inline var supports both normal and visual mode - { - 'cxiv', - "lua require('refactoring').refactor('Inline Variable')", - desc = 'Inline Variable', - }, - }, - -- ── Code: LSPSaga ─────────────────────────────────────────────────── -- See: lua/plugins/lsp.lua { @@ -196,38 +140,6 @@ return { desc = 'Telescope import', }, - -- ── DAP ───────────────────────────────────────────────────────────── - { 'd', group = '[d] DAP' }, - { - { - 'db', - 'DapToggleBreakpoint', - desc = 'DAP: Toggle Breakpoint', - }, - { 'dc', 'DapContinue', desc = 'DAP: Continue' }, - { - 'do', - 'lua vim.diagnostic.open_float()', - desc = 'Diagnostic: Open float', - }, - { - 'dq', - 'lua vim.diagnostic.setloclist()', - desc = 'Diagnostic: Set loc list', - }, - { - 'dr', - "lua require('dapui').open({reset = true})", - desc = 'DAP: Reset', - }, - { - 'ds', - 'lua require("telescope.builtin").lsp_document_symbols()', - desc = 'LSP: Document Symbols', - }, - { 'dt', 'DapUiToggle', desc = 'DAP: Toggle UI' }, - }, - -- ── Harpoon ───────────────────────────────────────────────────────── -- See: lua/plugins/telescope.lua { 'h', group = '[h] Harpoon' }, @@ -381,7 +293,6 @@ return { 'TransparentToggle', desc = 'Toggle Transparency', }, - { 'tw', 'Twilight', desc = 'Toggle Twilight' }, }, -- ── Workspace ─────────────────────────────────────────────────────── @@ -513,7 +424,7 @@ return { -- ── Text manipulation in visual mode ──────────────────────────────── { - mode = 'v', + mode = { 'v', 'n' }, { '>', '>gv', desc = 'Indent Right' }, { '<', 'm '>+1gv=gv", desc = 'Move Block Down' }, diff --git a/docs/nvim-keybindings.md b/docs/nvim-keybindings.md index a3264da..e197a7a 100644 --- a/docs/nvim-keybindings.md +++ b/docs/nvim-keybindings.md @@ -2,11 +2,11 @@ ```txt -n / * +n / * [/] Fuzzily search in current buffer] -n ht * +n ht * Open Harpoon Quick menu -n hw * +n hw * Open harpoon window with telescope x # * :help v_#-default @@ -21,46 +21,100 @@ x @ * mode() == 'V' ? ':normal! @'.getcharstr().'' : '@' :help v_@-default x Q * mode() == 'V' ? ':normal! @=reg_recorded()' : 'Q' :help v_Q-default -x R * +o R * Treesitter Search -o R * +x R * Treesitter Search n Y * y$ :help Y-default -o Zk * +n Zk * Flash Treesitter -x Zk * +o Zk * Flash Treesitter -n Zk * +x Zk * Flash Treesitter o [% (MatchitOperationMultiBackward) x [% (MatchitVisualMultiBackward) n [% (MatchitNormalMultiBackward) +o [h * Vlua MiniDiff.goto_hunk('prev') + Previous hunk +x [h * lua MiniDiff.goto_hunk('prev') + Previous hunk +n [h * lua MiniDiff.goto_hunk('prev') + Previous hunk +o [H * Vlua MiniDiff.goto_hunk('first') + First hunk +x [H * lua MiniDiff.goto_hunk('first') + First hunk +n [H * lua MiniDiff.goto_hunk('first') + First hunk +o [i * lua MiniIndentscope.operator('top') + Go to indent scope top +x [i * lua MiniIndentscope.operator('top') + Go to indent scope top +n [i * lua MiniIndentscope.operator('top', true) + Go to indent scope top n [d * Jump to the previous diagnostic o ]% (MatchitOperationMultiForward) x ]% (MatchitVisualMultiForward) n ]% (MatchitNormalMultiForward) +o ]H * Vlua MiniDiff.goto_hunk('last') + Last hunk +x ]H * lua MiniDiff.goto_hunk('last') + Last hunk +n ]H * lua MiniDiff.goto_hunk('last') + Last hunk +o ]h * Vlua MiniDiff.goto_hunk('next') + Next hunk +x ]h * lua MiniDiff.goto_hunk('next') + Next hunk +n ]h * lua MiniDiff.goto_hunk('next') + Next hunk +o ]i * lua MiniIndentscope.operator('bottom') + Go to indent scope bottom +x ]i * lua MiniIndentscope.operator('bottom') + Go to indent scope bottom +n ]i * lua MiniIndentscope.operator('bottom', true) + Go to indent scope bottom n ]d * Jump to the next diagnostic x a% (MatchitVisualTextObject) +o ai * lua MiniIndentscope.textobject(true) + Object scope with border +x ai * lua MiniIndentscope.textobject(true) + Object scope with border n gR * :RegexplainerToggle Toggle Regexplainer o g% (MatchitOperationBackward) x g% (MatchitVisualBackward) n g% (MatchitNormalBackward) -n gP * +n gP * Close preview windows -n gpr * +n gpr * Preview references -n gpD * +n gpD * Preview declaration -n gpi * +n gpi * Preview implementation -n gpt * +n gpt * Preview type definition -n gpd * +n gpd * Preview definition +x gS * :lua MiniSplitjoin.toggle({ region = MiniSplitjoin.get_visual_region() }) + Toggle arguments +n gS * v:lua.MiniSplitjoin.operator("toggle") . " " + Toggle arguments +o gh * lua MiniDiff.textobject() + Hunk range textobject +x gH * + Reset hunks +n gH * + Reset hunks +x gh * + Apply hunks +n gh * + Apply hunks o gc * Comment textobject n gcc * @@ -73,17 +127,57 @@ x gx * Opens filepath or URI under cursor with the system handler (file explorer, web browser, …) n gx * Opens filepath or URI under cursor with the system handler (file explorer, web browser, …) +o ii * lua MiniIndentscope.textobject(false) + Object scope +x ii * lua MiniIndentscope.textobject(false) + Object scope n j * v:count == 0 ? 'gj' : 'j' Move down n k * v:count == 0 ? 'gk' : 'k' Move up -o r * +o r * Remote Flash -o zk * +n shn * + Highlight next surrounding +n sFn * + Find next left surrounding +n sfn * + Find next right surrounding +n srn * + Replace next surrounding +n sdn * + Delete next surrounding +n shl * + Highlight previous surrounding +n sFl * + Find previous left surrounding +n sfl * + Find previous right surrounding +n srl * + Replace previous surrounding +n sdl * + Delete previous surrounding +x sa * :lua MiniSurround.add('visual') + Add surrounding to selection +n sn * + Update `MiniSurround.config.n_lines` +n sh * + Highlight surrounding +n sF * + Find left surrounding +n sf * + Find right surrounding +n sr * + Replace surrounding +n sd * + Delete surrounding +n sa * + Add surrounding +n zk * Flash -x zk * +o zk * Flash -n zk * +x zk * Flash x (MatchitVisualTextObject) (MatchitVisualMultiBackward)o(MatchitVisualMultiForward) o (MatchitOperationMultiForward) * :call matchit#MultiMatch("W", "o") @@ -98,21 +192,21 @@ x (MatchitVisualBackward) * :call matchit#Match_wrapper('',0,'v')(MatchitVisualForward) * :call matchit#Match_wrapper('',1,'v'):if col("''") != col("$") | exe ":normal! m'" | endifgv`` n (MatchitNormalBackward) * :call matchit#Match_wrapper('',0,'n') n (MatchitNormalForward) * :call matchit#Match_wrapper('',1,'n') -s luasnip-jump-prev * +s luasnip-jump-prev * LuaSnip: Jump to the previous node -s luasnip-jump-next * +s luasnip-jump-next * LuaSnip: Jump to the next node -s luasnip-prev-choice * +s luasnip-prev-choice * LuaSnip: Change to the previous choice from the choiceNode -s luasnip-next-choice * +s luasnip-next-choice * LuaSnip: Change to the next choice from the choiceNode -s luasnip-expand-snippet * +s luasnip-expand-snippet * LuaSnip: Expand the current snippet -s luasnip-expand-or-jump * +s luasnip-expand-or-jump * LuaSnip: Expand or jump in the current snippet - luasnip-expand-repeat * + luasnip-expand-repeat * LuaSnip: Repeat last node expansion -n luasnip-delete-check * +n luasnip-delete-check * LuaSnip: Removes current snippet from jumplist n PlenaryTestFile * :lua require('plenary.test_harness').test_file(vim.fn.expand("%:p")) n d @@ -123,4 +217,4 @@ n * nohlsearch|diffupdate|normal! :help CTRL-L-default ``` -- Generated on Fri 4 Oct 2024 14:49:00 EEST +- Generated on Fri 22 Nov 2024 15:30:39 EET