From e92a7ee2c5bef26ad7a2dec3f52c1127fa9bcaf2 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Thu, 11 Jan 2024 21:45:14 +0100 Subject: [PATCH] make Telescope grep hidden files --- README.md | 8 +++++++ lua/plugins/nvim-telescope.lua | 40 +++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b99555..c4b9b17 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,14 @@ All that is saved in image, so that is why image is so heavy. |Ctrl+v | Open selection as a vsplit| |Ctrl+t | Open selection in new tab | +##### Usefull Telescope commands + +Find files including hidden + +```bash +Telescope find_files hidden=true +``` + #### Markdown Preview Mardkown Preview plugin commands: diff --git a/lua/plugins/nvim-telescope.lua b/lua/plugins/nvim-telescope.lua index b00bdc0..12b1741 100644 --- a/lua/plugins/nvim-telescope.lua +++ b/lua/plugins/nvim-telescope.lua @@ -5,5 +5,43 @@ return { vim.keymap.set('n', 'fg', builtin.live_grep, {}) vim.keymap.set('n', 'fb', builtin.buffers, {}) vim.keymap.set('n', 'fh', builtin.help_tags, {}) - end + require('telescope').setup { + defaults = { + vimgrep_arguments = { + 'rg', + '--color=never', + '--no-heading', + '--with-filename', + '--line-number', + '--column', + '--smart-case', + '--no-ignore', + '--hidden', + '--glob', + '!{**/.git/*,**/node_modules/*,**/package-lock.json,**/yarn.lock}', + }, + } } + end, + opts = { + --defaults = { + --vimgrep_arguments = { + --'rg', + --'--color=never', + --'--no-heading', + --'--with-filename', + --'--line-number', + --'--column', + --'--smart-case', + --'--no-ignore', + ----'--hidden', + --} + --}, + pickers = { + live_grep = { + additional_args = function(opts) + return { "--hidden" } + end + }, + }, + } }