diff --git a/lua/weeheavy/plugins/telescope.lua b/lua/weeheavy/plugins/telescope.lua index 589e38c..4e7a7a5 100644 --- a/lua/weeheavy/plugins/telescope.lua +++ b/lua/weeheavy/plugins/telescope.lua @@ -1,47 +1,47 @@ -- Telescope return { - "nvim-telescope/telescope.nvim", tag = "0.1.4", - dependencies = { - { "nvim-lua/plenary.nvim" } - }, - config = function(lazy, opts) - local telescope = require('telescope') - telescope.load_extension('fzf') - telescope.setup({ - defaults = { - sorting_strategy = "ascending", - wrap_result = true, - --[[ - mappings = { - i = { - [""] = require("telescope.actions").close, - -- search history - [""] = require('telescope.actions').cycle_history_next, - [""] = require('telescope.actions').cycle_history_prev, - }, - }, - --]] - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.4, - width = 0.9, - preview_cutoff = 10, - } + "nvim-telescope/telescope.nvim", tag = "0.1.4", + dependencies = { + { "nvim-lua/plenary.nvim" } + }, + config = function(lazy, opts) + local telescope = require('telescope') + telescope.load_extension('fzf') + telescope.setup({ + defaults = { + sorting_strategy = "ascending", + wrap_result = true, + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.4, + width = 0.9, + preview_cutoff = 10, } - }, - pickers = { - find_files = { - hidden = true - }, - -- note: remove the 'builtin.' prefix. - ["lsp_references"] = { wrap_results = true, }, - ["lsp_definitions"] = { wrap_results = true, }, - ["diagnostics"] = { wrap_results = true, }, - ["find_files"] = { wrap_results = true, }, - ["buffers"] = { sort_mru = true, ignore_current_buffer = true }, } - }) - end, + }, + pickers = { + find_files = { + hidden = true + }, + live_grep = { + additional_args = function() + return { '--hidden', '--glob', '!**/.git/*' } + end + }, + grep_string = { + additional_args = function() + return { '--hidden', '--glob', '!**/.git/*' } + end + }, + -- note: remove the 'builtin.' prefix. + ["lsp_references"] = { wrap_results = true, }, + ["lsp_definitions"] = { wrap_results = true, }, + ["diagnostics"] = { wrap_results = true, }, + ["find_files"] = { wrap_results = true, }, + ["buffers"] = { sort_mru = true, ignore_current_buffer = true }, + } + }) + end, } diff --git a/lua/weeheavy/remap.lua b/lua/weeheavy/remap.lua index 8239208..f3e921c 100644 --- a/lua/weeheavy/remap.lua +++ b/lua/weeheavy/remap.lua @@ -6,5 +6,10 @@ vim.g.mapleader = " " vim.keymap.set("n", "r", vim.cmd.Ex, { noremap = true, desc = "netrw File Browser" }) -- netrw file explorer -- Telescope -vim.keymap.set("n", "e", ":Telescope file_browser", { noremap = true, desc = "Telescope Browser" }) -vim.keymap.set("n", "f", ":Telescope find_files", { noremap = true, desc = "Telescope File Search" }) +vim.keymap.set("n", "e", ":Telescope file_browser", { noremap = true, desc = "File/Directory browser" }) +vim.keymap.set("n", "ff", ":Telescope find_files hidden=true no_ignore=false ", { noremap = true, desc = "File search" }) +vim.keymap.set("n", "fg", ":Telescope live_grep", { noremap = true, desc = "Live grep through all files" }) +vim.keymap.set("n", "fb", ":Telescope buffers", { noremap = true, desc = "Buffers" }) +vim.keymap.set("n", "gst", ":Telescope git_status", { noremap = true, desc = "Git status" }) +vim.keymap.set("n", "gla", ":Telescope git_commits", { noremap = true, desc = "Git log (across all files)" }) +vim.keymap.set("n", "glf", ":Telescope git_bcommits", { noremap = true, desc = "Git log (this file)" })