Initial work on massive refactor
This commit is contained in:
parent
b4f1a4f441
commit
c01b7077ff
28 changed files with 717 additions and 530 deletions
.config/nvim/lua/plugins/misc
47
.config/nvim/lua/plugins/misc/telescope.lua
Normal file
47
.config/nvim/lua/plugins/misc/telescope.lua
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
local M = { "nvim-telescope/telescope.nvim" }
|
||||
local icons = require("config.icons")
|
||||
|
||||
M.dependencies = { "telescope-fzf-native.nvim" }
|
||||
|
||||
M.cmd = "Telescope"
|
||||
|
||||
local opts = function()
|
||||
local actions = require("telescope.actions")
|
||||
return {
|
||||
defaults = {
|
||||
git_worktrees = vim.g.git_worktrees,
|
||||
prompt_prefix = icons.Selected,
|
||||
path_display = { "truncate" },
|
||||
sorting_startegy = "ascending",
|
||||
layout_config = {
|
||||
horizontal = { prompt_position = "top", preview_width = 0.5 },
|
||||
vertical = { mirror = false },
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-n>"] = actions.cycle_history_next,
|
||||
["<C-p>"] = actions.cycle_history_prev,
|
||||
["<C-j>"] = actions.move_selection_next,
|
||||
["<C-k>"] = actions.move_selection_previous,
|
||||
},
|
||||
n = { q = actions.close },
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
M.config = function()
|
||||
local telescope = require("telescope")
|
||||
telescope.setup(opts())
|
||||
if pcall(require, "aerial") then
|
||||
telescope.load_extension("aerial")
|
||||
end
|
||||
if require("funcs").is_available("telescope-fzf-native.nvim") then
|
||||
telescope.load_extension("fzf")
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue