Files
my-nvim/lua/crentist/lazy/telescope.lua

46 lines
1.6 KiB
Lua

return {
"FabianWirth/search.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
version = "0.1.6",
config = function()
require('telescope').setup({})
local search = require('search')
local builtin = require('telescope.builtin')
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 })
end)
vim.keymap.set('n', '<leader>pWs', function()
local word = vim.fn.expand("<cWORD>")
builtin.grep_string({ search = word })
end)
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end)
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
end
}