mirror of
https://github.com/don-philipe/dotfiles.git
synced 2025-11-08 14:47:03 +01:00
Search hidden files with telescope
This commit is contained in:
@@ -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:
|
-- 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)
|
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({
|
require('telescope').setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
|
vimgrep_arguments = vimgrep_arguments,
|
||||||
layout_strategy = 'vertical',
|
layout_strategy = 'vertical',
|
||||||
layout_config = {
|
layout_config = {
|
||||||
vertical = { width = 0.95 }
|
vertical = { width = 0.95 }
|
||||||
|
|||||||
Reference in New Issue
Block a user