Search hidden files with telescope

This commit is contained in:
don philipe
2025-05-14 10:11:37 +02:00
parent 6a710bac5f
commit 3e51152da9

View File

@@ -7,8 +7,18 @@ vim.keymap.set('n', '<leader>ft', builtin.treesitter, { desc = 'Telescope treesi
-- find selected text in visual mode with Ctrl-f via telescope:
vim.keymap.set('v', '<C-f>', 'y<ESC>:Telescope live_grep default_text=<C-r>0<CR>', default_opts)
-- grep hidden files as well
local telescopeConfig = require("telescope.config")
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
-- I want to search in hidden/dot files.
table.insert(vimgrep_arguments, "--hidden")
-- I don't want to search in the `.git` directory.
table.insert(vimgrep_arguments, "--glob")
table.insert(vimgrep_arguments, "!**/.git/*")
require('telescope').setup({
defaults = {
vimgrep_arguments = vimgrep_arguments,
layout_strategy = 'vertical',
layout_config = {
vertical = { width = 0.95 }