diff --git a/lua/dino/keymaps.lua b/lua/dino/keymaps.lua index e69de29..98719ec 100644 --- a/lua/dino/keymaps.lua +++ b/lua/dino/keymaps.lua @@ -0,0 +1,13 @@ +local function map(mode, lhs, rhs, opts) + vim.keymap.set(mode, lhs, rhs, vim.tbl_extend("force", {}, opts)) +end + +-- better up/down +map({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) +map({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) + +-- Move to window using the hjkl keys +map("n", "", "h", { desc = "Go to left window", remap = true }) +map("n", "", "j", { desc = "Go to lower window", remap = true }) +map("n", "", "k", { desc = "Go to upper window", remap = true }) +map("n", "", "l", { desc = "Go to right window", remap = true })