dotfiles/modules/editor/neovim/lua/packer/telescope.lua

86 lines
2.5 KiB
Lua
Raw Normal View History

2022-07-09 21:27:04 +00:00
-- =======================================================================
-- 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 = {},
2022-07-10 17:54:21 +00:00
-- tmux = {},
2022-07-09 21:27:04 +00:00
zoxide = {},
project = {
base_dirs = { "~/dev" },
},
},
})
end,
})
-- Faster sorting
use("nvim-telescope/telescope-fzy-native.nvim")
-- Jump around tmux sessions
2022-07-10 17:54:21 +00:00
-- use("camgraff/telescope-tmux.nvim")
2022-07-09 21:27:04 +00:00
-- 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")
2022-07-10 14:15:41 +00:00
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)
2022-07-09 21:27:04 +00:00
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