From 3286ea5e4bee423b11aa163785a1736009b345e5 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 14 Feb 2024 14:18:14 +0100 Subject: Update ui options in harpoon and change buffer keymap --- fnl/plugins/harpoon.fnl | 24 ++++-------------------- fnl/plugins/telescope.fnl | 4 ++-- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/fnl/plugins/harpoon.fnl b/fnl/plugins/harpoon.fnl index 938095d..9ff2fbc 100644 --- a/fnl/plugins/harpoon.fnl +++ b/fnl/plugins/harpoon.fnl @@ -1,5 +1,7 @@ ;; Harpoon files for navigation. +(local opts {:ui_max_width 64 :title " ⇁ "}) + (local user-cmds [[:HarpoonAdd (lambda [] (let [harpoon (require :harpoon)] @@ -8,15 +10,9 @@ [:HarpoonUI (lambda [] (let [harpoon (require :harpoon)] - (harpoon.ui:toggle_quick_menu (harpoon:list)))) + (harpoon.ui:toggle_quick_menu (harpoon:list) opts))) {:nargs 0}]]) -(fn telescope-ext [ext fun opts] - (let [telescope (require :telescope) - themes (require :telescope.themes) - theme (. opts :theme)] - ((. (. (. telescope :extensions) ext) fun) ((. themes theme) opts)))) - (lambda select [nr] (let [harpoon (require :harpoon)] (: (harpoon:list) :select nr))) @@ -25,17 +21,6 @@ (let [cmds (require :util.cmds)] (cmds.create-user-cmds user-cmds))) -(fn config [] - (vim.keymap.set :n : - (fn [] - (telescope-ext :harpoon :marks - {:theme :get_dropdown - :previewer false - :initial_mode :normal - :prompt_title :Harpoon})) - {}) - {:menu {:width (- (vim.api.nvim_win_get_width 0) 4)}}) - (local keys [{1 :ma 2 :HarpoonAdd :desc :Harpoon} {1 :mr 2 :HarpoonUI :desc "Harpoon UI"} {1 :ms @@ -59,5 +44,4 @@ :branch :harpoon2 :event :BufReadPost : init - : keys - : config} + : keys} diff --git a/fnl/plugins/telescope.fnl b/fnl/plugins/telescope.fnl index 938bedd..2410583 100644 --- a/fnl/plugins/telescope.fnl +++ b/fnl/plugins/telescope.fnl @@ -55,8 +55,8 @@ {1 :mg 2 "Telescope live_grep theme=dropdown" :desc "Find Text"} - {1 : - 2 "Telescope buffers theme=dropdown previewer=false initial_mode=normal" + {1 : + 2 "Telescope buffers theme=dropdown previewer=true initial_mode=normal" :desc "Switch Buffer"} {1 :fC 2 "Telescope commands theme=dropdown" -- cgit v1.2.3-70-g09d2