dotfiles/home/config/nvim/plugins/telescope.fnl

51 lines
2.7 KiB
Text
Raw Normal View History

2022-04-05 19:57:44 +00:00
(let [telescope (require :telescope)
actions (require :telescope.actions)
themes (require :telescope.themes)]
(telescope.setup {:defaults {; Display
:prompt_prefix " "
:selection_caret " "
:set_env {:COLORTERM :truecolor}
2022-06-13 19:58:46 +00:00
:path_display [:truncate :absolute]
2022-04-05 19:57:44 +00:00
; Layout
:layout_strategy :horizontal
:layout_config {:horizontal {:preview_width 0.5}}
; Mappings
2022-06-12 21:06:29 +00:00
:mappings {:i {:<esc> actions.close}}
; Arguments
:vimgrep_arguments [:rg
2022-06-25 18:27:34 +00:00
:--hidden
:--ignore-vcs
:-g
:!.git/*
2022-06-12 21:06:29 +00:00
:--color=never
:--no-heading
:--with-filename
:--line-number
:--column
:--smart-case
:--trim]}
2022-10-26 14:10:57 +00:00
:extensions {:ui-select [(themes.get_dropdown {})]
:fzf {:fuzzy true
:override_generic_sorter true
:override_file_sorter true
:case_mode :smart_case}}})
(telescope.load_extension :fzf)
2022-04-05 21:36:29 +00:00
(telescope.load_extension :ui-select)
2022-04-21 16:55:53 +00:00
(telescope.load_extension :toggleterm)
(telescope.load_extension :yank_history)
2022-12-20 19:26:57 +00:00
(telescope.load_extension :undo)
2022-04-05 19:57:44 +00:00
(let [augroup (vim.api.nvim_create_augroup :NifocTelescope {:clear true})
aucmd vim.api.nvim_create_autocmd]
(aucmd :FileType {:pattern :TelescopePrompt
:callback #(set vim.opt_local.cursorline false)
:group augroup})
(aucmd :User {:pattern :TelescopePreviewerLoaded
:command "let w:is_telescope=v:true"
:group augroup})
(aucmd :BufWinEnter {:callback #(when vim.w.is_telescope
(set vim.opt_local.number true)
(set vim.opt_local.relativenumber false)
(set vim.opt_local.wrap true))
:group augroup})))
2022-04-21 16:55:53 +00:00