vim/telescope: show previewer for buffers picker
This commit is contained in:
parent
2bc8c7c15e
commit
b3aebdb8b6
1 changed files with 4 additions and 14 deletions
|
@ -62,7 +62,6 @@ local config = function()
|
||||||
local themes = require 'telescope.themes'
|
local themes = require 'telescope.themes'
|
||||||
local builtin = require 'telescope.builtin'
|
local builtin = require 'telescope.builtin'
|
||||||
local custom = {
|
local custom = {
|
||||||
|
|
||||||
all_files = function(opts)
|
all_files = function(opts)
|
||||||
builtin.find_files(vim.tbl_extend('keep', opts or {}, {
|
builtin.find_files(vim.tbl_extend('keep', opts or {}, {
|
||||||
hidden = true,
|
hidden = true,
|
||||||
|
@ -70,26 +69,17 @@ local config = function()
|
||||||
no_ignore_parent = true,
|
no_ignore_parent = true,
|
||||||
}))
|
}))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
buffers = function(opts)
|
|
||||||
builtin.buffers(themes.get_dropdown(vim.tbl_extend('keep', opts or {}, {
|
|
||||||
previewer = false,
|
|
||||||
})))
|
|
||||||
end,
|
|
||||||
|
|
||||||
colorschemes = function(opts)
|
colorschemes = function(opts)
|
||||||
builtin.colorscheme(themes.get_dropdown(vim.tbl_extend('keep', opts or {}, {
|
builtin.colorscheme(themes.get_dropdown(vim.tbl_extend('keep', opts or {}, {
|
||||||
enable_preview = true,
|
enable_preview = true,
|
||||||
})))
|
})))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
dotfiles = function(opts)
|
dotfiles = function(opts)
|
||||||
builtin.find_files(vim.tbl_extend('keep', opts or {}, {
|
builtin.find_files(vim.tbl_extend('keep', opts or {}, {
|
||||||
cwd = '~/.dotfiles',
|
cwd = '~/.dotfiles',
|
||||||
hidden = true,
|
hidden = true,
|
||||||
}))
|
}))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
selection = function(_)
|
selection = function(_)
|
||||||
local selected = require('user.util').get_selected_text()
|
local selected = require('user.util').get_selected_text()
|
||||||
builtin.grep_string {
|
builtin.grep_string {
|
||||||
|
@ -97,12 +87,12 @@ local config = function()
|
||||||
search = selected,
|
search = selected,
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
|
|
||||||
spell_suggest = function(opts)
|
spell_suggest = function(opts)
|
||||||
builtin.spell_suggest(themes.get_cursor(opts))
|
builtin.spell_suggest(themes.get_cursor(opts))
|
||||||
end,
|
end,
|
||||||
|
here = function(opts)
|
||||||
here = function(opts) builtin.current_buffer_fuzzy_find(opts) end,
|
builtin.current_buffer_fuzzy_find(opts)
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local map = function(leader, keymap)
|
local map = function(leader, keymap)
|
||||||
|
@ -121,7 +111,7 @@ local config = function()
|
||||||
-- ╰────╯ ╰──────╯ ╰────────────╯ ╰───────────────────╯
|
-- ╰────╯ ╰──────╯ ╰────────────╯ ╰───────────────────╯
|
||||||
n = {
|
n = {
|
||||||
{ 'a', builtin.autocommands , ' Autocommands' , '[a]utocommands' },
|
{ 'a', builtin.autocommands , ' Autocommands' , '[a]utocommands' },
|
||||||
{ 'b', custom.buffers , ' Buffers' , '[b]uffers' },
|
{ 'b', builtin.buffers , ' Buffers' , '[b]uffers' },
|
||||||
{ 'c', custom.colorschemes , ' Colorschemes' , '[c]olorschemes' },
|
{ 'c', custom.colorschemes , ' Colorschemes' , '[c]olorschemes' },
|
||||||
{ 'd', custom.dotfiles , ' Dotfiles' , '[d]ot[f]iles' },
|
{ 'd', custom.dotfiles , ' Dotfiles' , '[d]ot[f]iles' },
|
||||||
{ 'e', builtin.diagnostics , ' Diagnostics' , 'diagnostics/[e]rrors' },
|
{ 'e', builtin.diagnostics , ' Diagnostics' , 'diagnostics/[e]rrors' },
|
||||||
|
|
Loading…
Add table
Reference in a new issue