Change order of keys on dashboard #1823
-
Beta Was this translation helpful? Give feedback.
Answered by
drowning-cat
Apr 30, 2025
Replies: 1 comment
-
-- Run with `nvim -u ./repro.lua`
-- repro.lua
vim.env.LAZY_STDPATH = '.repro'
load(vim.fn.system 'curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua')()
---@module 'snacks'
---@diagnostic disable-next-line: missing-fields
require('lazy.minit').repro {
spec = {
{
'folke/snacks.nvim',
init = function()
vim.api.nvim_create_autocmd('User', {
pattern = 'VeryLazy',
callback = function()
Snacks.dashboard()
end,
})
end,
---@type snacks.Config
opts = {
dashboard = {
preset = {
keys = {
{ icon = ' ', key = 'F', desc = 'Fish', action = ":lua vim.print('fish')" },
-- Default keys
{ icon = ' ', key = 'f', desc = 'Find File', action = ":lua Snacks.dashboard.pick('files')" },
{ icon = ' ', key = 'n', desc = 'New File', action = ':ene | startinsert' },
{ icon = ' ', key = 'g', desc = 'Find Text', action = ":lua Snacks.dashboard.pick('live_grep')" },
{ icon = ' ', key = 'r', desc = 'Recent Files', action = ":lua Snacks.dashboard.pick('oldfiles')" },
{ icon = ' ', key = 'c', desc = 'Config', action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})" },
{ icon = ' ', key = 's', desc = 'Restore Session', section = 'session' },
{ icon = ' ', key = 'L', desc = 'Lazy', action = ':Lazy', enabled = package.loaded.lazy ~= nil },
{ icon = ' ', key = 'q', desc = 'Quit', action = ':qa' },
},
},
},
},
},
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Markuxcu
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Default config