From f01193b94522f09e29ab3fdf3157ec9547e528ed Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Tue, 18 Jul 2023 01:31:44 +0200 Subject: [PATCH] vim/telescope: make buffers, colorscheme, and spell_suggest not full screen --- config/nvim/lua/user/plugins/telescope.lua | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/config/nvim/lua/user/plugins/telescope.lua b/config/nvim/lua/user/plugins/telescope.lua index 6728c80..e151a50 100644 --- a/config/nvim/lua/user/plugins/telescope.lua +++ b/config/nvim/lua/user/plugins/telescope.lua @@ -45,7 +45,6 @@ local config = function() -- ╰────────╯ layout_strategy = 'flex', layout_config = { - anchor = 'center', width = 0.9, height = 0.9, flex = { flip_columns = 130 }, @@ -60,6 +59,7 @@ local config = function() }, } + local themes = require 'telescope.themes' local builtin = require 'telescope.builtin' local custom = { @@ -71,10 +71,16 @@ local config = function() })) end, + buffers = function(opts) + builtin.buffers(themes.get_dropdown(vim.tbl_extend('keep', opts or {}, { + previewer = false, + }))) + end, + colorschemes = function(opts) - builtin.colorscheme(vim.tbl_extend('keep', opts or {}, { + builtin.colorscheme(themes.get_dropdown(vim.tbl_extend('keep', opts or {}, { enable_preview = true, - })) + }))) end, dotfiles = function(opts) @@ -92,6 +98,10 @@ local config = function() } end, + spell_suggest = function(opts) + builtin.spell_suggest(themes.get_cursor(opts)) + end, + here = function(opts) builtin.current_buffer_fuzzy_find(opts) end, } @@ -111,7 +121,7 @@ local config = function() -- ╰────╯ ╰──────╯ ╰────────────╯ ╰───────────────────╯ n = { { 'a', builtin.autocommands , ' Autocommands' , '[a]utocommands' }, - { 'b', builtin.buffers , ' Buffers' , '[b]uffers' }, + { 'b', custom.buffers , ' Buffers' , '[b]uffers' }, { 'c', custom.colorschemes , ' Colorschemes' , '[c]olorschemes' }, { 'd', custom.dotfiles , ' Dotfiles' , '[d]ot[f]iles' }, { 'e', builtin.diagnostics , '󰀪 Diagnostics' , 'diagnostics/[e]rrors' }, @@ -141,7 +151,7 @@ local config = function() -- w -- x -- y - { 'z', builtin.spell_suggest , '󰓆 Spelling suggestions' , '[z] spell suggestions' }, + { 'z', custom.spell_suggest , '󰓆 Spelling suggestions' , '[z] spell suggestions' }, { ':', builtin.command_history, ' Command history' , '[:]command history' }, { '?', builtin.commands , ' Commands' , 'commands [?]' }, { '/', builtin.search_history , ' Search history' , '[/]search history' },