aboutsummaryrefslogtreecommitdiff
path: root/fnl/plugins/which_key.fnl
diff options
context:
space:
mode:
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)