aboutsummaryrefslogtreecommitdiff
path: root/fnl/plugins/which_key.fnl
diff options
context:
space:
mode:
authoramelia squires <[email protected]>2024-10-23 03:36:33 -0500
committeramelia squires <[email protected]>2024-10-23 03:36:33 -0500
commit128bb9acbce77e20473857345b0956739e8b6fca (patch)
tree0e404c14fef1aa02d5b1b85826128197e4b60a55 /fnl/plugins/which_key.fnl
parent258dfc41ff24e2fba9e90e6a015274103d40ea4d (diff)
matchparen and which-key mappings
Diffstat (limited to 'fnl/plugins/which_key.fnl')
-rw-r--r--fnl/plugins/which_key.fnl31
1 files changed, 22 insertions, 9 deletions
diff --git a/fnl/plugins/which_key.fnl b/fnl/plugins/which_key.fnl
index 959e0a6..6d4963f 100644
--- a/fnl/plugins/which_key.fnl
+++ b/fnl/plugins/which_key.fnl
@@ -1,14 +1,27 @@
(local whichkey (require :which-key))
(whichkey.setup)
-(local mappings {
- 1 {1 " f" 2 "<cmd>Neotree toggle<CR>" :desc "fs"}
- 2 {1 " w" 2 "<cmd>WinShift<CR>" :desc "win shift"}
- 3 {1 " t" 2 "<cmd>ToggleTerm direction=horizontal<CR>" :desc "hterm"}
-
- :mode [:n :v]
- :silent true
- :noremap true
- :nowait true})
+(macro wmap [k op desc]
+ {1 (.. " " k) 2 op :desc desc})
+(macro gmap [k group]
+ {1 (.. " " k) :group group})
+
+(local mappings [
+ ;;common
+ (wmap :f "<cmd>Neotree toggle<CR>" "fs")
+ (wmap :w "<cmd>WinShift<CR>" "win shift")
+ (wmap :t "<cmd>ToggleTerm direction=horizontal<CR>" "hterm")
+
+ ;;quick
+ (gmap :q "quick")
+ (wmap :qs "\"+y" "system grab")
+ (wmap :ql "0v$" "line")
+ ])
+
+(tset mappings :mode [:n :v])
+(tset mappings :silent true)
+(tset mappings :noremap true)
+(tset mappings :nowait true)
+
(whichkey.add mappings)