feat(neovim): Keymap enhacements

- Keep keymaps 2 character long
- In case of conflicts choose Capital letter
- Lsp: cI -> ch
- LspSaga: cpf -> cF, cpt -> cT, cpi -> cI,
- navbuddy: o -> / (search at current level)
- new: snack: gL -> Popup git line log
- new: Ctrl+` -> floating terminal (Lspsaga)
- Whichkey: Consistent icons
This commit is contained in:
Pratik Tripathy
2025-07-28 10:59:12 +05:30
parent b132395c0a
commit 39efa2af1f
4 changed files with 38 additions and 79 deletions

View File

@@ -243,17 +243,18 @@ return {
-- kind = require("config.util").icons.kind_lspsaga,
kind = require("catppuccin.groups.integrations.lsp_saga").custom_kind(),
},
implement = { enabled = true },
symbol_in_winbar = {
enable = true,
hide_keyword = true,
},
lightbulb = {
virtual_text = false,
},
lightbulb = { virtual_text = false },
outline = { auto_preview = false },
})
-- Keymaps in code-lsp.lua
vim.keymap.set({ "n", "t" }, "<C-`>", "<cmd>Lspsaga term_toggle<cr>", { desc = "Toggle Floating Terminal" })
-- Rest of the keymaps in ../core/lsp.lua
end,
},
@@ -277,20 +278,16 @@ return {
size = "80%",
},
mappings = {
-- Fuzzy finder at current level.
["f"] = actions.telescope({
-- Telescope search symbols at current level
["/"] = actions.telescope({
layout_config = {
height = 0.8,
width = 0.8,
},
}),
-- Show preview of current node
["o"] = actions.toggle_preview(),
-- Default Mappings on the popup
--
-- ["f"] = Search the children nodes using telescope
--
-- ["J"] = actions.move_down(), -- Move focused node down
-- ["K"] = actions.move_up(), -- Move focused node up
--

View File

@@ -81,10 +81,6 @@ return {
map("n", "<leader>gsh", gs.stage_hunk, { desc = "Git: Stage Hunk" })
map("n", "<leader>gsu", gs.undo_stage_hunk, { desc = "Git: Undo Stage Hunk" })
map("n", "<leader>gsb", gs.stage_buffer, { desc = "Git: Stage Current File" })
map("n", "<leader>gK", function()
gs.blame_line({ full = true })
end, { desc = "Git: Hover blame-line" })
-- visual mode
map("v", "<leader>gsH", function()
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
@@ -93,8 +89,11 @@ return {
-- normal mode
map("n", "<leader>gp", gs.preview_hunk, { desc = "Git: Preview hunk" })
-- Toggles
map("n", "<leader>gB", gs.toggle_current_line_blame, { desc = "Git: Toggle blame-line" })
map("n", "<leader>gK", function()
gs.blame_line({ full = true })
end, { desc = "Git: Hover blame-line" })
map("n", "<leader>gB", gs.toggle_current_line_blame, { desc = "Git: Toggle virtual blame-line" })
end,
},
},

View File

@@ -108,7 +108,14 @@ return {
function()
Snacks.lazygit.log(opts)
end,
desc = "Git: Log",
desc = "LazyGit: List Git Log",
},
{
"<leader>gL",
function()
Snacks.git.blame_line(opts)
end,
desc = "Git: Line Log",
},
{
"<leader>gf",
@@ -117,6 +124,13 @@ return {
end,
desc = "Git: Show File Log",
},
{
"<leader>gO",
function()
Snacks.gitbrowse.open(opts)
end,
desc = "Git: Open the file on Browser",
},
{
"]]",
function()
@@ -154,13 +168,6 @@ return {
end,
desc = "Toggle Zen Mode",
},
{
"<leader>gO",
function()
Snacks.gitbrowse.open(opts)
end,
desc = "Git: Open the file on Browser",
},
},
},
@@ -226,10 +233,11 @@ return {
-- Document existing key chains
spec = {
{ "<leader>/", group = "NVIM Scratch Buffer" },
{ "<leader>a", group = "AI" },
{ "<leader>b", group = "Buffer Operations", icon = { icon = "", color = "orange" } },
{ "<leader>a", group = "AI", icon = { icon = "󰚩", color = "orange" } },
{ "<leader>b", group = "Buffer Operations", icon = { icon = "󰲂", color = "orange" } },
{ "<leader>c", group = "Code", icon = { icon = "", color = "orange" } },
{ "<leader>d", group = "Diagnostics", icon = { icon = "", color = "orange" } },
{ "<leader>d", group = "Diagnostics", icon = { icon = "🔬", color = "orange" } },
{ "<leader>D", group = "Debug", icon = { icon = "", color = "orange" } },
{ "<leader>g", group = "Git", icon = { icon = "", color = "orange" } },
{ "<leader>h", group = "Help", icon = { icon = "󰞋", color = "orange" } },
{ "<leader>n", group = "Neovim Things", icon = { icon = "", color = "orange" } },
@@ -237,6 +245,7 @@ return {
{ "<leader>s", group = "Search/Grep", icon = { icon = "", color = "orange" } },
{ "<leader>t", group = "Unit Test" },
{ "<leader>x", group = "Delete/Disable/Remove", icon = { icon = "", color = "orange" } },
-- More icons: https://github.com/echasnovski/mini.icons/blob/main/lua/mini/icons.lua#L686
},
},
},