20 lines
802 B
Lua
20 lines
802 B
Lua
local builtin = require('telescope.builtin')
|
|
|
|
-- 1. Search for words across all files (Project-wide grep)
|
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, { desc = 'Find by Grep' })
|
|
|
|
-- 2. General File Search
|
|
vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = 'Find Files' })
|
|
|
|
-- 3. Targeted Struct/Model Search
|
|
-- This opens Telescope filtered specifically to your models.zig file
|
|
vim.keymap.set('n', '<leader>fm', function()
|
|
builtin.live_grep({
|
|
search_dirs = { "src/models.zig" }, -- Adjust path if necessary
|
|
prompt_title = "Search Structs in Models",
|
|
})
|
|
end, { desc = 'Search in models.zig' })
|
|
|
|
-- 4. LSP Symbol Search (Great for finding structs in the current file)
|
|
vim.keymap.set('n', '<leader>fs', builtin.lsp_document_symbols, { desc = 'Find Symbols' })
|