From 6822b5bf517bcb8aaaab81c86f84ec6d12251843 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 25 Dec 2024 23:56:57 +0100 Subject: update telescope --- fnl/plugins/telescope.fnl | 88 ++++++----------------------------------------- 1 file changed, 10 insertions(+), 78 deletions(-) (limited to 'fnl/plugins/telescope.fnl') diff --git a/fnl/plugins/telescope.fnl b/fnl/plugins/telescope.fnl index b73d3f6..1cdc86c 100644 --- a/fnl/plugins/telescope.fnl +++ b/fnl/plugins/telescope.fnl @@ -42,27 +42,13 @@ (each [_ extension (ipairs extensions)] (telescope.load_extension extension))) -(λ telescope-builtin [builtin opts] - (let [telescope (require :telescope.builtin) - themes (require :telescope.themes) - theme (. opts :theme)] - ((. telescope builtin) ((. themes theme) opts)))) - -(local user-cmds [[:FindFiles - (λ [] - (telescope-builtin :find_files - {:theme :get_ivy :previewer false})) - {:nargs 0}]]) - -(λ init [] - (let [{: create-user-cmds} (require :util.cmds)] - (create-user-cmds user-cmds))) - -(local keys [{1 :mf 2 :FindFiles :desc "Find Files"} +(local keys [{1 :mf + 2 "Telescope find_files theme=ivy previewer=false" + :desc "Find Files"} {1 :mg - 2 "Telescope live_grep theme=ivy" + 2 "Telescope live_grep theme=dropdown" :desc "Find Text"} - {1 : + {1 :mb 2 "Telescope buffers theme=ivy previewer=true initial_mode=normal" :desc "Switch Buffer"} {1 :fC @@ -80,7 +66,9 @@ {1 :gb 2 "Telescope git_branches theme=ivy" :desc "Checkout Branch"} - {1 :ff 2 :FindFiles :desc "Find files"} + {1 :ff + 2 "Telescope find_files theme=ivy" + :desc "Find files"} {1 :fh 2 "Telescope help_tags theme=ivy" :desc :Help} @@ -94,7 +82,7 @@ 2 "Telescope projects theme=ivy" :desc "Find Project"} {1 :fr - 2 "Telescope oldfiles theme=ivy" + 2 "Telescope oldfiles theme=ivy previewer=false" :desc "Recent File"} {1 :ft 2 "Telescope live_grep theme=ivy" @@ -105,7 +93,6 @@ (λ config [] (let [telescope (require :telescope) - actions (require :telescope.actions) icons (require :settings.icons)] (telescope.setup {:defaults {:prompt_prefix (.. " " (. icons :telescope) " ") @@ -120,61 +107,7 @@ :--line-number :--column :--smart-case - :--hidden] - :mappings {:i {: actions.cycle_history_next - : actions.cycle_history_prev - : actions.move_selection_next - : actions.move_selection_previous - : actions.close - : actions.move_selection_next - : actions.move_selection_previous - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab - : actions.preview_scrolling_up - : actions.preview_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down - : (+ actions.toggle_selection - actions.move_selection_worse) - : (+ actions.toggle_selection - actions.move_selection_better) - : (+ actions.send_to_qflist - actions.open_qflist) - : (+ actions.send_selected_to_qflist - actions.open_qflist) - : actions.complete_tag - : actions.which_key} - :n {: actions.close - : actions.select_default - : actions.select_horizontal - : actions.select_vertical - : actions.select_tab - : (+ actions.toggle_selection - actions.move_selection_worse) - : (+ actions.toggle_selection - actions.move_selection_better) - : (+ actions.send_to_qflist - actions.open_qflist) - : (+ actions.send_selected_to_qflist - actions.open_qflist) - :j actions.move_selection_next - :k actions.move_selection_previous - :H actions.move_to_top - :M actions.move_to_middle - :L actions.move_to_bottom - : actions.move_selection_next - : actions.move_selection_previous - :gg actions.move_to_top - :G actions.move_to_bottom - :q actions.close - : actions.preview_scrolling_up - : actions.preview_scrolling_down - : actions.results_scrolling_up - : actions.results_scrolling_down - :dd actions.delete_buffer - :? actions.which_key}}} + :--hidden]} :extensions {:fzf {:fuzzy true :override_generic_sorter true :override_file_sorter true @@ -183,7 +116,6 @@ {1 :nvim-telescope/telescope.nvim :cmd :Telescope - : init : config : dependencies : keys} -- cgit v1.2.3-70-g09d2