diff options
| author | Aotrix <[email protected]> | 2025-02-23 03:27:58 +0100 |
|---|---|---|
| committer | Aotrix <[email protected]> | 2025-02-23 03:27:58 +0100 |
| commit | 827193de75ecd7dd8da83272aafd036e12d9a573 (patch) | |
| tree | dfc217f21cdad93df7cdc15eb43509dcaf0ab60b /lua/telescope | |
| parent | edf2220385b054af2343402b0c268d2608a96b5b (diff) | |
refactored config
Diffstat (limited to 'lua/telescope')
| -rw-r--r-- | lua/telescope/multigrep.lua | 53 | ||||
| -rw-r--r-- | lua/telescope/telescope.lua | 31 |
2 files changed, 0 insertions, 84 deletions
diff --git a/lua/telescope/multigrep.lua b/lua/telescope/multigrep.lua deleted file mode 100644 index 749102e..0000000 --- a/lua/telescope/multigrep.lua +++ /dev/null @@ -1,53 +0,0 @@ -local pickers = require "telescope.pickers" -local finders = require "telescope.finders" -local make_entry = require "telescope.make_entry" -local conf = require "telescope.config".values - -local M = {} - -local live_multigrep = function(opts) - opts = opts or {} - opts.cwd = opts.cwd or vim.uv.cwd() - - local finder = finders.new_async_job { - command_generator = function(prompt) - if not prompt or prompt == "" then - return nil - end - - local pieces = vim.split(prompt, " ") - local args = { "rg" } - if pieces[1] then - table.insert(args, "-e") - table.insert(args, pieces[1]) - end - - if pieces[2] then - table.insert(args, "-g") - table.insert(args, pieces[2]) - end - - ---@diagnostic disable-next-line: deprecated - return vim.tbl_flatten { - args, - { "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" }, - } - end, - entry_maker = make_entry.gen_from_vimgrep(opts), - cwd = opts.cwd, - } - - pickers.new(opts, { - debounce = 100, - prompt_title = "Multi Grep", - finder = finder, - previewer = conf.grep_previewer(opts), - sorter = require("telescope.sorters").empty(), - }):find() -end - -M.setup = function() - vim.keymap.set("n", "<leader>pg", live_multigrep) -end - -return M diff --git a/lua/telescope/telescope.lua b/lua/telescope/telescope.lua deleted file mode 100644 index 5e9b476..0000000 --- a/lua/telescope/telescope.lua +++ /dev/null @@ -1,31 +0,0 @@ -local actions = require("telescope.actions") - -require("telescope").setup({ - defaults = { - -- Default configuration for telescope goes here: - -- config_key = value, - mappings = { - i = { - -- map actions.which_key to <C-h> (default: <C-/>) - -- actions.which_key shows the mappings for your picker, - -- e.g. git_{create, delete, ...}_branch for the git_branches picker - ["<C-j>"] = actions.move_selection_next, - ["<C-k>"] = actions.move_selection_previous, - ["<C-n>"] = actions.preview_scrolling_down, - ["<C-p>"] = actions.preview_scrolling_up, - ["<esc>"] = actions.close, - } - } - }, - extensions = { - coc = { - theme = 'ivy', - prefer_locations = true, -- always use Telescope locations to preview definitions/declarations/implementations etc - push_cursor_on_edit = true, -- save the cursor position to jump back in the future - timeout = 3000, -- timeout for coc commands - }, - fzf = {} - }, -}) -require('telescope').load_extension('coc') -require('telescope').load_extension('fzf') |
