From 7a32abb7c07c320cdeae19897d9daaea48acb1bb Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Sun, 30 Nov 2025 23:37:04 -0300 Subject: =?UTF-8?q?refactorizaci=C3=B3n!:=20migraci=C3=B3n=20de=20la=20fun?= =?UTF-8?q?cionalidad=20de=20b=C3=BAsqueda=20y=20selecci=C3=B3n=20de=20arc?= =?UTF-8?q?hivos=20de=20Telescope=20a=20Snacks.nvim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- lazy-lock.json | 88 ++++++++-------- lua/config/autocmds.lua | 2 +- lua/config/init.lua | 1 - lua/config/keymaps.lua | 2 +- lua/pi/lsp/attach.lua | 10 +- lua/pi/lsp/null-ls.lua | 36 +++---- lua/pi/telescope/init.lua | 186 --------------------------------- lua/pi/telescope/mappings.lua | 55 ---------- lua/pi/telescope/my_actions.lua | 170 ------------------------------ lua/pi/telescope/setup.lua | 222 ---------------------------------------- lua/plugins/codecompanion.lua | 4 +- lua/plugins/copilot-chat.lua | 7 +- lua/plugins/dap.lua | 10 +- lua/plugins/lualine.lua | 4 +- lua/plugins/refactoring.lua | 3 +- lua/plugins/snacks.lua | 88 ++++++++++++++++ lua/plugins/telescope.lua | 35 ------- lua/plugins/todo-comments.lua | 2 +- 18 files changed, 168 insertions(+), 757 deletions(-) delete mode 100644 lua/pi/telescope/init.lua delete mode 100644 lua/pi/telescope/mappings.lua delete mode 100644 lua/pi/telescope/my_actions.lua delete mode 100644 lua/pi/telescope/setup.lua create mode 100644 lua/plugins/snacks.lua delete mode 100644 lua/plugins/telescope.lua diff --git a/lazy-lock.json b/lazy-lock.json index 308bda2..77410d8 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,8 +1,8 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "CopilotChat.nvim": { "branch": "main", "commit": "a7138a0ee04d8af42c262554eccee168bbf1454f" }, + "CopilotChat.nvim": { "branch": "main", "commit": "df5376c132382dd47e3e552612940cbf25b3580c" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LazyVim": { "branch": "main", "commit": "064e61058b6bbaef02a6143662628d105695b8e5" }, + "LazyVim": { "branch": "main", "commit": "c64a61734fc9d45470a72603395c02137802bc6f" }, "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, "NeoColumn.nvim": { "branch": "main", "commit": "db7695c7c70fcacd290712deef659bca464634ee" }, "SmoothCursor.nvim": { "branch": "main", "commit": "12518b284e1e3f7c6c703b346815968e1620bee2" }, @@ -10,108 +10,100 @@ "baleia.nvim": { "branch": "main", "commit": "1b25eac3ac03659c3d3af75c7455e179e5f197f7" }, "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, "blink-cmp-latex": { "branch": "main", "commit": "3a958361e275bb5996e8393e7b2595b2f40c15ca" }, - "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, + "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, "buffer_manager.nvim": { "branch": "main", "commit": "a39ab3851a5487ac39cac4be43715b69349b8df7" }, "codecompanion-history.nvim": { "branch": "main", "commit": "eb99d256352144cf3b6a1c45608ec25544a0813d" }, - "codecompanion.nvim": { "branch": "main", "commit": "9c646bd193cb622fff1f9717177502fc6ad30a4a" }, + "codecompanion.nvim": { "branch": "main", "commit": "8ad65eef735b31bb47d76f59d878ee1bac4bdc85" }, "color-picker.nvim": { "branch": "master", "commit": "06cb5f853535dea529a523e9a0e8884cdf9eba4d" }, "composer.nvim": { "branch": "main", "commit": "ec9537969adc7fc128cfe9c3a9925850455896c8" }, - "copilot.lua": { "branch": "master", "commit": "93adf9844dcbe09a37e7a72eaa286d33d38bf628" }, + "copilot.lua": { "branch": "master", "commit": "4383e05a47493d7ff77b058c0548129eb38ec7fb" }, "direnv.vim": { "branch": "master", "commit": "ab2a7e08dd630060cd81d7946739ac7442a4f269" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, "elixir-tools.nvim": { "branch": "main", "commit": "b51b48edc668924a6b2f6610f9a0aff34741d20e" }, "firenvim": { "branch": "master", "commit": "a18ef908ac06b52ad9333b70e3e630b0a56ecb3d" }, - "floaterm": { "branch": "main", "commit": "34e14f0b5e2687fd31a93fe75982ec84e5145856" }, - "flutter-tools.nvim": { "branch": "main", "commit": "69db9cdac65ce536e20a8fc9a83002f007cc049c" }, + "floaterm": { "branch": "main", "commit": "fc2efaf25eeefcb33177d5807c0c745e125cf293" }, + "flutter-tools.nvim": { "branch": "main", "commit": "c7dfaa9ccca008fbc55ca0b4e5d9ef80e0248902" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "fzf": { "branch": "master", "commit": "c1b259c042c0855a0cbb547192fcdbb1940248db" }, - "fzf.vim": { "branch": "master", "commit": "879db51d0965515cdaef9b7f6bdeb91c65d2829e" }, "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" }, - "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, - "guihua.lua": { "branch": "master", "commit": "1ce3c7e8e2264c0788bf928b1b6696b4f6fbb20f" }, + "gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" }, + "guihua.lua": { "branch": "master", "commit": "ef44ba40f12e56c1c9fa45967f2b4d142e4b97a0" }, "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, "icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" }, "image.nvim": { "branch": "main", "commit": "acbd1d7d64ac0643021a6146eb0557e7c2e793d0" }, "img-clip.nvim": { "branch": "main", "commit": "e7e29f0d07110405adecd576b602306a7edd507a" }, "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, - "indent-o-matic": { "branch": "master", "commit": "4d11e98f523d3c4500b1dc33f0d1a248a4f69719" }, + "indent-o-matic": { "branch": "master", "commit": "764da1f30b5bb4a49035c3abc9a586322296b812" }, "json-nvim": { "branch": "master", "commit": "beb76a5ffa0a936677695bc82cc868654aad4398" }, - "laravel.nvim": { "branch": "main", "commit": "461b0d5c29abb9f8ca41ef77c735be725ea80660" }, - "lazy.nvim": { "branch": "main", "commit": "f0f5bbb9e5bfae5e6468f9359ffea3d151418176" }, + "laravel.nvim": { "branch": "main", "commit": "80e3621096cc2ce35079096a0a4a3f5cbb19b95f" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, - "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, "markdown-preview.nvim": { "branch": "main", "commit": "cc05a30393e2bf9f12e2d59fc35a1aa928ed1727" }, - "markview.nvim": { "branch": "main", "commit": "c93ea99d96b4bfda5b7c7d0dfca9c26edf6e78f0" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "3590d66effccc7376d8c3dbe45e8291f9fed2843" }, + "markview.nvim": { "branch": "main", "commit": "86fcabc793e8aa361cb308e794cd0e1356fdc0e1" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "7d527c76c43f46294de9c19d39c5a86317809b4b" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, - "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, "mcphub.nvim": { "branch": "main", "commit": "8ff40b5edc649959bb7e89d25ae18e055554859a" }, "menu": { "branch": "main", "commit": "7a0a4a2896b715c066cfbe320bdc048091874cc6" }, "middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" }, - "mini.diff": { "branch": "main", "commit": "98fc732d5835eb7b6539f43534399b07b17f4e28" }, - "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" }, - "mini.nvim": { "branch": "main", "commit": "ee4a4a4abed25e3d108d985b0553c5271f2f71aa" }, + "mini.diff": { "branch": "main", "commit": "fbb93ea1728e7c9d0944df8bd022a68402bd2e7e" }, + "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "mini.nvim": { "branch": "main", "commit": "c007f4b3822c99b98328bc214589a721c69d1514" }, "minty": { "branch": "main", "commit": "aafc9e8e0afe6bf57580858a2849578d8d8db9e0" }, "navigator.lua": { "branch": "master", "commit": "deaf00338fe288d24f5632b1842130f8d9c15b0a" }, "neogen": { "branch": "main", "commit": "d7f9461727751fb07f82011051338a9aba07581d" }, "neorg": { "branch": "main", "commit": "59775af2fadb85cec6bff08a584c2c98a1694ea6" }, - "neotest": { "branch": "master", "commit": "366175e1e74ff112787f9adbfb072eeaedd2a88e" }, - "neotest-go": { "branch": "main", "commit": "92950ad7be2ca02a41abca5c6600ff6ffaf5b5d6" }, + "neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" }, + "neotest-go": { "branch": "main", "commit": "59b50505053f9c45a9febb79e11a56206c3e3901" }, "neotest-plenary": { "branch": "master", "commit": "3523adcf9ffaad1911960c5813b0136c1b63a2ec" }, "neotest-python": { "branch": "master", "commit": "b0d3a861bd85689d8ed73f0590c47963a7eb1bf9" }, "neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" }, - "noice.nvim": { "branch": "main", "commit": "5099348591f7d3ba9e547b1e631c694c65bbe0b9" }, - "none-ls-extras.nvim": { "branch": "main", "commit": "402c6b5c29f0ab57fac924b863709f37f55dc298" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "none-ls-extras.nvim": { "branch": "main", "commit": "70659cc3d38151424298ab46b0f67f2251cef231" }, "none-ls-luacheck.nvim": { "branch": "main", "commit": "a1dfea0d4c40c4023829c8b9a7ab0a26135985ca" }, "none-ls-shellcheck.nvim": { "branch": "main", "commit": "0f84461241e76e376a95fb7391deac82dc3efdbf" }, - "none-ls.nvim": { "branch": "main", "commit": "a96172f673f720cd4f3572e1fcd08400ed3eb25d" }, + "none-ls.nvim": { "branch": "main", "commit": "1917c86818b5e058f53c2ea0ad38fc57534d62fc" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "numb.nvim": { "branch": "master", "commit": "7f564e638d3ba367abf1ec91181965b9882dd509" }, + "numb.nvim": { "branch": "master", "commit": "8164fd3d4d0c3ad2b1b111e9a63a59178981b743" }, "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, - "nvim-bqf": { "branch": "main", "commit": "a77b17e39b1b707b6feee86a36c83703c1534c08" }, + "nvim-bqf": { "branch": "main", "commit": "ba2b365969d7c2c6301d48e13aeee59568765529" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "6782b097af2417a4c3e33849b0a26ae2188bd7ea" }, + "nvim-dap": { "branch": "master", "commit": "5860c7c501eb428d3137ee22c522828d20cca0b3" }, "nvim-dap-go": { "branch": "main", "commit": "b4421153ead5d726603b02743ea40cf26a51ed5f" }, "nvim-dap-python": { "branch": "master", "commit": "64652d1ae1db80870d9aac7132d76e37acd86a26" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, - "nvim-early-retirement": { "branch": "main", "commit": "9109589b542773c9ad2a34067a085874f255577b" }, - "nvim-lspconfig": { "branch": "master", "commit": "87d30189b24caa496b54affd65594a309ac6d929" }, + "nvim-early-retirement": { "branch": "main", "commit": "cd29cf40af7473530a8598245ba1d348fd5e1fa0" }, + "nvim-lspconfig": { "branch": "master", "commit": "07f4e93de92e8d4ea7ab99602e3a8c9ac0fb778a" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, "nvim-python-repl": { "branch": "main", "commit": "09e77dcb9b44e28062a754f8019003bb88fe9734" }, "nvim-spectre": { "branch": "master", "commit": "72f56f7585903cd7bf92c665351aa585e150af0f" }, "nvim-transparent": { "branch": "main", "commit": "8ac59883de84e9cd1850ea25cf087031c5ba7d54" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "ec308c7827b5f8cb2dd0ad303a059c945dd21969" }, + "nvim-treesitter-context": { "branch": "master", "commit": "660861b1849256398f70450afdf93908d28dc945" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "a61a9de7965324d4019fb1637b66bfacdcb01f51" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "a9742cbc1f95db9eaf3293bf8cd0622ca36542bb" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, "oil-git-status.nvim": { "branch": "main", "commit": "4b5cf53842c17a09420919e655a6a559da3112d7" }, "oil-image-preview.nvim": { "branch": "master", "commit": "a71eacc879e1264339a62019ee3c2ff376f2cc39" }, - "oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" }, + "oil.nvim": { "branch": "master", "commit": "01cb3a8ad7d5e8707041edc775af83dbf33838f4" }, "pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "refactoring.nvim": { "branch": "master", "commit": "6784b54587e6d8a6b9ea199318512170ffb9e418" }, "rustaceanvim": { "branch": "master", "commit": "e9c5aaba16fead831379d5f44617547a90b913c7" }, - "rustowl": { "branch": "main", "commit": "37ac14ead9b7ab95e38bffebecf9a82c50c545e9" }, - "smart-splits.nvim": { "branch": "master", "commit": "6c7c64b6e1be6eb95fd9583c0969e0df625c6cd6" }, + "rustowl": { "branch": "main", "commit": "ac3deb26b168f40679e7a8704d58daae3370f16d" }, + "smart-splits.nvim": { "branch": "master", "commit": "e892a5da963813119d053af5b2260e3cd9d9f037" }, + "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, "spinner.nvim": { "branch": "main", "commit": "67ae7f64a6a7940be10c226301413521da26ea72" }, - "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, - "telescope-live-grep-args.nvim": { "branch": "master", "commit": "b80ec2c70ec4f32571478b501218c8979fab5201" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, - "todo-comments.nvim": { "branch": "main", "commit": "411503d3bedeff88484de572f2509c248e499b38" }, + "telescope.nvim": { "branch": "master", "commit": "e69b434b968a33815e2f02a5c7bd7b8dd4c7d4b2" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "treesj": { "branch": "main", "commit": "4770492244ccecdc9b01e0e81fa8f2f6b4a23841" }, - "trouble.nvim": { "branch": "main", "commit": "d7494d8bc563f8ae8b3f35d78c7478cf842b0ab9" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "twilight.nvim": { "branch": "main", "commit": "664e752f4a219801265cc3fc18782b457b58c1e1" }, "undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" }, "vim-dispatch": { "branch": "master", "commit": "a2ff28abdb2d89725192db5b8562977d392a4d3f" }, @@ -124,8 +116,8 @@ "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, "vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, - "vim-test": { "branch": "master", "commit": "2c264d2a5dddb3a7ec927e4359a2b619a8c13a8c" }, - "vimtex": { "branch": "master", "commit": "be9deac3a23eeb145ccf11dd09080795838496ce" }, + "vim-test": { "branch": "master", "commit": "bbdc7f5d6280a047c3b1a951614454555a566356" }, + "vimtex": { "branch": "master", "commit": "32bcb3922c20588e00de68f73c86312eda2141ad" }, "volt": { "branch": "main", "commit": "620de1321f275ec9d80028c68d1b88b409c0c8b1" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, "zen-mode.nvim": { "branch": "main", "commit": "8564ce6d29ec7554eb9df578efa882d33b3c23a7" } diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index ad999b9..1d3fe8a 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -63,7 +63,7 @@ vim.api.nvim_create_autocmd("BufEnter", { if vim.opt.diff:get() then local wk = require "which-key" local opts = { - mode = "n", -- NORMAL mode + mode = "n", -- NORMAL mode buffer = vim.api.nvim_get_current_buf(), -- Specify a buffer number for buffer local mappings } local mappings = { diff --git a/lua/config/init.lua b/lua/config/init.lua index bc22409..ee1c549 100644 --- a/lua/config/init.lua +++ b/lua/config/init.lua @@ -27,7 +27,6 @@ vim.api.nvim_create_autocmd("User", { require "config.autocmds" require "config.usercmds" require "config.keymaps" - require "config.diagnostic" require "config.composer" end, }) diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 07c9d77..88251eb 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -108,7 +108,7 @@ map("n", "vi", function() end, { desc = "Create REPL in vertical or horizontal split" }) map("n", "-", "Oil", { desc = "Open parent directory" }) map("n", "fg", function() - require("telescope").extensions.live_grep_args.live_grep_args() + Snacks.picker.grep() end, { desc = "run grep" }) -- Asignar la función a una tecla específica diff --git a/lua/pi/lsp/attach.lua b/lua/pi/lsp/attach.lua index c61f5a1..3611279 100644 --- a/lua/pi/lsp/attach.lua +++ b/lua/pi/lsp/attach.lua @@ -1,4 +1,4 @@ -local telescope_mapper = require "pi.telescope.mappings" +-- local telescope_mapper = require "pi.telescope.mappings" return function(client, bufnr) -- keymaps for lsp @@ -23,10 +23,10 @@ return function(client, bufnr) vim.notify("Inlay hints " .. (current and "disabled" or "enabled")) end, { buffer = 0, desc = "LSP Toggle inlay hints" }) - telescope_mapper("gr", "lsp_references", { buffer = true, desc = "LSP References of symbol on cursor" }) - telescope_mapper("pv", "find_symbol", { buffer = true, desc = "LSP find symbol on the project" }) - telescope_mapper("pd", "lsp_document_symbols", { buffer = true, desc = "LSP document symbols" }) - telescope_mapper("", "lsp_definitions", { buffer = true, desc = "LSP go to definition" }) + vim.keymap.set("n", "gr", function() Snacks.picker.lsp_references() end, { buffer = bufnr, desc = "LSP References of symbol on cursor" }) + vim.keymap.set("n", "pv", function() Snacks.picker.lsp_workspace_symbols() end, { buffer = bufnr, desc = "LSP find symbol on the project" }) + vim.keymap.set("n", "pd", function() Snacks.picker.lsp_symbols() end, { buffer = bufnr, desc = "LSP document symbols" }) + vim.keymap.set("n", "", function() Snacks.picker.lsp_definitions() end, { buffer = bufnr, desc = "LSP go to definition" }) vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc" diff --git a/lua/pi/lsp/null-ls.lua b/lua/pi/lsp/null-ls.lua index 3026bd4..d8211ed 100644 --- a/lua/pi/lsp/null-ls.lua +++ b/lua/pi/lsp/null-ls.lua @@ -11,7 +11,7 @@ null_ls.setup { null_ls.builtins.code_actions.refactoring, null_ls.builtins.formatting.alejandra, require "none-ls-luacheck.diagnostics.luacheck", - null_ls.builtins.formatting.stylua, + -- null_ls.builtins.formatting.stylua, require "none-ls.diagnostics.yamllint", -- require("none-ls.diagnostics.ruff"), @@ -72,23 +72,23 @@ null_ls.setup { -- --quiet: suprime la salida normal -- --color: colorea el diff -- --exclude ".*test.*": excluye archivos que coincidan con el patrón - null_ls.builtins.formatting.black.with { - extra_args = { - "--line-length", - "100", - -- "--fast", - "--skip-string-normalization", - "--skip-magic-trailing-comma", - "--target-version", - "py312", - -- "--preview", - -- "--diff", - -- "--quiet", - -- "--color", - "--exclude", - ".*test.*", - }, - }, + -- null_ls.builtins.formatting.black.with { + -- extra_args = { + -- "--line-length", + -- "120", + -- -- "--fast", + -- "--skip-string-normalization", + -- "--skip-magic-trailing-comma", + -- "--target-version", + -- "py312", + -- -- "--preview", + -- -- "--diff", + -- -- "--quiet", + -- -- "--color", + -- "--exclude", + -- ".*test.*", + -- }, + -- }, -- Assembly formatter { name = "asmfmt", 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", "", actions.git_create_branch) - map("n", "", 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", "", my_actions.create_plugin) - map("i", "", my_actions.disable_plugin) - map("i", "", 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 "" } -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", "", 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", "", 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, -}) diff --git a/lua/pi/telescope/mappings.lua b/lua/pi/telescope/mappings.lua deleted file mode 100644 index a927023..0000000 --- a/lua/pi/telescope/mappings.lua +++ /dev/null @@ -1,55 +0,0 @@ -local map_tele = function(key, f, opts) - local default = { - mode = "n", - options = {}, - buffer = nil, - desc = nil, - } - opts = opts or {} - opts = vim.tbl_deep_extend("force", default, opts or {}) - - local rhs = function() - R("pi.telescope")[f](opts.options) - end - - local map_options = { - remap = false, - silent = true, - } - if opts.buffer then - map_options.buffer = opts.buffer - end - if opts.desc then - map_options.desc = "Telescope: " .. opts.desc - end - - vim.keymap.set(opts.mode, key, rhs, map_options) -end - --- not shure what this line does -vim.api.nvim_set_keymap( - "c", - "", - "(TelescopeFuzzyCommandSearch)", - { noremap = false, nowait = true, desc = "In comand look for previous commands" } -) - -map_tele("pp", "project_files", { desc = "Open Project files" }) -map_tele("gc", "branches", { desc = "Git Branches selector" }) -map_tele("pw", "grep_word", { desc = "Grep word under cursor" }) -map_tele("ps", "grep_string", { desc = "Grep provided input string" }) -map_tele("rc", "search_config", { desc = "Search Files in .dotfiles directory" }) -map_tele("rn", "find_nvim_config", { desc = "Search Files in nvim config directory" }) -map_tele("rp", "find_nvim_plugin", { desc = "Search Neovim plugins" }) -map_tele("rs", "scratchs", { desc = "Search Neovim Scratchs files" }) -map_tele("ph", "help_tags", { desc = "Neovim Help" }) -map_tele("pe", "buffers", { desc = "Open buffers" }) -map_tele("pr", "treesitter", { desc = "Treesitter buffer elements" }) -map_tele("bb", "file_browser_relative", { desc = "Current directory" }) -map_tele("bp", "file_browser", { desc = "Project directory" }) -map_tele("gs", "git_status", { desc = "Git status" }) -map_tele("ve", "diagnostics", { desc = "Diagnostic of the buffer" }) -map_tele("po", "api_specs", { desc = "Openapi directory" }) -map_tele("pm", "gateway", { desc = "Graphql mutations and queries" }) - -return map_tele diff --git a/lua/pi/telescope/my_actions.lua b/lua/pi/telescope/my_actions.lua deleted file mode 100644 index 2afb8aa..0000000 --- a/lua/pi/telescope/my_actions.lua +++ /dev/null @@ -1,170 +0,0 @@ -local M = {} - -local action_state = require "telescope.actions.state" -local actions = require "telescope.actions" - -M.create_plugin = function(prompt_bufnr) - local new_plugin = action_state.get_current_line() - actions.close(prompt_bufnr) - vim.cmd(string.format("edit ~/.config/nvim/lua/plugins/%s.lua", new_plugin)) -end - - -local get_disable_stm_node = function(bufnr, tree) - vim.treesitter.query.set( - "lua", - "pi_plugin_is_disabled", - [[ -(return_statement - (expression_list - (table_constructor - (field - name: (identifier) @enabled (#eq? @enabled "enabled") - value: (false) @is_false - ) - ) - ) - ) - ]] - ) - - local query = vim.treesitter.query.get("lua", "pi_plugin_is_disabled") - - for id, node in query:iter_captures(tree:root(), bufnr) do - if query.captures[id] == "enabled" then - return node - end - end - - return nil -end - -local get_enabled_node = function(bufnr, tree) - vim.treesitter.query.set( - "lua", - "pi_plugin_has_enable_property", - [[ -(return_statement - (expression_list - (table_constructor - (field - name: (identifier) @enabled (#eq? @enabled "enabled") - ) - ) - ) - ) - ]] - ) - - local query = vim.treesitter.query.get("lua", "pi_plugin_has_enable_property") - - for id, node in query:iter_captures(tree:root(), bufnr) do - if query.captures[id] == "enabled" then - return node - end - end - - return nil -end - -local get_return_node = function(bufnr, tree) - vim.treesitter.query.set( - "lua", - "pi_plugin_return_table_constructor", - [[ -(return_statement - (expression_list - (table_constructor) @table_constructor - ) - ) - ]] - ) - - local query = vim.treesitter.query.get("lua", "pi_plugin_return_table_constructor") - - for id, node in query:iter_captures(tree:root(), bufnr) do - if query.captures[id] == "table_constructor" then - return node - end - end - - return nil -end - -M.disable_plugin = function(prompt_bufnr) - local entry = action_state.get_selected_entry() - local uri = vim.uri_from_fname(entry.cwd .. entry[1]) - local bufnr = vim.uri_to_bufnr(uri) - vim.fn.bufload(bufnr) - - local parsers = require "nvim-treesitter.parsers" - local parser = parsers.get_parser(bufnr) - local tree = parser:parse()[1] - - local disabled_stm_node = get_disable_stm_node(bufnr, tree) - if disabled_stm_node ~= nil then - vim.notify("Plugin is already disable", vim.log.levels.WARN, {}) - return - end - - local start_line - local end_line - - local enable_node = get_enabled_node(bufnr, tree) - if enable_node == nil then - -- node does not exists need to assume line - local return_node = get_return_node(bufnr, tree) - - if return_node == nil then - vim.notify("Can determine how to diable the plugin", vim.log.levels.ERROR, {}) - return - end - - start_line = return_node:start() + 2 - end_line = start_line - else - start_line = enable_node:start() - end_line = start_line + 1 - end - - vim.api.nvim_buf_set_lines(bufnr, start_line, end_line, false, { " enabled = false," }) - vim.notify("Plugin " .. entry[1] .. " Disabled", vim.log.levels.INFO, {}) - actions.close(prompt_bufnr) - vim.api.nvim_buf_call(bufnr, function() - vim.cmd "write" - end) -end - -M.enable_plugin = function(prompt_bufnr) - local entry = action_state.get_selected_entry() - local uri = vim.uri_from_fname(entry.cwd .. entry[1]) - local bufnr = vim.uri_to_bufnr(uri) - vim.fn.bufload(bufnr) - - local parsers = require "nvim-treesitter.parsers" - local parser = parsers.get_parser(bufnr) - - local tree = parser:parse()[1] - - local disabled_stm_node = get_disable_stm_node(bufnr, tree) - if disabled_stm_node == nil then - vim.notify("Plugin is already Enable", vim.log.levels.WARN, {}) - return - end - - local enable_line = disabled_stm_node:start() - vim.api.nvim_buf_set_lines(bufnr, enable_line, enable_line + 1, false, {}) - vim.notify("Plugin " .. entry[1] .. " Enabled", vim.log.levels.INFO, {}) - actions.close(prompt_bufnr) - vim.api.nvim_buf_call(bufnr, function() - vim.cmd "write" - end) -end - -M.create_scratch_file = function(prompt_bufnr) - local new_scratch = action_state.get_current_line() - actions.close(prompt_bufnr) - vim.cmd(string.format("edit ~/.config/nvim/lua/scratchs/%s.lua", new_scratch)) -end - -return M diff --git a/lua/pi/telescope/setup.lua b/lua/pi/telescope/setup.lua deleted file mode 100644 index 0e368c7..0000000 --- a/lua/pi/telescope/setup.lua +++ /dev/null @@ -1,222 +0,0 @@ -local actions = require "telescope.actions" -local action_state = require "telescope.actions.state" -local action_layout = require "telescope.actions.layout" - -local set_prompt_to_entry_value = function(prompt_bufnr) - local entry = action_state.get_selected_entry() - if not entry or not type(entry) == "table" then - return - end - - action_state.get_current_picker(prompt_bufnr):reset_prompt(entry.ordinal) -end - -local filetype_hook = function(filepath, bufnr, opts) - -- Here for example you can say: if ft == "xyz" then this_regex_highlighing else nothing end - -- - local is_image = function(filepath) - local image_extensions = { "png", "jpg" } -- Supported image formats - local split_path = vim.split(filepath:lower(), ".", { plain = true }) - local extension = split_path[#split_path] - return vim.tbl_contains(image_extensions, extension) - end - if not is_image(filepath) then - return true - end - local ui = require "image.ui" - local options = require "image.options" - local dimensions = require "image.dimensions" - local api = require "image.api" - local config = require "image.config" - local user_opts = { - render = { - foreground_color = true, - background_color = true, - }, - } - local global_opts = vim.tbl_deep_extend("force", config.DEFAULT_OPTS, user_opts) - - local ascii_width, ascii_height, horizontal_padding, vertical_padding, img_width, img_height = - dimensions.calculate_ascii_width_height(opts.winid, filepath, global_opts) - options.set_options_before_render(bufnr) - ui.buf_clear(bufnr) - local label = ui.create_label( - filepath, - ascii_width, - horizontal_padding, - global_opts.render.show_image_dimensions, - img_width, - img_height - ) - - api.get_ascii_data_sync(filepath, ascii_width, ascii_height, global_opts, function(ascii_data) - ui.buf_insert_data_with_padding(bufnr, ascii_data, horizontal_padding, vertical_padding, label, global_opts) - - options.set_options_after_render(bufnr) - end) - return false -end - -require("telescope").setup { - defaults = { - preview = { - filetype_hook = filetype_hook, - }, - prompt_prefix = "❯ ", - selection_caret = "❯ ", - - winblend = 0, - - layout_strategy = "horizontal", - layout_config = { - width = 0.95, - height = 0.85, - -- preview_cutoff = 120, - prompt_position = "bottom", - - horizontal = { - preview_width = function(_, cols, _) - if cols > 200 then - return math.floor(cols * 0.5) - else - return math.floor(cols * 0.7) - end - end, - }, - - vertical = { - width = 0.9, - height = 0.95, - preview_height = 0.5, - }, - - flex = { - horizontal = { - preview_width = 0.9, - }, - }, - }, - - selection_strategy = "reset", - sorting_strategy = "descending", - scroll_strategy = "cycle", - color_devicons = true, - - mappings = { - i = { - -- [""] = false, - -- [""] = actions.select_horizontal, - [""] = "move_selection_next", - - [""] = set_prompt_to_entry_value, - - -- These are new :) - [""] = action_layout.toggle_preview, - [""] = action_layout.toggle_mirror, - -- [""] = action_layout.toggle_prompt_position, - - -- [""] = actions.master_stack, - - -- [""] = actions.send_to_qflist + actions.open_qflist, - -- [""] = actions.send_selected_to_qflist + actions.open_qflist, - - -- This is nicer when used with smart-history plugin. - [""] = actions.cycle_history_next, - [""] = actions.cycle_history_prev, - - -- [""] = function(prompt_bufnr) - -- local opts = { - -- callback = actions.toggle_selection, - -- loop_callback = actions.send_selected_to_qflist, - -- } - -- require("telescope").extensions.hop._hop_loop(prompt_bufnr, opts) - -- end, - - -- [""] = function() - -- vim.api.nvim_input("") - -- end, - }, - }, - - -- borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - -- file_ignore_patterns = nil, - - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - - history = { - path = "~/.local/share/nvim/databases/telescope_history.sqlite3", - limit = 100, - }, - -- buffer_previewer_maker = new_maker, - }, - - pickers = { - fd = { - mappings = { - n = { - ["kj"] = "close", - }, - }, - }, - - git_branches = { - mappings = { - i = { - [""] = false, - }, - }, - }, - }, - - extensions = { - fzy_native = { - override_generic_sorter = true, - override_file_sorter = true, - }, - - fzf_writer = { - use_highlighter = false, - minimum_grep_characters = 6, - }, - - hop = { - -- keys define your hop keys in order; defaults to roughly lower- and uppercased home row - keys = { "a", "s", "d", "f", "g", "h", "j", "k", "l", ";" }, -- ... and more - - -- Highlight groups to link to signs and lines; the below configuration refers to demo - -- sign_hl typically only defines foreground to possibly be combined with line_hl - sign_hl = { "WarningMsg", "Title" }, - - -- optional, typically a table of two highlight groups that are alternated between - line_hl = { "CursorLine", "Normal" }, - - -- options specific to `hop_loop` - -- true temporarily disables Telescope selection highlighting - clear_selection_hl = false, - -- highlight hopped to entry with telescope selection highlight - -- note: mutually exclusive with `clear_selection_hl` - trace_entry = true, - -- jump to entry where hoop loop was started from - reset_selection = true, - }, - - ["ui-select"] = { - require("telescope.themes").get_dropdown { - borderchars = { - prompt = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - results = { "─", "│", "─", "│", "╭", "╮", "┤", "├" }, - preview = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - }, - width = 0.8, - previewer = false, - }, - }, - }, -} - -require("telescope").load_extension "notify" -require("telescope").load_extension "file_browser" -require("telescope").load_extension "ui-select" -require("telescope").load_extension "fzf" diff --git a/lua/plugins/codecompanion.lua b/lua/plugins/codecompanion.lua index ff00936..052b066 100644 --- a/lua/plugins/codecompanion.lua +++ b/lua/plugins/codecompanion.lua @@ -6,7 +6,7 @@ return { dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", - "nvim-telescope/telescope.nvim", -- Using telescope for file and buffer picker + -- "nvim-telescope/telescope.nvim", -- Using telescope for file and buffer picker "jellydn/spinner.nvim", -- Show loading spinner when request is started "ravitemer/codecompanion-history.nvim", -- History management extension { @@ -200,7 +200,7 @@ return { -- Number of days after which chats are automatically deleted (0 to disable) expiration_days = 0, -- Picker interface (auto resolved to a valid picker) - picker = "telescope", -- ("telescope", "snacks", "fzf-lua", or "default") + picker = "snacks", -- ("telescope", "snacks", "fzf-lua", or "default") -- Optional filter function to control which chats are shown when browsing chat_filter = nil, -- function(chat_data) return boolean end -- Customize picker keymaps (optional) diff --git a/lua/plugins/copilot-chat.lua b/lua/plugins/copilot-chat.lua index c7decda..be40096 100644 --- a/lua/plugins/copilot-chat.lua +++ b/lua/plugins/copilot-chat.lua @@ -26,7 +26,7 @@ return { -- version = "v3.3.0", dependencies = { { "nvim-lua/plenary.nvim" }, - { "nvim-telescope/telescope.nvim" }, -- Using telescope instead of fzf-lua + -- { "nvim-telescope/telescope.nvim" }, -- Using telescope instead of fzf-lua }, opts = { -- question_header = "## User ", @@ -34,7 +34,7 @@ return { -- error_header = "## Error ", prompts = prompts, -- Turn off Claude model as it's not working well - -- model = "claude-3.5-sonnet", + model = "gpt-4.1", auto_follow_cursor = false, -- Don't follow the cursor after getting response }, @@ -50,7 +50,8 @@ return { -- opts.answer_header = " Copilot " -- Override the git prompts message opts.prompts.Commit = { - prompt = '> #git:staged\n\nWrite commit message with commitizen convention. Write clear, informative commit messages that explain the "what" and "why" behind changes, not just the "how".', + prompt = + '> #git:staged\n\nWrite commit message with commitizen convention. Write clear, informative commit messages that explain the "what" and "why" behind changes, not just the "how".', } chat.setup(opts) diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index 01e6567..ab84671 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -6,17 +6,17 @@ return { "leoluz/nvim-dap-go", "mxsdev/nvim-dap-vscode-js", "anuvyklack/hydra.nvim", - "nvim-telescope/telescope-dap.nvim", + -- "nvim-telescope/telescope-dap.nvim", -- Note: cmp-dap removed due to migration to blink.cmp -- blink.cmp handles DAP completions automatically }, keys = { { "d", desc = "Open Debug menu" } }, config = function() require "pi.dap" - local ok_telescope, telescope = pcall(require, "telescope") - if ok_telescope then - telescope.load_extension "dap" - end + -- local ok_telescope, telescope = pcall(require, "telescope") + -- if ok_telescope then + -- telescope.load_extension "dap" + -- end -- Note: DAP completions are handled automatically by blink.cmp -- No additional configuration needed diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index aa74930..9409537 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -133,7 +133,7 @@ return { { "filename", on_click = function() - require("telescope.builtin").find_files() + Snacks.picker.files() -- print('file name clicked') end, icon = " ", @@ -147,7 +147,7 @@ return { { "diagnostics", on_click = function() - require("telescope.builtin").diagnostics() + Snacks.picker.diagnostics() end, -- separator = { left = '' }, sources = { "nvim_diagnostic" }, diff --git a/lua/plugins/refactoring.lua b/lua/plugins/refactoring.lua index 92cdf64..7ca3989 100644 --- a/lua/plugins/refactoring.lua +++ b/lua/plugins/refactoring.lua @@ -8,7 +8,7 @@ return { { "rr", function() - require("telescope").extensions.refactoring.refactors() + require("refactoring").select_refactor() end, mode = { "n", "v" }, desc = "Refactoring menu", @@ -16,6 +16,5 @@ return { }, config = function() require("refactoring").setup {} - require("telescope").load_extension "refactoring" end, } diff --git a/lua/plugins/snacks.lua b/lua/plugins/snacks.lua new file mode 100644 index 0000000..bcec3e5 --- /dev/null +++ b/lua/plugins/snacks.lua @@ -0,0 +1,88 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + bigfile = { enabled = true }, + dashboard = { enabled = true }, + explorer = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + notifier = { enabled = true }, + picker = { enabled = true }, + quickfile = { enabled = true }, + scope = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + }, + keys = { + -- Top Pickers & Explorer + { "", function() Snacks.picker.smart() end, desc = "Smart Find Files" }, + { ",", function() Snacks.picker.buffers() end, desc = "Buffers" }, + { "/", function() Snacks.picker.grep() end, desc = "Grep" }, + { ":", function() Snacks.picker.command_history() end, desc = "Command History" }, + { "n", function() Snacks.picker.notifications() end, desc = "Notification History" }, + { "e", function() Snacks.explorer() end, desc = "File Explorer" }, + -- find + { "fb", function() Snacks.picker.buffers() end, desc = "Buffers" }, + { "fc", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Find Config File" }, + { "ff", function() Snacks.picker.files() end, desc = "Find Files" }, + { "gf", function() Snacks.picker.git_files() end, desc = "Find Git Files" }, + { "fr", function() Snacks.picker.recent() end, desc = "Recent" }, + -- git + { "gl", function() Snacks.picker.git_log() end, desc = "Git Log" }, + { "gs", function() Snacks.picker.git_status() end, desc = "Git Status" }, + -- Grep + { "sb", function() Snacks.picker.lines() end, desc = "Buffer Lines" }, + { "sB", function() Snacks.picker.grep_buffers() end, desc = "Grep Open Buffers" }, + { "sg", function() Snacks.picker.grep() end, desc = "Grep" }, + { "sw", function() Snacks.picker.grep_word() end, desc = "Visual selection or word", mode = { "n", "x" } }, + -- search + { 's"', function() Snacks.picker.registers() end, desc = "Registers" }, + { 's/', function() Snacks.picker.search_history() end, desc = "Search History" }, + { "sa", function() Snacks.picker.autocmds() end, desc = "Autocmds" }, + { "sc", function() Snacks.picker.command_history() end, desc = "Command History" }, + { "sC", function() Snacks.picker.commands() end, desc = "Commands" }, + { "sd", function() Snacks.picker.diagnostics() end, desc = "Diagnostics" }, + { "sh", function() Snacks.picker.help() end, desc = "Help Pages" }, + { "si", function() Snacks.picker.icons() end, desc = "Icons" }, + { "sk", function() Snacks.picker.keymaps() end, desc = "Keymaps" }, + { "sl", function() Snacks.picker.loclist() end, desc = "Location List" }, + { "sm", function() Snacks.picker.marks() end, desc = "Marks" }, + { "sq", function() Snacks.picker.qflist() end, desc = "Quickfix List" }, + { "sR", function() Snacks.picker.resume() end, desc = "Resume" }, + { "su", function() Snacks.picker.undo() end, desc = "Undo History" }, + { "st", function() Snacks.picker.todo_comments() end, desc = "Todo" }, + { "sT", function() Snacks.picker.todo_comments({ keywords = { "TODO", "FIX", "FIXME" } }) end, desc = "Todo/Fix/Fixme" }, + { "uC", function() Snacks.picker.colorschemes() end, desc = "Colorschemes" }, + -- LSP + { "gd", function() Snacks.picker.lsp_definitions() end, desc = "Goto Definition" }, + { "gD", function() Snacks.picker.lsp_declarations() end, desc = "Goto Declaration" }, + { "gr", function() Snacks.picker.lsp_references() end, nowait = true, desc = "References" }, + { "gI", function() Snacks.picker.lsp_implementations() end, desc = "Goto Implementation" }, + { "gy", function() Snacks.picker.lsp_type_definitions() end, desc = "Goto T[y]pe Definition" }, + { "ss", function() Snacks.picker.lsp_symbols() end, desc = "LSP Symbols" }, + { "sS", function() Snacks.picker.lsp_workspace_symbols() end, desc = "LSP Workspace Symbols" }, + + -- Migrated from Telescope + { "pp", function() Snacks.picker.smart() end, desc = "Open Project files" }, + { "gc", function() Snacks.picker.git_branches() end, desc = "Git Branches selector" }, + { "pw", function() Snacks.picker.grep_word() end, desc = "Grep word under cursor" }, + { "ps", function() Snacks.picker.grep() end, desc = "Grep provided input string" }, + { "rc", function() Snacks.picker.git_files({ cwd = vim.fn.expand("~/.dotfiles") }) end, desc = "Search Files in .dotfiles directory" }, + { "rn", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) end, desc = "Search Files in nvim config directory" }, + { "rp", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") .. "/lua/plugins" }) end, desc = "Search Neovim plugins" }, + { "rs", function() Snacks.picker.files({ cwd = vim.fn.stdpath("config") .. "/lua/scratchs" }) end, desc = "Search Neovim Scratchs files" }, + { "ph", function() Snacks.picker.help() end, desc = "Neovim Help" }, + { "pe", function() Snacks.picker.buffers() end, desc = "Open buffers" }, + -- { "pr", function() Snacks.picker.treesitter() end, desc = "Treesitter buffer elements" }, -- Check if treesitter exists + { "bb", function() Snacks.explorer() end, desc = "Current directory" }, + { "bp", function() Snacks.explorer() end, desc = "Project directory" }, + -- { "gs", function() Snacks.picker.git_status() end, desc = "Git status" }, -- Already in default + { "ve", function() Snacks.picker.diagnostics() end, desc = "Diagnostic of the buffer" }, + { "po", function() Snacks.picker.git_files({ cwd = "./api-specification" }) end, desc = "Openapi directory" }, + -- { "pm", "gateway", { desc = "Graphql mutations and queries" }) -- Skipped + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua deleted file mode 100644 index c34e299..0000000 --- a/lua/plugins/telescope.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - dependencies = { - { "nvim-lua/plenary.nvim" }, - { "nvim-lua/popup.nvim" }, - { "nvim-telescope/telescope-fzy-native.nvim" }, - { "kyazdani42/nvim-web-devicons" }, - { "nvim-telescope/telescope-file-browser.nvim" }, - { "nvim-telescope/telescope-ui-select.nvim" }, - { "nvim-telescope/telescope-live-grep-args.nvim" }, - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - dependencies = { - "junegunn/fzf.vim", - dependencies = { - { - "tpope/vim-dispatch", - cmd = { "Make", "Dispatch" }, - }, - { - "junegunn/fzf", - build = ":call fzf#install()", - } - }, - }, - }, - }, - event = "VeryLazy", - config = function() - require "pi.telescope.setup" - require "pi.telescope.mappings" - require("telescope").load_extension("live_grep_args") - end, -} diff --git a/lua/plugins/todo-comments.lua b/lua/plugins/todo-comments.lua index fef635e..3c4c232 100644 --- a/lua/plugins/todo-comments.lua +++ b/lua/plugins/todo-comments.lua @@ -5,7 +5,7 @@ return { }, config = true, lazy = false, - cmd = { "TodoTrouble", "TodoTelescope", "TodoQuickFix" }, + cmd = { "TodoTrouble", "TodoQuickFix" }, keys = { { "]t", -- cgit v1.2.3