From 26ca0bd5b2f837eb3c23ee7f02e5eecad6e431cf Mon Sep 17 00:00:00 2001 From: Dinesh Salunke Date: Fri, 16 Jun 2023 01:33:54 +0530 Subject: [PATCH] core: add some navigation keymaps --- lua/dino/keymaps.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 })