summaryrefslogtreecommitdiff
path: root/fnl/config
diff options
context:
space:
mode:
Diffstat (limited to 'fnl/config')
-rw-r--r--fnl/config/harpoon.fnl18
-rw-r--r--fnl/config/init.fnl1
-rw-r--r--fnl/config/minibar.fnl1
-rw-r--r--fnl/config/telescope.fnl1
-rw-r--r--fnl/config/which-key.fnl20
5 files changed, 38 insertions, 3 deletions
diff --git a/fnl/config/harpoon.fnl b/fnl/config/harpoon.fnl
new file mode 100644
index 0000000..0c3ca5e
--- /dev/null
+++ b/fnl/config/harpoon.fnl
@@ -0,0 +1,18 @@
+;; Harpoon files for navigation.
+(module config.harpoon {autoload {: util nvim aniseed.nvim}})
+
+(def- opts {})
+
+(util.use-config :harpoon opts)
+(nvim.set_keymap
+ "n"
+ "<tab>"
+ "<cmd>lua require('telescope').extensions.harpoon.marks(require('telescope.themes').get_dropdown{previewer = false, initial_mode='normal', prompt_title='Harpoon'})<cr>"
+ opts
+)
+(nvim.set_keymap
+ "n"
+ "<s-tab>"
+ "<cmd>lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false, initial_mode='normal'})<cr>"
+ opts
+)
diff --git a/fnl/config/init.fnl b/fnl/config/init.fnl
index a6b0dcf..fb1d95b 100644
--- a/fnl/config/init.fnl
+++ b/fnl/config/init.fnl
@@ -12,6 +12,7 @@
config.comment
config.fidget
config.gitsigns
+ config.harpoon
config.hop
config.lir
config.lsp
diff --git a/fnl/config/minibar.fnl b/fnl/config/minibar.fnl
index 0d301e7..09e97b4 100644
--- a/fnl/config/minibar.fnl
+++ b/fnl/config/minibar.fnl
@@ -2,6 +2,7 @@
(def- opts {:ignore-filetypes [:help
:startify
+ :harpoon
:dashboard
:packer
:neogitstatus
diff --git a/fnl/config/telescope.fnl b/fnl/config/telescope.fnl
index a53433d..7989c54 100644
--- a/fnl/config/telescope.fnl
+++ b/fnl/config/telescope.fnl
@@ -78,4 +78,5 @@
(telescope.load_extension :fzf)
(telescope.load_extension :file_browser)
(telescope.load_extension :session-lens)
+ (telescope.load_extension :harpoon)
(telescope.load_extension :projects)))
diff --git a/fnl/config/which-key.fnl b/fnl/config/which-key.fnl
index 9f3d31b..13c6ebc 100644
--- a/fnl/config/which-key.fnl
+++ b/fnl/config/which-key.fnl
@@ -28,14 +28,20 @@
:triggers :auto
:triggers_blacklist {:i [:j :k] :v [:j :k]}})
-(def- nopts {:mode :n
- :prefix :<leader>
+(def- mopts {:mode :n
+ :prefix :m
:buffer nil
:silent true
:noremap true
:nowait true})
-(def- vopts {:mode :v
+(def- mmappings {:a ["<cmd>lua require('harpoon.mark').add_file()<cr>" "Harpoon"]
+ :l ["<cmd>lua require('harpoon.ui').nav_next()<cr>" "Harpoon Next"]
+ :h ["<cmd>lua require('harpoon.ui').nav_prev()<cr>" "Harpoon Prev"]
+ :t ["<cmd>Telescope harpoon marks<cr>" "Search Files"]
+ :r ["<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>" "Harpoon UI"]})
+
+(def- nopts {:mode :n
:prefix :<leader>
:buffer nil
:silent true
@@ -142,10 +148,18 @@
:T treesitter
:z [:<cmd>ZenMode<cr> "Zen Mode"]})
+(def- vopts {:mode :v
+ :prefix :<leader>
+ :buffer nil
+ :silent true
+ :noremap true
+ :nowait true})
+
(def- vmappings {:n ["<ESC><CMD>lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())<CR>"
:Comment]})
(let [which-key (util.load-plugin :which-key)]
(which-key.setup setup)
+ (which-key.register mmappings mopts)
(which-key.register nmappings nopts)
(which-key.register vmappings vopts))