From 8c5112b19f59e06606ff4f3bfbc3519475308ca6 Mon Sep 17 00:00:00 2001 From: Fabio Lenherr / DashieTM Date: Tue, 21 Nov 2023 20:15:17 +0100 Subject: [PATCH] feat: Make preview in picker dynamic --- copyq/copyq.conf | 4 ++-- nvim/lua/plugins/cmp.lua | 8 +++++--- nvim/lua/plugins/plugins.lua | 15 ++++++++++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/copyq/copyq.conf b/copyq/copyq.conf index 40d0c85..2430b72 100644 --- a/copyq/copyq.conf +++ b/copyq/copyq.conf @@ -6,7 +6,7 @@ activate_closes=true activate_focuses=true activate_item_with_single_click=true activate_pastes=true -always_on_top=false +always_on_top=true autocompletion=true autostart=false change_clipboard_owner_delay_ms=150 @@ -19,7 +19,7 @@ close_on_unfocus_delay_ms=500 command_history_size=100 confirm_exit=true copy_clipboard=false -copy_selection=false +copy_selection=true disable_tray=false edit_ctrl_return=true editor=gedit --standalone -- %1 diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua index d227b4b..9d2019c 100644 --- a/nvim/lua/plugins/cmp.lua +++ b/nvim/lua/plugins/cmp.lua @@ -35,7 +35,9 @@ return { { "roobert/tailwindcss-colorizer-cmp.nvim", config = true }, }, opts = function() + vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) local cmp = require("cmp") + local defaults = require("cmp.config.default")() local luasnip = require("luasnip") local compare = require("cmp.config.compare") return { @@ -60,14 +62,14 @@ return { }), -- Accept cur [""] = cmp.mapping(function(fallback) if cmp.visible() then - cmp.select_next_item() + cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert }) else fallback() end end, { "i", "s" }), [""] = cmp.mapping(function(fallback) if cmp.visible() then - cmp.select_prev_item() + cmp.select_prev_item({ behavior = cmp.SelectBehavior.Insert }) else fallback() end @@ -126,7 +128,7 @@ return { }, experimental = { ghost_text = { - hl_group = "LspCodeLens", + hl_group = "CmpGhostText", }, }, } diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua index b830e0b..d0ee7d6 100644 --- a/nvim/lua/plugins/plugins.lua +++ b/nvim/lua/plugins/plugins.lua @@ -14,9 +14,18 @@ return { keys = function() return {} end, - config = function(opts) - require("telescope").setup(opts) - end, + opts = { + defaults = { + layout_strategy = "flex", + layout_config = { + height = 0.95, + width = 0.95, + flip_columns = 100, + vertical = { preview_height = 0.5, preview_cutoff = 5 }, + horizontal = { preview_width = 0.7, preview_cutoff = 99 }, + }, + }, + }, }, { "ThePrimeagen/harpoon",