diff --git a/dot_config/exact_nvim/exact_lua/exact_config/keymaps_nvim.lua b/dot_config/exact_nvim/exact_lua/exact_config/keymaps_nvim.lua index 2d04f6d..5a7d47e 100644 --- a/dot_config/exact_nvim/exact_lua/exact_config/keymaps_nvim.lua +++ b/dot_config/exact_nvim/exact_lua/exact_config/keymaps_nvim.lua @@ -1,4 +1,5 @@ -- 這個檔案是用來設定 Neovim 的鍵盤快捷鍵 +local map = vim.keymap.set -- Tab切換 -- vim.api.nvim_set_keymap('n', '', 'tabnext', { noremap = true, silent = true }) @@ -6,3 +7,22 @@ -- vim.api.nvim_set_keymap('n', '', 'tabnext', { noremap = true, silent = true }) -- vim.api.nvim_set_keymap('n', '', 'tabprevious', { noremap = 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 }) +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 }) + +-- Clear search, diff update and redraw +-- taken from runtime/lua/_editor.lua +-- 原始vim會佔用 快速鍵,導致上述跳窗鍵盤無法靈活此用,故將此按鍵改為 ur +map( + "n", + "ur", + "nohlsearchdiffupdatenormal! ", + { desc = "Redraw / Clear hlsearch / Diff Update" } +)