aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fnl/plugins/matchparen.fnl1
-rw-r--r--fnl/plugins/which_key.fnl31
-rw-r--r--init.fnl2
3 files changed, 25 insertions, 9 deletions
diff --git a/fnl/plugins/matchparen.fnl b/fnl/plugins/matchparen.fnl
new file mode 100644
index 0000000..1154b31
--- /dev/null
+++ b/fnl/plugins/matchparen.fnl
@@ -0,0 +1 @@
+((. (require :matchparen) :setup))
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)
diff --git a/init.fnl b/init.fnl
index ed89bb6..a21a454 100644
--- a/init.fnl
+++ b/init.fnl
@@ -26,6 +26,8 @@
;floating_mode
(use! :Iron-E/nvim-libmodal)
+ ;fix bracket pairing
+ (use! :monkoose/matchparen.nvim :require :plugins.matchparen)
;lsp
(use! :nvim-treesitter/nvim-treesitter :require :plugins.treesitter)