diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2025-11-30 23:37:04 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2025-11-30 23:37:04 -0300 |
| commit | 7a32abb7c07c320cdeae19897d9daaea48acb1bb (patch) | |
| tree | ce530d2820afc7d0a14b1c2fa56a8f0bee96569c /lua/pi/telescope/init.lua | |
| parent | 42a77146a31d6d0180d80b1ada98cd828c2b4b22 (diff) | |
| download | nvim-conf-7a32abb7c07c320cdeae19897d9daaea48acb1bb.tar.gz nvim-conf-7a32abb7c07c320cdeae19897d9daaea48acb1bb.zip | |
refactorización!: migración de la funcionalidad de búsqueda y selección de archivos de Telescope a Snacks.nvim
CAMBIO IMPORTANTE: Se elimina el plugin Telescope y los módulos personalizados relacionados (init, mappings, my_actions, setup). Toda la navegación y búsqueda de archivos, buffers y selectores ahora utiliza Snacks.nvim. Se actualizan los mapeos de teclas y las dependencias de plugins para reflejar esta migración. También se modifican las configuraciones de plugins (codecompanion, copilot-chat, dap, lualine, refactoring, todo-comments) para eliminar o reemplazar el uso de Telescope por Snacks. Algunas opciones de formato en null-ls se comentan. Este cambio requiere Snacks.nvim y elimina nvim-telescope/telescope.nvim del espacio de trabajo.
Diffstat (limited to 'lua/pi/telescope/init.lua')
| -rw-r--r-- | lua/pi/telescope/init.lua | 186 |
1 files changed, 0 insertions, 186 deletions
diff --git a/lua/pi/telescope/init.lua b/lua/pi/telescope/init.lua deleted file mode 100644 index 7117a35..0000000 --- a/lua/pi/telescope/init.lua +++ /dev/null @@ -1,186 +0,0 @@ -local SHOULD_RELOAD_TELESCOPE = false - -local reloader = function() - if SHOULD_RELOAD_TELESCOPE then - Reload "plenary" - Reload "telescope" - Reload "pi.telescope.setup" - end -end - -local fb_actions = require("telescope").extensions.file_browser.actions -local actions = require "telescope.actions" -local my_actions = require "pi.telescope.my_actions" - -local M = {} - -function M.project_files() - local opts = { show_untracked = true } -- define here if you want to define something - local ok = pcall(require("telescope.builtin").git_files, opts) - if not ok then - require("telescope.builtin").find_files(opts) - end -end - -function M.branches() - require("telescope.builtin").git_branches { - attach_mappings = function(_, map) - map("i", "<c-j>", actions.git_create_branch) - map("n", "<c-j>", actions.git_create_branch) - return true - end, - } -end - -function M.search_config() - require("telescope.builtin").git_files { - prompt_title = "< Dotfiles >", - cwd = "$HOME/.dotfiles", - show_untracked = true, - } -end - -M.find_nvim_config = function() - require("telescope.builtin").find_files { - prompt_title = "< Neovim >", - cwd = "$HOME/.config/nvim/", - } -end - -M.find_nvim_plugin = function() - require("telescope.builtin").find_files { - prompt_title = "< Plugins >", - cwd = "$HOME/.config/nvim/lua/plugins/", - attach_mappings = function(_, map) - map("i", "<C-y>", my_actions.create_plugin) - map("i", "<C-w>", my_actions.disable_plugin) - map("i", "<C-e>", my_actions.enable_plugin) - - return true - end, - } -end - -function M.grep_string() - vim.ui.input({ prompt = "Grep for > " }, function(input) - if input == nil then - return - end - require("telescope.builtin").grep_string { search = input } - end) -end - -function M.grep_word() - require("telescope.builtin").grep_string { search = vim.fn.expand "<cword>" } -end - -function M.find_symbol() - vim.ui.input({ prompt = "Symbol for > " }, function(input) - if input == nil then - return - end - require("telescope.builtin").lsp_workspace_symbols { query = input } - end) -end - -function M.my_plugins() - if vim.fn.isdirectory(vim.fn.getenv "HOME" .. "/code/plugins/") == 0 then - vim.notify("Directory ~/code/plugins does not exists", vim.log.levels.WARN, { title = "Telescope Mappings" }) - return - end - require("telescope.builtin").find_files { - cwd = "~/code/plugins/", - } -end - -function M.scratchs() - require("telescope.builtin").find_files { - prompt_title = "Scratchs", - no_ignore = true, - cwd = "~/.config/nvim/lua/scratchs/", - attach_mappings = function(_, map) - map("i", "<c-t>", my_actions.create_scratch_file) - - return true - end, - } -end - -function M.projectionist() - return require("telescope").extensions.projectionist.projectionist() -end - -function M.laravel_commands() - return require("telescope").extensions.laravel.laravel() -end - -function M.api_specs() - if vim.fn.isdirectory "./api-specification" == 0 then - vim.notify("Directory api-specification does not exists", vim.log.levels.WARN, { title = "Telescope Mappings" }) - return - end - require("telescope.builtin").git_files { - cwd = "./api-specification", - show_untracked = true, - } -end - -function M.worktree() - return require("telescope").extensions.git_worktree.git_worktrees() -end - -function M.worktree_create() - return require("telescope").extensions.git_worktree.create_git_worktree() -end - -function M.refactor() - return require("telescope").extensions.refactoring.refactors() -end - -function M.gateway() - return require("pi.php.gateway").graphql_definitions { - layout_config = { - horizontal = { - preview_width = function(_, cols, _) - return math.floor(cols * 0.7) - end, - }, - }, - } -end - -function M.file_browser_relative() - return M.file_browser { path = "%:p:h" } -end - -function M.file_browser(opts) - opts = opts or {} - - opts = { - path = opts.path, - sorting_strategy = "ascending", - scroll_strategy = "cycle", - layout_config = { - prompt_position = "top", - }, - - attach_mappings = function(_, map) - map("i", "<c-y>", fb_actions.create_from_prompt) - - return true - end, - } - - return require("telescope").extensions.file_browser.file_browser(opts) -end - -return setmetatable({}, { - __index = function(_, k) - reloader() - if M[k] then - return M[k] - else - return require("telescope.builtin")[k] - end - end, -}) |