[telescope] remove gitfiles from the default files tab

This commit is contained in:
2024-06-08 18:52:15 +03:00
parent 51b38e8245
commit 1a2bb7dce6
2 changed files with 25 additions and 9 deletions

View File

@@ -1,18 +1,34 @@
return {
"nvim-telescope/telescope.nvim",
"FabianWirth/search.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
version = "0.1.6",
dependencies = {
"nvim-lua/plenary.nvim"
},
config = function()
require('telescope').setup({})
local search = require('search')
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
search.setup({
mappings = { -- optional: configure the mappings for switching tabs (will be set in normal and insert mode(!))
next = '<Tab>',
prev = '<S-Tab>'
},
append_tabs = { -- append_tabs will add the provided tabs to the default ones
{
'Commits', -- or name = "Commits"
builtin.git_commits, -- or tele_func = require('telescope.builtin').git_commits
available = function() -- optional
return vim.fn.isdirectory('.git') == 1
end
},
},
})
vim.keymap.set('n', '<leader>pf', search.open, {})
vim.keymap.set('n', '<leader>pws', function()
local word = vim.fn.expand("<cword>")
builtin.grep_string({ search = word })
@@ -27,4 +43,3 @@ return {
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
end
}