Skip to content

Commit

Permalink
refactor(neovim): fix keymaps
Browse files Browse the repository at this point in the history
  • Loading branch information
rudenkornk committed Oct 27, 2024
1 parent 80c760f commit acf0674
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 2 deletions.
85 changes: 85 additions & 0 deletions roles/neovim/files/lazy/lua/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,90 @@
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here

-- <C-a> -- increment
-- <C-b> -- scroll back page
-- <C-c> -- ???
-- <C-d> -- scroll down half page
-- <C-e> -- scroll up lines
-- <C-f> -- scroll down page
-- <C-g> -- ???
-- <C-h> -- pane navigation
-- <C-i> -- go forward
-- <C-j> -- pane navigation
-- <C-k> -- pane navigation
-- <C-l> -- pane navigation
-- <C-m> -- open terminal
-- <C-n> -- ???
-- <C-o> -- go back
-- <C-p> -- ???
-- <C-q> -- change input lang
-- <C-r> -- redo
-- <C-s> -- tmux reserved
-- <C-t> -- ???
-- <C-u> -- scroll up half page
-- <C-v> -- visual mode
-- <C-w> -- manage windows
-- <C-x> -- decrement
-- <C-y> -- scroll down lines
-- <C-z> -- ???

-- <S-a> -- insert at the end of line
-- <S-b> -- word back
-- <S-c> -- replace rest of line
-- <S-d> -- delete rest of line
-- <S-e> -- word end
-- <S-f> -- find prev symbol
-- <S-g> -- end of file
-- <S-h> -- prev buffer
-- <S-i> -- insert at the beginning of line
-- <S-j> -- delete newline
-- <S-k> -- symbol info
-- <S-l> -- next buffer
-- <S-m> --
-- <S-n> --
-- <S-o> -- open line above
-- <S-p> -- paste before cursor
-- <S-q> -- delete buffer (custom)
-- <S-r> -- replace sequence
-- <S-s> -- leap back
-- <S-t> -- find prev symbol
-- <S-u> --
-- <S-v> -- visual select line
-- <S-w> -- word forward
-- <S-x> --
-- <S-y> -- yy
-- <S-z> --

-- <A-a> --
-- <A-b> --
-- <A-c> -- dap continue
-- <A-d> -- dap down
-- <A-e> -- dap pause
-- <A-f> --
-- <A-g> -- dap restart
-- <A-h> -- dedent code
-- <A-i> -- dap step into
-- <A-j> -- move code down
-- <A-k> -- move code up
-- <A-l> -- move code right
-- <A-m> -- open terminal
-- <A-n> -- next reference
-- <A-o> -- dap step out
-- <A-p> -- previous reference
-- <A-q> --
-- <A-r> -- dap breakpoint
-- <A-s> --
-- <A-t> --
-- <A-u> -- dap up
-- <A-v> -- dap run to cursor
-- <A-w> --
-- <A-x> -- tmux reserved
-- <A-y> --
-- <A-z> --

-- <A-C> -- dap reverse continue
-- <A-R> -- dap breakpoint with condition

vim.keymap.set(
{ "n", "x" },
"<C-z>",
Expand All @@ -19,3 +103,4 @@ end, { desc = "Terminal (Root Dir)" })
vim.keymap.set({ "t" }, "<A-m>", "<cmd>close<cr>", { desc = "Close terminal" })

vim.keymap.set({ "i" }, "<C-q>", "<C-^>", { desc = "Toggle keyboard layout" })
vim.keymap.set({ "n" }, "<S-q>", LazyVim.ui.bufremove, { desc = "Delete current buffer" })
11 changes: 11 additions & 0 deletions roles/neovim/files/lazy/lua/plugins/configs/copilot_chat.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
local M = {}

M.opts = function(_, opts)
return vim.tbl_extend(
"force",
opts,
{ mappings = { reset = { normal = "<C-z>", insert = "<C-z>" }, submit_prompt = { insert = "<C-g>" } } }
)
end

return M
4 changes: 2 additions & 2 deletions roles/neovim/files/lazy/lua/plugins/configs/dap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ M.keys = {
mode = { "n", "t" },
},
{
"<A-l>",
"<A-j>",
function()
require("dap").step_over()
end,
desc = "Step Over",
mode = { "n", "t" },
},
{
"<A-h>",
"<A-k>",
function()
require("dap").step_back()
end,
Expand Down
12 changes: 12 additions & 0 deletions roles/neovim/files/lazy/lua/plugins/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
return {
{
"CopilotC-Nvim/CopilotChat.nvim",
opts = require("plugins.configs.copilot_chat").opts,
},
{
"echasnovski/mini.indentscope",
opts = { draw = { delay = 0, animation = require("mini.indentscope").gen_animation.none() } },
},
{
"echasnovski/mini.move",
event = "VeryLazy",
opts = {
-- disable '<M-j>' and '<M-k>' mappings conflicting with dap
mappings = { line_down = "", line_up = "" },
},
},
{
"echasnovski/mini.surround",
opts = {
Expand Down

0 comments on commit acf0674

Please sign in to comment.