init
This commit is contained in:
69
nvim/lua/plugins/extras/editor/telescope/repo.lua
Normal file
69
nvim/lua/plugins/extras/editor/telescope/repo.lua
Normal file
@@ -0,0 +1,69 @@
|
||||
return {
|
||||
{
|
||||
"cljoly/telescope-repo.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
init = function()
|
||||
vim.g["rooter_cd_cmd"] = "lcd"
|
||||
vim.g["rooter_silent_chdir"] = 1
|
||||
end,
|
||||
},
|
||||
{ "nvim-telescope/telescope.nvim" },
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
opts = {},
|
||||
config = function()
|
||||
LazyVim.on_load("telescope.nvim", function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
repo = {
|
||||
list = {
|
||||
fd_opts = {
|
||||
"--no-ignore-vcs",
|
||||
},
|
||||
search_dirs = {
|
||||
"~/dev/",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("repo")
|
||||
end)
|
||||
end,
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<leader>fp", "<cmd>Telescope repo list<cr>", desc = "Projects (~/dev)" },
|
||||
{ "<leader>fP", "<cmd>lua require'telescope'.extensions.repo.list{search_dirs = { '~/' }}<cr>", desc = "Projects (System)" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"goolord/alpha-nvim",
|
||||
optional = true,
|
||||
opts = function(_, dashboard)
|
||||
local button = dashboard.button("r", " " .. " Repos", "<cmd>Telescope repo list<CR>")
|
||||
button.opts.hl = "AlphaButtons"
|
||||
button.opts.hl_shortcut = "AlphaShortcut"
|
||||
table.insert(dashboard.section.buttons.val, 4, button)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimdev/dashboard-nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local projects = {
|
||||
action = "Telescope repo list",
|
||||
desc = " Repos",
|
||||
icon = " ",
|
||||
key = "r",
|
||||
}
|
||||
|
||||
projects.desc = projects.desc .. string.rep(" ", 43 - #projects.desc)
|
||||
projects.key_format = " %s"
|
||||
|
||||
table.insert(opts.config.center, 4, projects)
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user