From 152fd9d787c7433cad95795992e444250cb83216 Mon Sep 17 00:00:00 2001 From: aktersnurra Date: Thu, 16 Apr 2026 15:10:52 +0200 Subject: Add fff and other nice things such as macros --- fnl/settings/keymaps.fnl | 72 +++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 41 deletions(-) (limited to 'fnl/settings/keymaps.fnl') diff --git a/fnl/settings/keymaps.fnl b/fnl/settings/keymaps.fnl index 14cd160..fcc7511 100644 --- a/fnl/settings/keymaps.fnl +++ b/fnl/settings/keymaps.fnl @@ -1,44 +1,34 @@ ;; Custom keymappings. -(local opts {:noremap true :silent true}) +(import-macros {: keymaps} :macros) -(local mappings [;;Remap space as leader key - ["" : : {}] - ;; Normal ;; - ;; Resize with arrows - [:n : :+ {}] - [:n : :- {}] - [:n "" :5< {}] - [:n : :5> {}] - ;; Visual ;; - ;; Stay in indent mode - [:v "<" :" :>gv {}] - ;; Visual Block ;; - ;; Move text up and down - [:x :J ":move '>+1gv-gv" {}] - [:x :K ":move '<-2gv-gv" {}] - ;; Move text up and down - [:v : ":m .+1==" {}] - [:v : ":m .-2==" {}] - [:v :p "\"_dP" {}] - ;; Splits - [:n : :split {}] - [:n : :vsplit {}] - ;; Buf navigation - [:n : :bprev {}] - [:n : :bnext {}] - ;; Jump half a page and centralize the view - [:n : :zz {}] - [:n : :zz {}] - ;; Remove highlighted search - [:n : :nohlsearch {}] - ;; jump to eol in insert mode - [:i : :$ {}] - ;; Force refresh - [:n :mj ":e" {:desc :Refresh}]]) - -(each [_ mapping (ipairs mappings)] - (match mapping - [mode key cmd desc] - (vim.api.nvim_set_keymap mode key cmd (vim.tbl_extend :force opts desc)))) +(keymaps + ;; Resize with arrows + [:n : :+ {}] + [:n : :- {}] + [:n "" :5< {}] + [:n : :5> {}] + ;; Stay in indent mode + [:v "<" :" :>gv {}] + ;; Move text up and down + [:x :J ":move '>+1gv-gv" {}] + [:x :K ":move '<-2gv-gv" {}] + [:v : ":m .+1==" {}] + [:v : ":m .-2==" {}] + [:v :p "\"_dP" {}] + ;; Splits + [:n : :split {}] + [:n : :vsplit {}] + ;; Buf navigation + [:n : :bprev {}] + [:n : :bnext {}] + ;; Jump half a page and centralize the view + [:n : :zz {}] + [:n : :zz {}] + ;; Remove highlighted search + [:n : :nohlsearch {}] + ;; Jump to eol in insert mode + [:i : :$ {}] + ;; Force refresh + [:n :mj ":e" {:desc :Refresh}]) -- cgit v1.2.3-70-g09d2