Skip to content

Commit

Permalink
chore(nvim): add snackbar dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
miszo committed Nov 19, 2024
1 parent 19fbfa6 commit bd78034
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
38 changes: 28 additions & 10 deletions home/dot_config/exact_nvim/exact_lua/exact_plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,12 @@ return {
keys = { { '<leader>z', '<cmd>ZenMode<cr>', desc = 'Zen Mode' } },
},
{
'nvimdev/dashboard-nvim',
event = 'VimEnter',
opts = function(_, opts)
local logo = [[
'folke/snacks.nvim',
opts = {
dashboard = {
width = 80,
preset = {
header = [[
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
Expand All @@ -174,10 +175,27 @@ return {
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
[miszo]
]]

logo = string.rep('\n', 8) .. logo .. '\n\n'
opts.config.header = vim.split(logo, '\n')
end,
]],
---@param keys snacks.dashboard.Item[]
keys = function(keys)
-- add LazyExtra before Lazy
for k, key in ipairs(keys) do
if key.action == ':Lazy' then
key.key = 'l' -- we don't have multiple panes, so `l` is free
table.insert(keys, k, { icon = '', desc = 'Lazy Extras', action = ':LazyExtras', key = 'x' })
break
end
end
end,
},
sections = {
{ section = 'header' },
{ icon = '', title = 'Keymaps', section = 'keys', indent = 2, padding = 1 },
{ icon = '', title = 'Recent Files', section = 'recent_files', indent = 2, padding = 1 },
{ icon = '', title = 'Projects', section = 'projects', indent = 2, padding = 1 },
{ section = 'startup' },
},
},
},
},
}
4 changes: 2 additions & 2 deletions home/dot_config/exact_nvim/lazyvim.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
"lazyvim.plugins.extras.util.startuptime"
],
"news": {
"NEWS.md": "7107",
"NEWS.md": "7429",
"doc/news.txt": "24450"
},
"version": 7
}
}

0 comments on commit bd78034

Please sign in to comment.