aboutsummaryrefslogtreecommitdiff
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
parent258dfc41ff24e2fba9e90e6a015274103d40ea4d (diff)
matchparen and which-key mappings
-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)