commit 3a95fd426675e385e59cf608e280dd1845faae29
parent a7b7526fce20966add33bfc26fd222476f3d24d1
Author: bdmfegys@duck.com <bdmfegys@duck.com>
Date: Tue, 30 Apr 2024 16:50:55 -0400
options.lua: add quit shortcut to whichkey config; fix remapping
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lua/options.lua b/lua/options.lua
@@ -22,6 +22,10 @@ wk.register({
"<cmd>Lazy<cr>",
"Open Lazy",
},
+ q = {
+ "<cmd>:q<cr>",
+ "Quit Neovim",
+ }
}, { prefix = "<leader>" })
local has_words_before = function()
unpack = unpack or table.unpack
@@ -29,12 +33,12 @@ local has_words_before = function()
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
---local map = vim.api.nvim_set_keymap
+local map = vim.keymap.set
----- move to window
---map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window" })
---map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window" })
---map("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window" })
---map("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window" })
+map("n", "<C-h>", "<C-w>h", { desc = "Go to Left Window" })
+map("n", "<C-j>", "<C-w>j", { desc = "Go to Lower Window" })
+map("n", "<C-k>", "<C-w>k", { desc = "Go to Upper Window" })
+map("n", "<C-l>", "<C-w>l", { desc = "Go to Right Window" })
--- clear search with escape
--map({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and Clear hlsearch" })