Share your layouts! #1306
drowning-cat
started this conversation in
Show and tell
Replies: 2 comments
-
Floating File Explorer Expand configurationpicker = {
enabled = true,
actions = {
confirm_and_close = function(picker)
picker:action 'confirm'
picker:action 'close'
end,
confirm_nofocus = function(picker)
picker:action 'confirm'
picker:focus()
end,
},
sources = {
explorer = {
auto_close = true,
win = {
list = {
keys = {
['L'] = 'confirm_and_close',
['l'] = 'confirm_nofocus',
},
},
},
layout = function()
---@type snacks.picker.layout.Config
return {
cycle = true,
layout = {
box = 'horizontal',
position = 'float',
height = 0.95,
width = 0,
border = 'rounded',
{
box = 'vertical',
width = 40,
min_width = 40,
{ win = 'input', height = 1, title = '{title} {live} {flags}', border = 'single' },
{ win = 'list' },
},
{ win = 'preview', width = 0, border = 'left' },
},
}
end,
},
},
}, |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here are my (in progress) picker layouts. The style is based on that used for Telescope in NvChad. I'm using the Tokyonight colorscheme with specific highlights for Snacks pickers. Some screenshots File picker: Buffer picker: Icon picker: Snacks Picker Configpicker = {
prompt = ' ',
layouts = {
my_default_layout = {
layout = {
box = 'vertical',
width = 0.9,
height = 0.9,
border = 'none',
{ win = 'input', height = 1, border = 'single', title = 'Find {title} {live} {flags}', title_pos = 'center' },
{
box = 'horizontal',
{ win = 'list', border = { '🭽', '▔', '🭾', '▕', '🭿', '▁', '🭼', '▏' },
{ win = 'preview', border = { '🭽', '▔', '🭾', '▕', '🭿', '▁', '🭼', '▏' }, width = 0.6 },
},
},
},
my_vertical_layout = {
layout = {
box = 'vertical',
width = 0.8,
height = 0.9,
border = 'none',
{ win = 'input', border = 'single', height = 1, title = 'Find {title} {live} {flags}', title_pos = 'center' },
{ win = 'list', border = { '🭽', '▔', '🭾', '▕', '🭿', '▁', '🭼', '▏' }, height = 8 },
{ win = 'preview', border = { '🭽', '▔', '🭾', '▕', '🭿', '▁', '🭼', '▏' } },
},
},
vscode = {
layout = {
width = 0.5,
},
},
},
sources = {
autocmds = { layout = { preset = 'my_default_layout' } },
buffers = { layout = { preset = 'my_vertical_layout' } },
files = { layout = { preset = 'my_default_layout' } },
grep = { layout = { preset = 'my_default_layout' } },
grep_word = { layout = { preset = 'my_default_layout' } },
help = { layout = { preset = 'my_default_layout' } },
keymaps = { layout = { preset = 'vscode' } },
lazy = { layout = { preset = 'my_default_layout' } },
lines = { layout = { preset = 'my_default_layout' } },
recent = { layout = { preset = 'my_vertical_layout' }, title = 'Most Recently Used Files' },
undo = { layout = { preset = 'my_default_layout' } },
},
}, Tokyonight Color Scheme Configrequire('tokyonight').setup({
style = 'night',
on_highlights = function(highlights, colors)
-- Colors for Snacks pickers
highlights.SnacksPickerBoxTitle = { bg = '#1c99f2', fg = '#ffffff', bold = true }
highlights.SnacksPickerInput = { bg = '#23273b', fg = '#C0CAF5' }
highlights.SnacksPickerInputBorder = { bg = '#23273b', fg = '#23273b' }
highlights.SnacksPickerInputTitle = { bg = '#1c99f2', fg = '#ffffff', bold = true }
highlights.SnacksPickerList = { bg = '#262e46' }
highlights.SnacksPickerListBorder = { bg = '#262e46', fg = '#23273b' }
highlights.SnacksPickerListCursorLine = { bg = '#1a1d2f' }
highlights.SnacksPickerPreviewBorder = { bg = '#16161E', fg = '#23273b' }
highlights.SnacksPickerPrompt = { bg = '#23273b', fg = '#1c99f2' }
end,
})
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Have you created any neat
dashboardslayouts, you can share a screenshot with the config here.Beta Was this translation helpful? Give feedback.
All reactions