nvim-kickstart/lua/custom/telescope.lua

46 lines
1.2 KiB
Lua

-- import telescope plugin safely
local telescope_setup, telescope = pcall(require, "telescope")
if not telescope_setup then
return
end
-- import telescope actions safely
local actions_setup, actions = pcall(require, "telescope.actions")
if not actions_setup then
return
end
-- configure telescope
telescope.setup({
-- configure custom mappings
defaults = {
mappings = {
i = {
["<C-k>"] = actions.move_selection_previous, -- move to prev result
["<C-j>"] = actions.move_selection_next, -- move to next result
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist, -- send selected to quickfixlist
},
},
},
})
telescope.load_extension("fzf")
telescope.load_extension("project")
telescope.load_extension("harpoon")
telescope.load_extension("persisted")
require('file_history').setup {
-- This is the location where it will create your file history repository
backup_dir = "~/.file-history-git",
-- command line to execute git
git_cmd = "git"
}
telescope.load_extension('file_history')
-- telescope.load_extension("dap")
vim.api.nvim_set_keymap(
"n",
"<C-p>",
":lua require'telescope'.extensions.project.project{}<CR>",
{ noremap = true, silent = true }
)