Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(keymaps): update toggle display and gitsigns keymaps #1405

Merged
merged 2 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions lua/keymap/completion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ function M.lsp(buf)
:with_silent()
:with_buffer(buf)
:with_desc("lsp: Show outgoing calls"),
["n|<leader>td"] = map_callback(function()
_toggle_diagnostic()
end)
:with_noremap()
:with_silent()
:with_desc("edit: Toggle virtual text display of current buffer"),
["n|<leader>th"] = map_callback(function()
_toggle_inlayhint()
end)
:with_noremap()
:with_silent()
:with_desc("edit: Toggle inlay hints dispaly of current buffer"),
}
bind.nvim_load_mapping(map)

Expand Down
14 changes: 14 additions & 0 deletions lua/keymap/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ local mappings = {
:with_silent()
:with_desc("edit: Clear search highlight"),
["n|<leader>o"] = map_cr("setlocal spell! spelllang=en_us"):with_desc("edit: Toggle spell check"),

-- Builtins: Lsp
["n|<leader>td"] = map_callback(function()
_toggle_diagnostic()
end)
:with_noremap()
:with_silent()
:with_desc("edit: Toggle global display of virtual text"),
["n|<leader>th"] = map_callback(function()
_toggle_inlayhint()
end)
:with_noremap()
:with_silent()
:with_desc("edit: Toggle global display of inlay hints"),
},
plugins = {
-- Plugin: persisted.nvim
Expand Down
9 changes: 1 addition & 8 deletions lua/keymap/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ function M.gitsigns(buf)
end)
:with_buffer(buf)
:with_desc("git: Stage hunk"),
["n|<leader>gu"] = bind.map_callback(function()
actions.undo_stage_hunk()
end)
:with_buffer(buf)
:with_desc("git: Undo stage hunk"),
["n|<leader>gr"] = bind.map_callback(function()
actions.reset_hunk()
end)
Expand All @@ -154,9 +149,7 @@ function M.gitsigns(buf)
:with_buffer(buf)
:with_desc("git: Blame line"),
-- Text objects
["ox|ih"] = bind.map_callback(function()
actions.text_object()
end):with_buffer(buf),
["ox|ih"] = bind.map_cu("Gitsigns select_hunk"):with_silent():with_buffer(buf),
}
bind.nvim_load_mapping(map)
end
Expand Down