1
0

Compare commits

..

No commits in common. "735f28b62dd8de73f94798fdb9ae2f3c5660a51d" and "e8eb13207d124a4d89ee33b5434cae3fcb4fdf29" have entirely different histories.

2 changed files with 2 additions and 20 deletions

View File

@ -40,7 +40,7 @@
"render-markdown.nvim": { "branch": "main", "commit": "75a0a9596a91130fae43d3b7c0d6c651645ef1df" }, "render-markdown.nvim": { "branch": "main", "commit": "75a0a9596a91130fae43d3b7c0d6c651645ef1df" },
"resession.nvim": { "branch": "master", "commit": "c4d92a57b3936a2d6e1c087dbd6b670da2b1b082" }, "resession.nvim": { "branch": "master", "commit": "c4d92a57b3936a2d6e1c087dbd6b670da2b1b082" },
"statuscol.nvim": { "branch": "main", "commit": "1022f922b77b44c36f8057ac29adbfd89ce86958" }, "statuscol.nvim": { "branch": "main", "commit": "1022f922b77b44c36f8057ac29adbfd89ce86958" },
"telescope.nvim": { "branch": "master", "commit": "b324469959908c1c7434eb65d80e87895e6828f7" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
"vim-wakatime": { "branch": "master", "commit": "f699e30ca1ba0c7f316847316fd0ba19d3ee51c1" }, "vim-wakatime": { "branch": "master", "commit": "f699e30ca1ba0c7f316847316fd0ba19d3ee51c1" },
"which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" } "which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" }

View File

@ -1,5 +1,6 @@
local spec = { local spec = {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
branch = "0.1.x",
} }
spec.dependencies = { spec.dependencies = {
@ -14,9 +15,6 @@ spec.keys = {
{ "<Leader>fc", "<cmd>Telescope git_status<CR>", desc = "Find changed files" }, { "<Leader>fc", "<cmd>Telescope git_status<CR>", desc = "Find changed files" },
} }
-- Not sure where in the state this is stored, so just track it here
local find_files_show_hidden = false
spec.config = function() spec.config = function()
local telescope = require("telescope") local telescope = require("telescope")
local builtin = require("telescope.builtin") local builtin = require("telescope.builtin")
@ -46,26 +44,12 @@ spec.config = function()
end end
end end
-- Very primitive solution, but good enough for now
local function toggle_hidden(bufnr)
local state = require("telescope.actions.state")
local current_picker = state.get_current_picker(bufnr)
local current_prompt = get_current_prompt(current_picker)
find_files_show_hidden = not find_files_show_hidden
builtin.find_files({ default_text = current_prompt, hidden = find_files_show_hidden })
end
local find_prompt_prefix = "🔍";
telescope.setup({ telescope.setup({
defaults = { defaults = {
initial_mode = "insert" initial_mode = "insert"
}, },
pickers = { pickers = {
buffers = { buffers = {
prompt_prefix = find_prompt_prefix,
mappings = { mappings = {
i = { i = {
["<C-d>"] = actions.delete_buffer + actions.move_to_top, ["<C-d>"] = actions.delete_buffer + actions.move_to_top,
@ -77,11 +61,9 @@ spec.config = function()
} }
}, },
find_files = { find_files = {
prompt_prefix = find_prompt_prefix,
mappings = { mappings = {
i = { i = {
["<C-f>"] = cycle_picker, ["<C-f>"] = cycle_picker,
["<C-h>"] = toggle_hidden,
} }
} }
} }