From 653f44935a31a5c4de82d8f626c3906117a6abc2 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 24 Oct 2025 06:19:33 +0200 Subject: [PATCH] feat(nvim): rice telescope --- nvim/.config/nvim/lua/plugins/telescope.lua | 82 ++++++++++++++------- 1 file changed, 57 insertions(+), 25 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 279ace9..de827a7 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -1,27 +1,59 @@ return { - 'nvim-telescope/telescope.nvim', branch = '0.1.x', - dependencies = { 'nvim-lua/plenary.nvim' }, - opts = { - defaults = { - file_ignore_patterns = { "**/*.pdf" }, - layout_strategy = "horizontal", - layout_config = { prompt_position = "top" }, - sorting_strategy = "ascending", - winblend = 0, - }, - }, - keys = { - {"ff", "Telescope find_files", desc = "Find files"}, - {"fe", "Telescope git_files", desc = "Find file respecting .gitignore"}, - {"fg", "Telescope live_grep", desc = "Grep file in file"}, - {"fb", "Telescope buffers", desc = "Search through buffers"}, - {"ft", "Telescope tags", desc = "Search through tags"}, - {"fm", "Telescope marks", desc = "Search through marks"}, - {"fs", "Telescope search_history", desc = "Search through search"}, - }, - config = function() - require('telescope').setup( - - ) - end + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + defaults = { + file_ignore_patterns = { "**/*.pdf" }, + layout_strategy = "horizontal", + layout_config = { + horizontal = { + prompt_position = "top", + preview_width = 0.55, + }, + width = 0.87, + height = 0.80, + preview_cutoff = 120, + }, + sorting_strategy = "ascending", + borderchars = { "█", "█", "█", "█", "█", "█", "█", "█" }, + prompt_prefix = " 🔍 ", + selection_caret = " ➜ ", + entry_prefix = " ", + winblend = 0, + results_title = "", + prompt_title = "", + preview_title = "", + mappings = { + i = { + [""] = require("telescope.actions").delete_buffer, + }, + n = { + [""] = require("telescope.actions").delete_buffer, + }, + }, + }, + }, + config = function(_, opts) + require("telescope").setup(opts) + vim.api.nvim_set_hl(0, "TelescopeNormal", { bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopePromptNormal", { bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopeResultsNormal", { bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopePreviewNormal", { bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopePromptBorder", { fg = "#3c3836", bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopeResultsBorder", { fg = "#3c3836", bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopePreviewBorder", { fg = "#3c3836", bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopePromptTitle", { fg = "#3c3836", bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopeResultsTitle", { fg = "#3c3836", bg = "#3c3836" }) + vim.api.nvim_set_hl(0, "TelescopePreviewTitle", { fg = "#3c3836", bg = "#3c3836" }) + end, + keys = { + { "ff", "Telescope find_files", desc = "Find files" }, + { "fe", "Telescope git_files", desc = "Find file respecting .gitignore" }, + { "fg", "Telescope live_grep", desc = "Grep file in file" }, + { "fb", "Telescope buffers", desc = "Search through buffers" }, + { "ft", "Telescope tags", desc = "Search through tags" }, + { "fm", "Telescope marks", desc = "Search through marks" }, + { "fs", "Telescope search_history", desc = "Search through search" }, + }, }