From 1a6c63949b8e860821f44d8c9b37aaab7daf0fd5 Mon Sep 17 00:00:00 2001 From: OdysseusOperator Date: Fri, 28 Mar 2025 13:28:50 +0100 Subject: [PATCH] feat(telescope): add mappings for specific symbol types in LSP This commit introduces new key mappings for Telescope to filter document symbols by specific types such as methods, variables, and classes, enhancing the navigation experience by allowing users to efficiently find and access relevant code structures. --- init.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/init.lua b/init.lua index 20105567..28b20050 100644 --- a/init.lua +++ b/init.lua @@ -554,6 +554,21 @@ require('lazy').setup({ -- Symbols are things like variables, functions, types, etc. map('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + map('dm', function() + require('telescope.builtin').lsp_document_symbols { + symbols = { 'function', 'method' }, -- Sets the query to 'method' + } + end, '[D]ocument [M]ethods') + map('dv', function() + require('telescope.builtin').lsp_document_symbols { + symbols = 'variable', -- Sets the query to 'method' + } + end, '[D]ocument [V]ariable') + map('dc', function() + require('telescope.builtin').lsp_document_symbols { + symbols = 'class', -- Sets the query to 'method' + } + end, '[D]ocument [C]lass') -- Fuzzy find all the symbols in your current workspace. -- Similar to document symbols, except searches over your entire project. map('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')