From bb6936d7465a9e4edca7c979d9763a9e9ad34e6a Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 8 Aug 2022 16:12:22 +0200 Subject: Add harpoon --- fnl/config/harpoon.fnl | 18 ++++++++++++++++++ fnl/config/init.fnl | 1 + fnl/config/minibar.fnl | 1 + fnl/config/telescope.fnl | 1 + fnl/config/which-key.fnl | 20 +++++++++++++++++--- fnl/plugins.fnl | 1 + 6 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 fnl/config/harpoon.fnl (limited to 'fnl') 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" + "" + "lua require('telescope').extensions.harpoon.marks(require('telescope.themes').get_dropdown{previewer = false, initial_mode='normal', prompt_title='Harpoon'})" + opts +) +(nvim.set_keymap + "n" + "" + "lua require('telescope.builtin').buffers(require('telescope.themes').get_dropdown{previewer = false, initial_mode='normal'})" + 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 : +(def- mopts {:mode :n + :prefix :m :buffer nil :silent true :noremap true :nowait true}) -(def- vopts {:mode :v +(def- mmappings {:a ["lua require('harpoon.mark').add_file()" "Harpoon"] + :l ["lua require('harpoon.ui').nav_next()" "Harpoon Next"] + :h ["lua require('harpoon.ui').nav_prev()" "Harpoon Prev"] + :t ["Telescope harpoon marks" "Search Files"] + :r ["lua require('harpoon.ui').toggle_quick_menu()" "Harpoon UI"]}) + +(def- nopts {:mode :n :prefix : :buffer nil :silent true @@ -142,10 +148,18 @@ :T treesitter :z [:ZenMode "Zen Mode"]}) +(def- vopts {:mode :v + :prefix : + :buffer nil + :silent true + :noremap true + :nowait true}) + (def- vmappings {:n ["lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())" :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)) diff --git a/fnl/plugins.fnl b/fnl/plugins.fnl index 070c16c..b3aa735 100644 --- a/fnl/plugins.fnl +++ b/fnl/plugins.fnl @@ -16,6 +16,7 @@ :antoinemadec/FixCursorHold.nvim {} :rafamadriz/friendly-snippets {} :lewis6991/gitsigns.nvim {} + :ThePrimeagen/harpoon {} :phaazon/hop.nvim {} :lewis6991/impatient.nvim {} :tamago324/lir.nvim {} -- cgit v1.2.3-70-g09d2