diff --git a/common/.config/nvim/lua/config/keymaps.lua b/common/.config/nvim/lua/config/keymaps.lua index 2a5af15..84f0a35 100644 --- a/common/.config/nvim/lua/config/keymaps.lua +++ b/common/.config/nvim/lua/config/keymaps.lua @@ -34,8 +34,8 @@ vim.keymap.set("i", ";", ";u", { desc = "Auto add undo breakpoints on ';'" vim.keymap.set("i", "\r", "\ru", { desc = "Auto add undo breakpoints on new lines" }) -- Save file -vim.keymap.set({ "i", "x", "n", "s" }, "", "w", { desc = "Save file" }) -vim.keymap.set({ "i", "x", "n", "s" }, "", "wqa", { desc = "Save all files and Quit Neovim" }) +vim.keymap.set({ "i", "x", "n", "s" }, "", "wa", { desc = "Save all files" }) +vim.keymap.set({ "i", "x", "n", "s" }, "", "q", { desc = "Quit Neovim without saving" }) -- Close Current Buffer vim.keymap.set({ "n", "v" }, "bx", function() diff --git a/common/.config/nvim/lua/core/lsp.lua b/common/.config/nvim/lua/core/lsp.lua index 859c5a9..c1c2e4c 100644 --- a/common/.config/nvim/lua/core/lsp.lua +++ b/common/.config/nvim/lua/core/lsp.lua @@ -74,8 +74,8 @@ vim.api.nvim_create_autocmd("LspAttach", { -- Telescope map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") - map("cs", require("telescope.builtin").lsp_document_symbols, "Search Document Symbols") - map("cS", require("telescope.builtin").lsp_workspace_symbols, "Search Workspace Symbols") + map("s", require("telescope.builtin").lsp_document_symbols, "Search Document Symbols") + map("S", require("telescope.builtin").lsp_workspace_symbols, "Search Workspace Symbols") map("ct", require("telescope.builtin").lsp_type_definitions, "Goto Type Definition") Snacks.toggle({ diff --git a/common/.config/nvim/lua/plugins/code-generic.lua b/common/.config/nvim/lua/plugins/code-generic.lua index 1ead328..a7d5a8f 100644 --- a/common/.config/nvim/lua/plugins/code-generic.lua +++ b/common/.config/nvim/lua/plugins/code-generic.lua @@ -269,10 +269,13 @@ return { move = { -- Jump to next and previous text objects + -- ]a -> next argument + -- ]T -> next test enable = true, goto_next_start = { ["]f"] = { query = "@function.outer", desc = "Goto next inner function start" }, ["]o"] = { query = "@loop.*", desc = "Goto next loop start" }, + ["]a"] = { query = "@parameter.inner", desc = "Goto next parameter" }, }, goto_next_end = { ["]F"] = { query = "@function.outer", desc = "Goto next outer function end" }, @@ -282,6 +285,7 @@ return { goto_previous_start = { ["[f"] = { query = "@function.outer", desc = "Goto goto previous inner function start" }, ["[o"] = { query = "@loop.*", desc = "Goto previous loop start" }, + ["[a"] = { query = "@parameter.inner", desc = "Goto previous parameter" }, }, goto_previous_end = { ["[F"] = { query = "@function.outer", desc = "Goto goto previous outer function start" }, diff --git a/common/.config/nvim/lua/plugins/git.lua b/common/.config/nvim/lua/plugins/git.lua index 5832acc..0bca451 100644 --- a/common/.config/nvim/lua/plugins/git.lua +++ b/common/.config/nvim/lua/plugins/git.lua @@ -53,11 +53,11 @@ return { -- Text object map({ "o", "x" }, "ih", ":Gitsigns select_hunk", { desc = "Git: Visual select hunk" }) - map({ "n", "v" }, "]h", function() + map({ "n", "v" }, "]g", function() gs.next_hunk() end, { desc = "Next Git hunk" }) - map({ "n", "v" }, "[h", function() + map({ "n", "v" }, "[g", function() gs.prev_hunk() end, { desc = "Previous Git hunk" }) @@ -73,10 +73,6 @@ return { map("n", "gp", gs.preview_hunk, { desc = "Git: Preview hunk" }) map("n", "gs", gs.stage_hunk, { desc = "Git: Toggle Stage-Hunk" }) - map("n", "gK", function() - gs.blame_line({ full = true }) - end, { desc = "Git: Hover blame-line" }) - map("n", "gB", gs.toggle_current_line_blame, { desc = "Git: Toggle virtual blame-line" }) end, }, diff --git a/common/.vim/key_maps.vim b/common/.vim/key_maps.vim index 6e62b42..e367e48 100644 --- a/common/.vim/key_maps.vim +++ b/common/.vim/key_maps.vim @@ -90,9 +90,10 @@ nnoremap N 'nN'[v:searchforward] xnoremap N 'nN'[v:searchforward] onoremap N 'nN'[v:searchforward] -" to save everything and quit Neovim -nnoremap :wqa -vnoremap :wqa +" Quit Vim (without saving) +" Save all buffers +nnoremap :q +vnoremap :q nnoremap :wa vnoremap :wa