From a48ba3f7dfe35c7ca622e63a72574134788d68c7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Tue, 17 Jan 2023 00:08:43 +0100 Subject: Update key mappings --- fnl/settings/keymaps.fnl | 55 ++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 27 deletions(-) (limited to 'fnl/settings') diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index 04073c8..7c323ea 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -3,46 +3,47 @@ (local opts {:noremap true :silent true}) (local mappings [;;Remap space as leader key - ["" : :] + ["" : : {}] ;; Normal ;; ;; Better window navigation - [:n : :h] - [:n : :j] - [:n : :k] - [:n : :l] + [:n : :h {}] + [:n : :j {}] + [:n : :k {}] + [:n : :l {}] ;; Resize with arrows - [:n : ":resize -2"] - [:n : ":resize +2"] - [:n : ":vertical resize -2"] - [:n : ":vertical resize +2"] + [:n : ":resize -2" {}] + [:n : ":resize +2" {}] + [:n : ":vertical resize -2" {}] + [:n : ":vertical resize +2" {}] ;; Visual ;; ;; Stay in indent mode - [:v "<" :" :>gv] + [:v "<" :" :>gv {}] ;; Visual Block ;; ;; Move text up and down - [:x :J ":move '>+1gv-gv"] - [:x :K ":move '<-2gv-gv"] + [:x :J ":move '>+1gv-gv" {}] + [:x :K ":move '<-2gv-gv" {}] ;; Move text up and down - [:v : ":m .+1=="] - [:v : ":m .-2=="] - [:v :p "\"_dP"] + [:v : ":m .+1==" {}] + [:v : ":m .-2==" {}] + [:v :p "\"_dP" {}] ;; Splits - [:n : :split] - [:n : :vsplit] + [:n : :split {}] + [:n : :vsplit {}] ;; Buf navigation - [:n : :bprev] - [:n : :bnext] - ;; Jump half a page and centralize the view - [:n : :zz] - [:n : :zz] + [:n : :bprev {}] + [:n : :bnext {}] + ;; Jump half a page and centralize the view + [:n : :zz {}] + [:n : :zz {}] ;; Remove highlighted search - [:n : :nohlsearch] + [:n : :nohlsearch {}] ;; Close window - [:n :Q ":q"] + [:n :Q ":q" {}] ;; Force refresh - [:n :mj ":e"]]) + [:n :mj ":e" {:desc :Refresh}]]) (each [_ mapping (ipairs mappings)] (match mapping - [mode key cmd] (vim.api.nvim_set_keymap mode key cmd opts))) + [mode key cmd desc] + (vim.api.nvim_set_keymap mode key cmd (vim.tbl_extend :force opts desc)))) -- cgit v1.2.3-70-g09d2