diff --git a/aspects/dotfiles/files/.local/share/autojump/autojump.txt b/aspects/dotfiles/files/.local/share/autojump/autojump.txt index 1e3a9726..8818f352 100644 Binary files a/aspects/dotfiles/files/.local/share/autojump/autojump.txt and b/aspects/dotfiles/files/.local/share/autojump/autojump.txt differ diff --git a/aspects/dotfiles/files/.local/share/autojump/autojump.txt.bak b/aspects/dotfiles/files/.local/share/autojump/autojump.txt.bak index 1f06f562..eb3d1f63 100644 Binary files a/aspects/dotfiles/files/.local/share/autojump/autojump.txt.bak and b/aspects/dotfiles/files/.local/share/autojump/autojump.txt.bak differ diff --git a/aspects/nvim/files/.config/nvim/lua/config/lazy.lua b/aspects/nvim/files/.config/nvim/lua/config/lazy.lua index 1a279fcc..e346888e 100644 --- a/aspects/nvim/files/.config/nvim/lua/config/lazy.lua +++ b/aspects/nvim/files/.config/nvim/lua/config/lazy.lua @@ -96,7 +96,6 @@ function Lazyload() loader("lsp_signature.nvim") loader("navigator.lua") - loader("pretty_hover") loader("fidget.nvim") loader("inlay-hints.nvim") loader("null-ls.nvim") diff --git a/aspects/nvim/files/.config/nvim/lua/modules/editor/plugins.lua b/aspects/nvim/files/.config/nvim/lua/modules/editor/plugins.lua index 701eb0f4..f6be513b 100644 --- a/aspects/nvim/files/.config/nvim/lua/modules/editor/plugins.lua +++ b/aspects/nvim/files/.config/nvim/lua/modules/editor/plugins.lua @@ -81,13 +81,34 @@ return function(use) cmd = "UndotreeToggle", }) + use({ + "ThePrimeagen/harpoon", + opts = {}, + keys = { + { "L", function() require("harpoon.ui").nav_next() end }, + { "H", function() require("harpoon.ui").nav_prev() end }, + { "pt", "Telescope harpoon marks" }, + { "pa", function() require("harpoon.mark").add_file() end }, + { "pu", function() require("harpoon.ui").toggle_quick_menu() end }, + { "p1", function() require("harpoon.ui").nav_file(1) end }, + { "p2", function() require("harpoon.ui").nav_file(2) end }, + { "p3", function() require("harpoon.ui").nav_file(3) end }, + { "p4", function() require("harpoon.ui").nav_file(4) end }, + { "p5", function() require("harpoon.ui").nav_file(5) end }, + { "p6", function() require("harpoon.ui").nav_file(6) end }, + { "p7", function() require("harpoon.ui").nav_file(7) end }, + { "p8", function() require("harpoon.ui").nav_file(8) end }, + { "p9", function() require("harpoon.ui").nav_file(9) end }, + }, + }) + use({ "rmagatti/alternate-toggler", config = function() require("alternate-toggler").setup({}) end, keys = { - { "t", "lua require('alternate-toggler').toggleAlternate()" }, + { "t", function() require("alternate-toggler").toggleAlternate() end }, }, }) diff --git a/aspects/nvim/files/.config/nvim/lua/modules/lsp/handlers.lua b/aspects/nvim/files/.config/nvim/lua/modules/lsp/handlers.lua index 0f20d73c..895aef0b 100644 --- a/aspects/nvim/files/.config/nvim/lua/modules/lsp/handlers.lua +++ b/aspects/nvim/files/.config/nvim/lua/modules/lsp/handlers.lua @@ -47,12 +47,11 @@ lsp.attach_mappings = function(_, bufnr) f = { "lua vim.lsp.buf.format { async = true }", "Format" }, r = { "lua vim.lsp.buf.rename()", "Rename" }, i = { "LspInfo", "LSP info" }, - o = { "SymbolsOutline", "Symbols Outline" }, + o = { "OutlineOpen", "Symbols Outline" }, j = { "lua vim.diagnostic.goto_next()", "Go to next diagnostic" }, k = { "lua vim.diagnostic.goto_prev()", "Go to previous diagnostic" }, l = { "lua require('lsp_lines').toggle()", "Toggle LSP Lines" }, s = { "lua vim.lsp.buf.signature_help()", "Signature" }, - S = { "LspSymbols", "Toggle symbols outline" }, D = { "Telescope lsp_document_symbols", "Document Symbols" }, d = { name = "Definition", @@ -127,19 +126,19 @@ lsp.on_attach = function(client, bufnr) lsp.capabilities = client.config.capabilities - -- if client.resolved_capabilities.code_lens then - -- local codelens = vim.api.nvim_create_augroup( - -- "LSPCodeLens", - -- { clear = true } - -- ) - -- vim.api.nvim_create_autocmd({ "BufEnter", "InsertLeave", "CursorHold" }, { - -- group = codelens, - -- callback = function() - -- vim.lsp.codelens.refresh() - -- end, - -- buffer = bufnr, - -- }) - -- end + if client.resolved_capabilities.code_lens then + local codelens = vim.api.nvim_create_augroup( + "LSPCodeLens", + { clear = true } + ) + vim.api.nvim_create_autocmd({ "BufEnter", "InsertLeave", "CursorHold" }, { + group = codelens, + callback = function() + vim.lsp.codelens.refresh() + end, + buffer = bufnr, + }) + end end return lsp diff --git a/aspects/nvim/files/.config/nvim/lua/modules/ui/which-key.lua b/aspects/nvim/files/.config/nvim/lua/modules/ui/which-key.lua index 9b9b9183..b4801751 100644 --- a/aspects/nvim/files/.config/nvim/lua/modules/ui/which-key.lua +++ b/aspects/nvim/files/.config/nvim/lua/modules/ui/which-key.lua @@ -62,49 +62,58 @@ vars.vmappings["/"] = { "Comment", } -vars.mappings["v"] = { "vsplit", "Vertical Split" } -vars.mappings["h"] = { "split", "Horizontal Split" } vars.mappings[" "] = { "normal ", "Jump to previous buffer" } -vars.mappings["/"] = { "lua require('Comment.api').toggle.linewise()", "Comment out current line" } +vars.mappings["-"] = { require("lir.float").toggle, "Toggle Lir" } +vars.mappings["/"] = { require("Comment.api").toggle.linewise, "Comment out current line" } +vars.mappings["a"] = { require("harpoon.mark").add_file, "Add file to harpoon" } vars.mappings["e"] = { "Neotree toggle", "Toggle NeoTree" } -vars.mappings["-"] = { "lua require('lir.float').toggle()", "Toggle Lir" } -vars.mappings["z"] = { "ZenMode", "Zen Mode" } -vars.mappings["t"] = { "lua require('alternate-toggler').toggleAlternate()", "Alternate" } -vars.mappings["p"] = { "Pantran", "Translate" } +vars.mappings["h"] = { vim.cmd.split, "Horizontal Split" } +vars.mappings["t"] = { require("alternate-toggler").toggleAlternate, "Alternate" } +vars.mappings["v"] = { vim.cmd.vsplit, "Vertical Split" } +vars.mappings["z"] = { vim.cmd.ZenMode, "Zen Mode" } + +vars.mappings["d"] = { + name = "Debug", + t = { require("dap").toggle_breakpoint, "Toggle Breakpoint" }, + b = { require("dap").step_back, "Step Back" }, + c = { require("dap").continue, "Continue" }, + C = { require("dap").run_to_cursor, "Run To Cursor" }, + d = { require("dap").disconnect, "Disconnect" }, + g = { require("dap").session, "Get Session" }, + i = { require("dap").step_into, "Step Into" }, + o = { require("dap").step_over, "Step Over" }, + u = { require("dap").step_out, "Step Out" }, + p = { require("dap").pause, "Pause" }, + r = { require("dap").repl.toggle, "Toggle Repl" }, + s = { require("dap").continue, "Start" }, + q = { require("dap").close, "Quit" }, + U = { require("dapui").toggle, "Enable/Disable UI" }, +} vars.mappings["g"] = { name = "Git", - j = { "lua require('gitsigns').next_hunk()", "Next Hunk" }, - k = { "lua require('gitsigns').prev_hunk()", "Prev Hunk" }, - l = { "lua require('gitsigns').blame_line()", "Blame" }, - p = { "lua require('gitsigns').preview_hunk()", "Preview Hunk" }, - m = { "GitMessenger", "View message" }, - r = { "lua require('gitsigns').reset_hunk()", "Reset Hunk" }, - R = { "lua require('gitsigns').reset_buffer()", "Reset Buffer" }, - s = { "lua require('gitsigns').stage_hunk()", "Stage Hunk" }, - u = { - "lua require('gitsigns').undo_stage_hunk()", - "Undo Stage Hunk", - }, + j = { require("gitsigns").next_hunk, "Next Hunk" }, + k = { require("gitsigns").prev_hunk, "Prev Hunk" }, + l = { require("gitsigns").blame_line, "Blame" }, + p = { require("gitsigns").preview_hunk, "Preview Hunk" }, + m = { vim.cmd.GitMessenger, "View message" }, + r = { require("gitsigns").reset_hunk, "Reset Hunk" }, + R = { require("gitsigns").reset_buffer, "Reset Buffer" }, + s = { require("gitsigns").stage_hunk, "Stage Hunk" }, + u = { require("gitsigns").undo_stage_hunk, "Undo Stage Hunk" }, o = { "Telescope git_status", "Open changed file" }, b = { "Telescope git_branches", "Checkout branch" }, c = { "Telescope git_commits", "Checkout commit" }, - C = { - "Telescope git_bcommits", - "Checkout commit (for current file)", - }, - d = { - "Gitsigns diffthis HEAD", - "Git Diff", - }, + C = { "Telescope git_bcommits", "Checkout commit" }, + d = { "Gitsigns diffthis HEAD", "Git Diff" }, } vars.mappings["G"] = { name = "ChatGPT", - a = { "ChatGPTActAs", "Have ChatGPT act as" }, - c = { "ChatGPTCompleteCode", "Have ChatGPT complete code" }, - t = { "ChatGPT", "Toggle ChatGPT" }, - i = { "ChatGPTEditWithInstructions", "Have ChatGPT edit with instructions" }, + a = { vim.cmd.ChatGPTActAs, "Have ChatGPT act as" }, + c = { vim.cmd.ChatGPTCompleteCode, "Have ChatGPT complete code" }, + t = { vim.cmd.ChatGPT, "Toggle ChatGPT" }, + i = { vim.cmd.ChatGPTEditWithInstructions, "Have ChatGPT edit with instructions" }, r = { name = "Run", a = { "ChatGPTRun add_test", "Implement tests for the code" }, @@ -122,11 +131,52 @@ vars.mappings["G"] = { }, } -vars.mappings["H"] = { - a = { "lua require('harpoon.mark').add_file()", "Add file to harpoon" }, - h = { "lua require('harpoon.ui').toggle_quick_menu()", "View harpoon" }, - n = { "lua require('harpoon.ui').nav_next()", "Navigates to next harpoon mark" }, - p = { "lua require('harpoon.ui').nav_prev()", "Navigates to previous harpoon mark" }, +vars.mappings["n"] = { + name = "Neotest", + a = { require("neotest").run.attach, "Attach to the nearest test" }, + c = { + function() + require("neotest").run.run(vim.fn.expand("%")) + end, + "Run the current file", + }, + d = { + function() + require("neotest").run.run({ strategy = "dap" }) + end, + "Debug the nearest test", + }, + e = { + function() + require("neotest").output.open({ enter = true, auto_close = true }) + end, + "Open the output of a test result", + }, + j = { + function() + require("neotest").jump.prev({ status = "failed" }) + end, + "Jump to next error", + }, + k = { + function() + require("neotest").jump.next({ status = "failed" }) + end, + "Jump to previous error", + }, + n = { require("neotest").run.run, "Run the nearest test" }, + s = { require("neotest").run.stop, "Stop the nearest test" }, + S = { require("neotest").summary.toggle, "Toggle the summary window" }, +} + +vars.mappings["r"] = { + name = "Refactor", + e = { "lua require('refactoring').refactor('Extract Function')", "Extract Function" }, + f = { "lua require('refactoring').refactor('Extract Function to File')", "Extract Function to File" }, + v = { "lua require('refactoring').refactor('Extract Variable')", "Extract Variable" }, + i = { "lua require('refactoring').refactor('Inline Variable')", "Inline Variable" }, + r = { "lua require('telescope').extensions.refactoring.refactors()", "Refactor" }, + V = { "lua require('refactoring').debug.print_var({})", "Debug Print Var" }, } vars.mappings["s"] = { @@ -136,6 +186,7 @@ vars.mappings["s"] = { b = { "Telescope buffers", "Fuzzy find buffers" }, l = { "Telescope live_grep", "Fuzzy find words" }, s = { "Telescope symbols", "Fuzzy find symbols" }, + h = { "Telescope harpoon marks", "View harpoon" }, d = { "Telescope diagnostics", "Fuzzy find diagnostics" }, n = { search_config_files, "Fuzzy find config files" }, c = { @@ -149,62 +200,6 @@ vars.mappings["s"] = { }, } -vars.mappings["m"] = { - name = "Muren", - t = { "MurenToggle", "Toggle Muren" }, - o = { "MurenOpen", "Open Muren" }, - c = { "MurenClose", "Close Muren" }, - f = { "MurenFresh", "Open Muren fresh" }, - u = { "MurenUnique", "Toggle with all unique matches of the last search" }, -} - -vars.mappings["n"] = { - name = "Neotest", - a = { "lua require('neotest').run.attach()", "Attach to the nearest test" }, - c = { "lua require('neotest').run.run(vim.fn.expand('%'))", "Run the current file" }, - d = { "lua require('neotest').run.run({strategy = 'dap'})", "Debug the nearest test" }, - e = { - "lua require('neotest').output.open({ enter = true, auto_close = true })", - "Open the output of a test result", - }, - j = { "lua require('neotest').jump.prev({ status = 'failed' })", "Jump to next error" }, - k = { "lua require('neotest').jump.next({ status = 'failed' })", "Jump to previous error" }, - n = { "lua require('neotest').run.run()", "Run the nearest test" }, - s = { "lua require('neotest').run.stop()", "Stop the nearest test" }, - S = { "lua require('neotest').summary.toggle()", "Toggle the summary window" }, -} - -vars.mappings["d"] = { - name = "Debug", - t = { "lua require('dap').toggle_breakpoint()", "Toggle Breakpoint" }, - b = { "lua require('dap').step_back()", "Step Back" }, - c = { "lua require('dap').continue()", "Continue" }, - C = { "lua require('dap').run_to_cursor()", "Run To Cursor" }, - d = { "lua require('dap').disconnect()", "Disconnect" }, - g = { "lua require('dap').session()", "Get Session" }, - i = { "lua require('dap').step_into()", "Step Into" }, - o = { "lua require('dap').step_over()", "Step Over" }, - u = { "lua require('dap').step_out()", "Step Out" }, - p = { "lua require('dap').pause()", "Pause" }, - r = { "lua require('dap').repl.toggle()", "Toggle Repl" }, - s = { "lua require('dap').continue()", "Start" }, - q = { "lua require('dap').close()", "Quit" }, - U = { "lua require('dapui').toggle()", "Enable/Disable UI" }, -} - -vars.mappings["r"] = { - name = "Refactor", - e = { [[ lua require('refactoring').refactor('Extract Function')]], "Extract Function" }, - f = { - [[ lua require('refactoring').refactor('Extract Function to File')]], - "Extract Function to File", - }, - v = { [[ lua require('refactoring').refactor('Extract Variable')]], "Extract Variable" }, - i = { [[ lua require('refactoring').refactor('Inline Variable')]], "Inline Variable" }, - r = { [[ lua require('telescope').extensions.refactoring.refactors()]], "Refactor" }, - V = { [[ lua require('refactoring').debug.print_var({})]], "Debug Print Var" }, -} - local which_key = require("which-key") which_key.setup(setup) diff --git a/aspects/nvim/files/.config/nvim/selene.toml b/aspects/nvim/files/.config/nvim/selene.toml index 6540d6f9..229ae6b9 100644 --- a/aspects/nvim/files/.config/nvim/selene.toml +++ b/aspects/nvim/files/.config/nvim/selene.toml @@ -1 +1,4 @@ std="lua51+vim" + +[rules] +mixed_table = "allow"