Squashed 'users/daniel/configs/system/nvim/nvim/' content from commit f10b473
git-subtree-dir: users/daniel/configs/system/nvim/nvim git-subtree-split: f10b4730176b567e15911b3c1a7c5a31c82c8b8e
This commit is contained in:
50
lua/plugins/telescope.lua
Normal file
50
lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", enabled = vim.fn.executable "make" == 1, build = "make" },
|
||||
},
|
||||
cmd = "Telescope",
|
||||
opts = function()
|
||||
local actions = require "telescope.actions"
|
||||
local get_icon = require("astronvim.utils").get_icon
|
||||
local 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 },
|
||||
}
|
||||
-- HACK: remove after Telescope mode issue is resolved: https://github.com/nvim-telescope/telescope.nvim/issues/2501
|
||||
if vim.fn.has "nvim-0.10" == 1 then
|
||||
for _, key in ipairs { "<CR>", "<C-x>", "<C-v>", "<C-t>", "<C-q>", "<M-q>" } do
|
||||
mappings.i[key] = function()
|
||||
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>" .. key, true, false, true), "i", false)
|
||||
end
|
||||
end
|
||||
end
|
||||
return {
|
||||
defaults = {
|
||||
prompt_prefix = get_icon("Selected", 1),
|
||||
selection_caret = get_icon("Selected", 1),
|
||||
path_display = { "truncate" },
|
||||
sorting_strategy = "ascending",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
},
|
||||
vertical = {
|
||||
mirror = false,
|
||||
},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
mappings = mappings,
|
||||
},
|
||||
}
|
||||
end,
|
||||
config = require "plugins.configs.telescope",
|
||||
}
|
||||
Reference in New Issue
Block a user