♻️ refactor(nvim): added telescope extensions as individual extras for more modularity
This commit is contained in:
parent
8f23e9faf5
commit
506917ede5
9 changed files with 163 additions and 123 deletions
|
@ -50,8 +50,15 @@
|
||||||
"plugins.extras.editor.ssr",
|
"plugins.extras.editor.ssr",
|
||||||
"plugins.extras.editor.suda",
|
"plugins.extras.editor.suda",
|
||||||
"plugins.extras.editor.tabscope",
|
"plugins.extras.editor.tabscope",
|
||||||
|
"plugins.extras.editor.telescope.all-recent",
|
||||||
|
"plugins.extras.editor.telescope.dap",
|
||||||
|
"plugins.extras.editor.telescope.import",
|
||||||
|
"plugins.extras.editor.telescope.lazy",
|
||||||
|
"plugins.extras.editor.telescope.luasnip",
|
||||||
"plugins.extras.editor.telescope.repo",
|
"plugins.extras.editor.telescope.repo",
|
||||||
"plugins.extras.editor.telescope.undotree",
|
"plugins.extras.editor.telescope.undotree",
|
||||||
|
"plugins.extras.editor.telescope.urlview",
|
||||||
|
"plugins.extras.editor.telescope.zoxide",
|
||||||
"plugins.extras.editor.winshift",
|
"plugins.extras.editor.winshift",
|
||||||
"plugins.extras.formatting.isort",
|
"plugins.extras.formatting.isort",
|
||||||
"plugins.extras.formatting.rustfmt",
|
"plugins.extras.formatting.rustfmt",
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"prochri/telescope-all-recent.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"kkharji/sqlite.lua",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
pickers = {
|
||||||
|
["workspaces.nvim#workspaces"] = {
|
||||||
|
disable = false,
|
||||||
|
sorting = "frecency",
|
||||||
|
},
|
||||||
|
["project.nvim#projects"] = {
|
||||||
|
disable = false,
|
||||||
|
sorting = "frecency",
|
||||||
|
},
|
||||||
|
["yanky.nvim#yank_history"] = {
|
||||||
|
disable = true,
|
||||||
|
},
|
||||||
|
["zoxide.nvim#zoxide"] = {
|
||||||
|
disable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
37
.config/nvim/lua/plugins/extras/editor/telescope/dap.lua
Normal file
37
.config/nvim/lua/plugins/extras/editor/telescope/dap.lua
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
"nvim-telescope/telescope-dap.nvim",
|
||||||
|
config = function()
|
||||||
|
Util.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").load_extension("dap")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>dm",
|
||||||
|
"<cmd>Telescope dap commands<CR>",
|
||||||
|
desc = "Commands",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>df",
|
||||||
|
"<cmd>Telescope dap frames<CR>",
|
||||||
|
desc = "Frames",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>dG",
|
||||||
|
"<cmd>Telescope dap configurations<CR>",
|
||||||
|
desc = "Configurations",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>dL",
|
||||||
|
"<cmd>Telescope dap list_breakpoints<CR>",
|
||||||
|
desc = "List Breakpoints",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>dv",
|
||||||
|
"<cmd>Telescope dap variables<CR>",
|
||||||
|
desc = "Variables",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
21
.config/nvim/lua/plugins/extras/editor/telescope/import.lua
Normal file
21
.config/nvim/lua/plugins/extras/editor/telescope/import.lua
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
"piersolenski/telescope-import.nvim",
|
||||||
|
opts = {},
|
||||||
|
config = function(_, opts)
|
||||||
|
Util.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").setup({
|
||||||
|
extensions = {
|
||||||
|
import = {
|
||||||
|
insert_at_top = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope").load_extension("import")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>si", "<cmd>Telescope import<CR>", desc = "Imports" },
|
||||||
|
},
|
||||||
|
}
|
13
.config/nvim/lua/plugins/extras/editor/telescope/lazy.lua
Normal file
13
.config/nvim/lua/plugins/extras/editor/telescope/lazy.lua
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
"tsakirist/telescope-lazy.nvim",
|
||||||
|
config = function()
|
||||||
|
Util.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").load_extension("lazy")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>sp", "<cmd>Telescope lazy<CR>", desc = "Plugins (Lazy)" },
|
||||||
|
},
|
||||||
|
}
|
13
.config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua
Normal file
13
.config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
"benfowler/telescope-luasnip.nvim",
|
||||||
|
config = function()
|
||||||
|
Util.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").load_extension("luasnip")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>sl", "<cmd>Telescope luasnip<CR>", desc = "Luasnip (Snippets)" },
|
||||||
|
},
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
return {
|
||||||
|
"axieax/urlview.nvim",
|
||||||
|
cmd = { "UrlView" },
|
||||||
|
keys = { { "<leader>sU", "<cmd>UrlView<cr>", desc = "Search Urls" } },
|
||||||
|
opts = {
|
||||||
|
default_picker = "telescope",
|
||||||
|
},
|
||||||
|
}
|
37
.config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua
Normal file
37
.config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
local Util = require("lazyvim.util")
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"jvgrootveld/telescope-zoxide",
|
||||||
|
config = function(_, opts)
|
||||||
|
Util.on_load("telescope.nvim", function()
|
||||||
|
require("telescope").setup({
|
||||||
|
extensions = {
|
||||||
|
zoxide = {
|
||||||
|
mappings = {
|
||||||
|
default = {
|
||||||
|
after_action = function(selection)
|
||||||
|
require("telescope.builtin").find_files({ cwd = selection.path })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
require("telescope").load_extension("zoxide")
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{ "<leader>fz", "<cmd>Telescope zoxide list<CR>", desc = "Zoxide" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"goolord/alpha-nvim",
|
||||||
|
opts = function(_, dashboard)
|
||||||
|
local button = dashboard.button("z", " " .. " Zoxide", "<cmd>Telescope zoxide list <CR>")
|
||||||
|
button.opts.hl = "AlphaButtons"
|
||||||
|
button.opts.hl_shortcut = "AlphaShortcut"
|
||||||
|
table.insert(dashboard.section.buttons.val, 5, button)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
|
@ -5,24 +5,6 @@ return {
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
|
||||||
"piersolenski/telescope-import.nvim",
|
|
||||||
config = function(_, opts)
|
|
||||||
Util.on_load("telescope.nvim", function()
|
|
||||||
require("telescope").setup({
|
|
||||||
extensions = {
|
|
||||||
import = {
|
|
||||||
insert_at_top = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require("telescope").load_extension("import")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
keys = {
|
|
||||||
{ "<leader>si", "<cmd>Telescope import<CR>", desc = "Imports" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
build = "make",
|
build = "make",
|
||||||
|
@ -33,105 +15,8 @@ return {
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"prochri/telescope-all-recent.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"kkharji/sqlite.lua",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
pickers = {
|
|
||||||
["workspaces.nvim#workspaces"] = {
|
|
||||||
disable = false,
|
|
||||||
sorting = "frecency",
|
|
||||||
},
|
|
||||||
["project.nvim#projects"] = {
|
|
||||||
disable = false,
|
|
||||||
sorting = "frecency",
|
|
||||||
},
|
|
||||||
["yanky.nvim#yank_history"] = {
|
|
||||||
disable = true,
|
|
||||||
},
|
|
||||||
["zoxide.nvim#zoxide"] = {
|
|
||||||
disable = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope-dap.nvim",
|
|
||||||
config = function()
|
|
||||||
Util.on_load("telescope.nvim", function()
|
|
||||||
require("telescope").load_extension("dap")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"benfowler/telescope-luasnip.nvim",
|
|
||||||
config = function()
|
|
||||||
Util.on_load("telescope.nvim", function()
|
|
||||||
require("telescope").load_extension("luasnip")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"jvgrootveld/telescope-zoxide",
|
|
||||||
config = function(_, opts)
|
|
||||||
Util.on_load("telescope.nvim", function()
|
|
||||||
require("telescope").setup({
|
|
||||||
extensions = {
|
|
||||||
zoxide = {
|
|
||||||
mappings = {
|
|
||||||
default = {
|
|
||||||
after_action = function(selection)
|
|
||||||
require("telescope.builtin").find_files({ cwd = selection.path })
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require("telescope").load_extension("zoxide")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tsakirist/telescope-lazy.nvim",
|
|
||||||
config = function()
|
|
||||||
Util.on_load("telescope.nvim", function()
|
|
||||||
require("telescope").load_extension("lazy")
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{
|
|
||||||
"<leader>dm",
|
|
||||||
"<cmd>Telescope dap commands<CR>",
|
|
||||||
desc = "Commands",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>df",
|
|
||||||
"<cmd>Telescope dap frames<CR>",
|
|
||||||
desc = "Frames",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>dG",
|
|
||||||
"<cmd>Telescope dap configurations<CR>",
|
|
||||||
desc = "Configurations",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>dL",
|
|
||||||
"<cmd>Telescope dap list_breakpoints<CR>",
|
|
||||||
desc = "List Breakpoints",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>dv",
|
|
||||||
"<cmd>Telescope dap variables<CR>",
|
|
||||||
desc = "Variables",
|
|
||||||
},
|
|
||||||
{ "<leader>fz", "<cmd>Telescope zoxide list<CR>", desc = "Zoxide" },
|
|
||||||
{ "<leader>sp", "<cmd>Telescope lazy<CR>", desc = "Plugins (Lazy)" },
|
|
||||||
{ "<leader>sl", "<cmd>Telescope luasnip<CR>", desc = "Luasnip (Snippets)" },
|
|
||||||
{
|
{
|
||||||
"<leader>ssa",
|
"<leader>ssa",
|
||||||
Util.telescope("lsp_document_symbols", {
|
Util.telescope("lsp_document_symbols", {
|
||||||
|
@ -442,12 +327,4 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"axieax/urlview.nvim",
|
|
||||||
cmd = { "UrlView" },
|
|
||||||
keys = { { "<leader>sU", "<cmd>UrlView<cr>", desc = "Search Urls" } },
|
|
||||||
opts = {
|
|
||||||
default_picker = "telescope",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue