diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-17 00:08:43 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2023-01-17 00:08:43 +0100 |
commit | a48ba3f7dfe35c7ca622e63a72574134788d68c7 (patch) | |
tree | 0675dc0f5e950c8739b63da29568d083e9c1d057 /fnl/settings | |
parent | 10b175f252104458d7478d8a2822818850cfdf92 (diff) |
Update key mappings
Diffstat (limited to 'fnl/settings')
-rw-r--r-- | fnl/settings/keymaps.fnl | 55 |
1 files changed, 28 insertions, 27 deletions
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 - ["" :<Space> :<Nop>] + ["" :<Space> :<Nop> {}] ;; Normal ;; ;; Better window navigation - [:n :<C-h> :<C-w>h] - [:n :<C-j> :<C-w>j] - [:n :<C-k> :<C-w>k] - [:n :<C-l> :<C-w>l] + [:n :<C-h> :<C-w>h {}] + [:n :<C-j> :<C-w>j {}] + [:n :<C-k> :<C-w>k {}] + [:n :<C-l> :<C-w>l {}] ;; Resize with arrows - [:n :<C-Up> ":resize -2<CR>"] - [:n :<C-Down> ":resize +2<CR>"] - [:n :<C-Left> ":vertical resize -2<CR>"] - [:n :<C-Right> ":vertical resize +2<CR>"] + [:n :<C-Up> ":resize -2<CR>" {}] + [:n :<C-Down> ":resize +2<CR>" {}] + [:n :<C-Left> ":vertical resize -2<CR>" {}] + [:n :<C-Right> ":vertical resize +2<CR>" {}] ;; Visual ;; ;; Stay in indent mode - [:v "<" :<gv] - [:v ">" :>gv] + [:v "<" :<gv {}] + [:v ">" :>gv {}] ;; Visual Block ;; ;; Move text up and down - [:x :J ":move '>+1<CR>gv-gv"] - [:x :K ":move '<-2<CR>gv-gv"] + [:x :J ":move '>+1<CR>gv-gv" {}] + [:x :K ":move '<-2<CR>gv-gv" {}] ;; Move text up and down - [:v :<m-j> ":m .+1<CR>=="] - [:v :<m-k> ":m .-2<CR>=="] - [:v :p "\"_dP"] + [:v :<m-j> ":m .+1<CR>==" {}] + [:v :<m-k> ":m .-2<CR>==" {}] + [:v :p "\"_dP" {}] ;; Splits - [:n :<m-s> :<cmd>split<CR>] - [:n :<m-t> :<cmd>vsplit<CR>] + [:n :<m-s> :<cmd>split<CR> {}] + [:n :<m-t> :<cmd>vsplit<CR> {}] ;; Buf navigation - [:n :<m-m> :<cmd>bprev<CR>] - [:n :<m-i> :<cmd>bnext<CR>] - ;; Jump half a page and centralize the view - [:n :<c-d> :<c-d>zz] - [:n :<c-u> :<c-u>zz] + [:n :<m-m> :<cmd>bprev<CR> {}] + [:n :<m-i> :<cmd>bnext<CR> {}] + ;; Jump half a page and centralize the view + [:n :<c-d> :<c-d>zz {}] + [:n :<c-u> :<c-u>zz {}] ;; Remove highlighted search - [:n :<m-n> :<cmd>nohlsearch<CR>] + [:n :<m-n> :<cmd>nohlsearch<CR> {}] ;; Close window - [:n :Q "<cmd>:q<CR>"] + [:n :Q "<cmd>:q<CR>" {}] ;; Force refresh - [:n :mj "<cmd>:e<CR>"]]) + [:n :mj "<cmd>:e<CR>" {: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)))) |