feat: telescope references

This commit is contained in:
2026-06-02 13:17:31 +02:00
parent b5520b068a
commit 79fe6e83f0
+137 -120
View File
@@ -1,140 +1,157 @@
return {
-- fuzzy finder
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-live-grep-args.nvim",
-- This will not install any breaking changes.
-- For major updates, this must be adjusted manually.
version = "^1.0.0",
},
},
event = { "LspAttach" },
keys = {
{
"<leader>ff",
function()
require("telescope.builtin").find_files()
end,
desc = "Telescope find files",
},
-- fuzzy finder
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-live-grep-args.nvim",
-- This will not install any breaking changes.
-- For major updates, this must be adjusted manually.
version = "^1.0.0",
},
},
event = { "LspAttach" },
keys = {
{
"<leader>ff",
function()
require("telescope.builtin").find_files()
end,
desc = "Telescope find files",
},
{
"<leader>flg",
function()
require("telescope.builtin").live_grep()
end,
desc = "Telescope live grep",
},
{
"<leader>fu",
function()
require("telescope.builtin").lsp_references()
end,
desc = "Telescope Usage (references)",
},
{
"<leader>fg",
function()
require("telescope").extensions.live_grep_args.live_grep_args()
end,
desc = "Telescope live grep args",
},
{
"<leader>flg",
function()
require("telescope.builtin").live_grep()
end,
desc = "Telescope live grep",
},
{
"<leader>fb",
function()
require("telescope.builtin").buffers()
end,
desc = "Telescope buffers",
},
{
"<leader>fg",
function()
require("telescope").extensions.live_grep_args.live_grep_args()
end,
desc = "Telescope live grep args",
},
{
"<leader>fh",
function()
require("telescope.builtin").help_tags()
end,
desc = "Telescope nvim functions",
},
{
"<leader>fb",
function()
require("telescope.builtin").buffers()
end,
desc = "Telescope buffers",
},
{ "<leader>ft", ":TodoTelescope<CR>", desc = "Telescope TODOs" },
{
"<leader>fh",
function()
require("telescope.builtin").help_tags()
end,
desc = "Telescope nvim functions",
},
-- Git
{
"<leader>fld",
function()
require("telescope.builtin").git_status()
end,
desc = "Telescope git diff",
},
{ "<leader>ft", ":TodoTelescope<CR>", desc = "Telescope TODOs" },
{
"<leader>flc",
function()
require("telescope.builtin").git_commits()
end,
desc = "Telescope git commits",
},
-- Git
{
"<leader>fld",
function()
require("telescope.builtin").git_status()
end,
desc = "Telescope git diff",
},
{
"<leader>flf",
function()
require("telescope.builtin").git_files()
end,
desc = "Telescope git files",
},
{
"<leader>flc",
function()
require("telescope.builtin").git_commits()
end,
desc = "Telescope git commits",
},
-- Recent Commands
{ "<leader>foc", ":Telescope command_history<CR>", desc = "Telescope recent commands" },
{
"<leader>flf",
function()
require("telescope.builtin").git_files()
end,
desc = "Telescope git files",
},
-- Recent Searches
{ "<leader>fos", ":Telescope search_history<CR>", desc = "Telescope recent searches" },
-- Recent Commands
{ "<leader>foc", ":Telescope command_history<CR>", desc = "Telescope recent commands" },
-- Old Files
{
"<leader>fr",
function()
require("telescope.builtin").oldfiles()
end,
desc = "Telescope recent files",
},
-- Recent Searches
{ "<leader>fos", ":Telescope search_history<CR>", desc = "Telescope recent searches" },
-- Quickfix Items
{ "<leader>fq", ":Telescope quickfix<CR>", desc = "Telescope quickfix items" },
-- Old Files
{
"<leader>fr",
function()
require("telescope.builtin").oldfiles()
end,
desc = "Telescope recent files",
},
-- Spell Suggestions
{ "<leader>fs", ":Telescope spell_suggest<CR>", desc = "Telescope spellsuggestions" },
-- Quickfix Items
{ "<leader>fq", ":Telescope quickfix<CR>", desc = "Telescope quickfix items" },
-- Diagnostics
{ "<leader>fd", ":Telescope diagnostics<CR>", desc = "Telescope Diagnostics" },
-- Spell Suggestions
{ "<leader>fs", ":Telescope spell_suggest<CR>", desc = "Telescope spellsuggestions" },
-- Notifications
{ "<leader>fn", ":Telescope notify<CR>", desc = "Telescope Notifications" },
-- Diagnostics
{ "<leader>fd", ":Telescope diagnostics<CR>", desc = "Telescope Diagnostics" },
-- Implementations
{ "<leader>fi", ":Telescope lsp_implementations<CR>", desc = "Telescope lsp implementations" },
},
config = function()
local actions = require("telescope.actions")
local telescope = require("telescope")
local lga_actions = require("telescope-live-grep-args.actions")
-- Notifications
{ "<leader>fn", ":Telescope notify<CR>", desc = "Telescope Notifications" },
telescope.setup({
defaults = {
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.smart_add_to_qflist,
["<C-A-q>"] = actions.smart_send_to_qflist,
["<C-Space>"] = lga_actions.quote_prompt(),
},
},
path_display = { "truncate" },
},
extensions = {
frecency = {
db_safe_mode = false,
matcher = "fuzzy",
},
},
})
-- Implementations
{ "<leader>fi", ":Telescope lsp_implementations<CR>", desc = "Telescope lsp implementations" },
telescope.load_extension("live_grep_args")
end,
-- References
{
"<leader>fu",
function()
require("telescope.builtin").lsp_references()
end,
desc = "Telescope Usage (references)",
},
},
config = function()
local actions = require("telescope.actions")
local telescope = require("telescope")
local lga_actions = require("telescope-live-grep-args.actions")
telescope.setup({
defaults = {
mappings = {
i = {
["<C-j>"] = actions.move_selection_next,
["<C-k>"] = actions.move_selection_previous,
["<C-q>"] = actions.smart_add_to_qflist,
["<C-A-q>"] = actions.smart_send_to_qflist,
["<C-Space>"] = lga_actions.quote_prompt(),
},
},
path_display = { "truncate" },
},
extensions = {
frecency = {
db_safe_mode = false,
matcher = "fuzzy",
},
},
})
telescope.load_extension("live_grep_args")
end,
}