telescope: ignore .git but search hidden files
This commit is contained in:
parent
c60cf314be
commit
fa0d4ffd8f
@ -117,6 +117,18 @@ return {
|
|||||||
if not ok then require "telescope.builtin".find_files(opts) end
|
if not ok then require "telescope.builtin".find_files(opts) end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local telescopeConfig = require("telescope.config")
|
||||||
|
|
||||||
|
-- Clone the default Telescope configuration
|
||||||
|
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 = {
|
||||||
mappings = {
|
mappings = {
|
||||||
@ -126,6 +138,8 @@ return {
|
|||||||
['<C-q>'] = actions.smart_send_to_qflist,
|
['<C-q>'] = actions.smart_send_to_qflist,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
-- `hidden = true` is not supported in text grep commands.
|
||||||
|
vimgrep_arguments = vimgrep_arguments,
|
||||||
},
|
},
|
||||||
pickers = {
|
pickers = {
|
||||||
-- Your special builtin config goes in here
|
-- Your special builtin config goes in here
|
||||||
@ -145,6 +159,8 @@ return {
|
|||||||
find_files = {
|
find_files = {
|
||||||
theme = 'ivy',
|
theme = 'ivy',
|
||||||
previewer = false,
|
previewer = false,
|
||||||
|
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
|
||||||
|
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
|
||||||
},
|
},
|
||||||
oldfiles = {
|
oldfiles = {
|
||||||
theme = 'ivy',
|
theme = 'ivy',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user