diff --git a/home/.config/nvim/lua/plugs/catppuccin.lua b/home/.config/nvim/lua/plugs/catppuccin.lua index 58c96e7..dbe841a 100644 --- a/home/.config/nvim/lua/plugs/catppuccin.lua +++ b/home/.config/nvim/lua/plugs/catppuccin.lua @@ -1,7 +1,8 @@ local function add_new_custom_highlights() local colors = require("catppuccin.palettes.macchiato"); local highlights = { - { name = "EdgeTool", config = { bg = colors.mantle, fg = colors.text } }, + { name = "EdgeTool", config = { bg = colors.mantle, fg = colors.text } }, + { name = "EdgeToolBorder", config = { bg = colors.mantle, fg = colors.lavender } }, } for _, highlight in ipairs(highlights) do @@ -32,9 +33,9 @@ return { mason = true, semantic_tokens = true, treesitter_context = true, - -- telescope = { -- This doesn't seem to be compatible when running the custom dropdown theme - -- enable = true - -- }, + telescope = { -- This doesn't seem to be compatible when running the custom dropdown theme + enable = true + }, cmp = true, dap_ui = true, dap = true, @@ -55,6 +56,16 @@ return { Pmenu = { link = "EdgeTool" }, PmenuSel = { bg = colors.overlay0 }, + + -- Telescope + TelescopeNormal = { link = "EdgeTool" }, + TelescopeBorder = { link = "EdgeToolBorder" }, + TelescopePromptNormal = { link = "EdgeTool" }, + TelescopePromptBorder = { link = "EdgeToolBorder" }, + TelescopeResultsNormal = { link = "EdgeTool" }, + TelescopeResultsBorder = { link = "EdgeToolBorder" }, + TelescopePreviewNormal = { link = "EdgeTool" }, + TelescopePreviewBorder = { link = "EdgeToolBorder" }, } end }) diff --git a/home/.config/nvim/lua/plugs/telescope.lua b/home/.config/nvim/lua/plugs/telescope.lua index 2baa38d..da3b0c5 100644 --- a/home/.config/nvim/lua/plugs/telescope.lua +++ b/home/.config/nvim/lua/plugs/telescope.lua @@ -5,116 +5,59 @@ return { "nvim-telescope/telescope-fzf-native.nvim", }, config = function() - local actions = require("telescope.actions") - require("telescope").setup({ - pickers = { - buffers = { - mappings = { - i = { - [""] = actions.select_drop, - }, - n = { - [""] = actions.select_drop, - } - } - }, - find_files = { - mappings = { - i = { - [""] = actions.select_drop, - }, - n = { - [""] = actions.select_drop, - } - } - }, - git_files = { - mappings = { - i = { - [""] = actions.select_drop, - }, - n = { - [""] = actions.select_drop, - } - } - }, - old_files = { - mappings = { - i = { - [""] = actions.select_drop, - }, - n = { - [""] = actions.select_drop, - } - } - }, - } - }) - require("telescope").load_extension("fzf") - - local dropdown_theme = require('telescope.themes').get_dropdown({ - -- results_height = 50, - width = 0.2, - winblend = 20, - prompt_title = "", + local dropdown = require("telescope.themes").get_dropdown({ borderchars = { - { "", "", "", "", "", "", "", "" }, - prompt = { "", "", "", "", "", "", "", "" }, - results = { "", "", "", "", "", "", "", "" }, - preview = { "", "", "", "", "", "", "", "" }, - } + prompt = { "─", "│", "─", "│", "┌", "┐", "┘", "└" }, + results = { "─", "│", "─", "│", "├", "┤", "┘", "└" }, + preview = { "─", "│", "─", "│", "┌", "┐", "┘", "└" }, + }, + prompt_title = "", + winblend = 20 }) + require("telescope").setup({ + extensions = { + fzf = { + fuzzy = true, + override_generic_sorter = false, + override_file_sorter = true, + case_mode = "smart_case", + }, + }, + }) + + require("telescope").load_extension("fzf") local builtin = require("telescope.builtin") require("utils").add_keymaps({ n = { - -- File search ["to"] = { cmd = function() - dropdown_theme.prompt_prefix = "Files>" - dropdown_theme.previewer = false - dropdown_theme.find_command = nil - builtin.find_files(dropdown_theme) - end, + builtin.find_files(vim.tbl_extend("force", dropdown, { + prompt_prefix = "Files> ", + previewer = false, + })) + end }, ["tf"] = { cmd = function() - dropdown_theme.prompt_prefix = "Find>" - dropdown_theme.previewer = true - dropdown_theme.find_command = nil - builtin.current_buffer_fuzzy_find(dropdown_theme) - end, + builtin.current_buffer_fuzzy_find(vim.tbl_extend("force", dropdown, { + prompt_prefix = "Find> " + })) + end }, ["ta"] = { - -- cmd = ":lua require('telescope.builtin').live_grep({find_command=rg,--ignore-file,.gitignore,--exclude,*.git,--exclude,*.svn,--exclude,*.vs,--exclude,*.idea}) ", cmd = function() - dropdown_theme.prompt_prefix = "Grep>" - dropdown_theme.previewer = true - dropdown_theme.find_command = { - find_command = "rg", - "--ignore-file", - ".gitignore", - "--exclude", - "*.git", - "--exclude", - "*.svn", - "--exclude", - "*.vs", - "--exclude", - "*.idea", - } - - builtin.live_grep(dropdown_theme) - end, + builtin.live_grep(vim.tbl_extend("force", dropdown, { + prompt_prefix = "Grep> " + })) + end }, - -- Misc ["tb"] = { cmd = function() - dropdown_theme.prompt_prefix = "Marks>" - dropdown_theme.previewer = true - dropdown_theme.find_command = nil - builtin.marks(dropdown_theme) - end, + builtin.marks(vim.tbl_extend("force", dropdown, { + prompt_prefix = "Marks> " + })) + end } } })