summaryrefslogtreecommitdiff
path: root/fnl/plugins/which-key.fnl
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-01-05 01:50:20 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-01-05 01:50:20 +0100
commit2a94573f54c69a9af7536586ab2c03eb88bda5e7 (patch)
tree48e430773d56baef8c751fb8a6b4d76303b61636 /fnl/plugins/which-key.fnl
parent16198ca3bcd0ddd61f8d18280769c6f226b2b7ce (diff)
Refactor
Diffstat (limited to 'fnl/plugins/which-key.fnl')
-rw-r--r--fnl/plugins/which-key.fnl47
1 files changed, 47 insertions, 0 deletions
diff --git a/fnl/plugins/which-key.fnl b/fnl/plugins/which-key.fnl
new file mode 100644
index 0000000..9251832
--- /dev/null
+++ b/fnl/plugins/which-key.fnl
@@ -0,0 +1,47 @@
+;; Which-key provides a pop-up menu for some key mappings.
+
+(local icons (require :icons))
+
+(local opts {:plugins {:marks true
+ :registers true
+ :spelling {:enabled true :suggestions 20}
+ :presets {:operators false
+ :motions false
+ :text_objects false
+ :windows true
+ :nav true
+ :z true
+ :g true}}
+ :icons {:breadcrumb (. icons :guillemet)
+ :separator (.. (. icons :small-right-arrow) " ")
+ :group "+"}
+ :popup_mappings {:scroll_down :<c-d> :scroll_up :<c-u>}
+ :window {:border :rounded :position :bottom :winblend 0}
+ :layout {:height {:min 4 :max 25}
+ :width {:min 20 :max 50}
+ :spacing 3
+ :align :left}
+ :hidden [:<silent> :<cmd> :<Cmd> :<CR> :call :lua "^:" "^ "]
+ :show_help true
+ :triggers :auto
+ :disable {:filetypes [:netrw]}
+ :triggers_blacklist {:i [:j :k] :v [:j :k]}})
+
+(local groups {:mode [:n :v]
+ :<leader>d {:name :+db}
+ :<leader>f {:name :+find}
+ :<leader>g {:name :+git}
+ :<leader>i {:name :+diffview}
+ :<leader>j {:name :+diagnostics}
+ :<leader>l {:name :+lsp}
+ :<leader>o {:name :+orgmode}
+ :<leader>r {:name :+replace}
+ :<leader>s {:name :+session}
+ :<leader>w {:name :+worktree}})
+
+(fn config []
+ (let [which-key (require :which-key)]
+ (which-key.setup opts)
+ (which-key.register groups)))
+
+{1 :folke/which-key.nvim :event :VeryLazy : config}