diff --git a/config/config/mini.lua b/config/config/mini.lua index 1c59d38..90c48c6 100644 --- a/config/config/mini.lua +++ b/config/config/mini.lua @@ -37,10 +37,10 @@ augroup("VimEnter", function() delay = { text_change = 1000 }, mappings = { -- Apply hunks inside a visual/operator region - apply = "gh", + apply = "h", -- Reset hunks inside a visual/operator region - reset = "gH", + reset = "H", -- Hunk range textobject to be used inside operator -- Works also in Visual mode if mapping differs from apply and reset diff --git a/config/plugin/keymap.movement.lua b/config/plugin/keymap.movement.lua new file mode 100644 index 0000000..15904e2 --- /dev/null +++ b/config/plugin/keymap.movement.lua @@ -0,0 +1,23 @@ +-- move down by visible lines +vim.keymap.set( + { "n", "x" }, + "j", + [[v:count == 0 ? 'gj' : 'j']], + { expr = true } +) +-- move up by visible lines +vim.keymap.set( + { "n", "x" }, + "k", + [[v:count == 0 ? 'gk' : 'k']], + { expr = true } +) + +-- goto start of line +vim.keymap.set({ "n", "x" }, "gh", "0") +-- goto end of line +vim.keymap.set({ "n", "x" }, "gl", "g_") +-- goto first non empty of line +vim.keymap.set({ "n", "x" }, "gs", "^") + +vim.keymap.set({ "n", "x" }, "gG", "G") diff --git a/config/plugin/keymaps.lua b/config/plugin/keymaps.lua index a1bdd65..84f405a 100644 --- a/config/plugin/keymaps.lua +++ b/config/plugin/keymaps.lua @@ -5,25 +5,6 @@ local function wrap(fn, ...) end end --- move down by visible lines -vim.keymap.set( - { "n", "x" }, - "j", - [[v:count == 0 ? 'gj' : 'j']], - { expr = true } -) --- move up by visible lines -vim.keymap.set( - { "n", "x" }, - "k", - [[v:count == 0 ? 'gk' : 'k']], - { expr = true } -) --- goto last non empty of line -vim.keymap.set({ "n", "v" }, "W", "g_") --- goto first non empty of line -vim.keymap.set({ "n", "v" }, "B", "^") - -- goto next search and uncover line vim.keymap.set("n", "n", "nzzzv") -- goto prev search and uncover line