dotfiles/modules/editor/neovim/lua/packer/telescope.lua
2022-07-10 17:54:21 +00:00

86 lines
2.5 KiB
Lua

-- =======================================================================
-- Fuzzy Launcher
-- =======================================================================
local M = {}
M.packer = function(use)
use({
"nvim-telescope/telescope.nvim",
branch = "master",
requires = { "nvim-lua/plenary.nvim" },
config = function()
-- Telescope: quit instantly with escape
local actions = require("telescope.actions")
require("telescope").setup({
defaults = {
mappings = {
i = {
["<esc>"] = actions.close,
["<C-h>"] = "which_key",
},
},
},
pickers = {
find_files = { theme = "ivy" },
oldfiles = { theme = "ivy" },
buffers = { theme = "dropdown" },
},
extensions = {
fzy_native = {},
-- tmux = {},
zoxide = {},
project = {
base_dirs = { "~/dev" },
},
},
})
end,
})
-- Faster sorting
use("nvim-telescope/telescope-fzy-native.nvim")
-- Jump around tmux sessions
-- use("camgraff/telescope-tmux.nvim")
-- Jump directories
use({
"jvgrootveld/telescope-zoxide",
requires = { "nvim-lua/popup.nvim" },
})
-- Jump projects
use({
"nvim-telescope/telescope-project.nvim",
requires = { "nvim-telescope/telescope.nvim" },
config = function()
require("telescope").load_extension("project")
choose_project = function()
local opts = require("telescope.themes").get_ivy({
layout_config = {
bottom_pane = {
height = 10,
},
},
})
require("telescope").extensions.project.project(opts)
end
vim.keymap.set("n", "<C-p>", choose_project)
end,
})
-- File browser
use({
"nvim-telescope/telescope-file-browser.nvim",
requires = { "nvim-telescope/telescope.nvim" },
config = function()
require("telescope").load_extension("file_browser")
end,
})
end
return M