There are a few ways to create dashboards in nvim. The two main ones I have experimented with are dashboard nvim and snacks nvim. If you are using lazyvim, snacks comes preinstalled by default. Personally I don't like the default settings, so I have modified them to look like this.

Snacks Dashboard

The code for that is below:

1return {
2 "folke/snacks.nvim",
3 opts = {
4 terminal = {
5 enabled = false,
6 },
7 dashboard = {
8 preset = {
9 header = [[
10██████╗ ███████╗██╗ ██╗██████╗ █████╗ ██████╗ ███╗ ██╗███████╗████████╗
11██╔══██╗██╔════╝██║ ██║██╔══██╗██╔══██╗██╔══██╗ ████╗ ██║██╔════╝╚══██╔══╝
12██║ ██║█████╗ ██║ ██║██████╔╝███████║██║ ██║ ██╔██╗ ██║█████╗ ██║
13██║ ██║██╔══╝ ╚██╗ ██╔╝██╔═══╝ ██╔══██║██║ ██║ ██║╚██╗██║██╔══╝ ██║
14██████╔╝███████╗ ╚████╔╝ ██║ ██║ ██║██████╔╝██╗██║ ╚████║███████╗ ██║
15╚═════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚═╝╚═╝ ╚═══╝╚══════╝ ╚═╝
16 ]],
17
18 keys = {
19 { icon = " ", key = "f", desc = "Find File", action = ":lua LazyVim.pick()()" },
20 { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
21 { icon = " ", key = "R", desc = "Recent Files", action = ":lua LazyVim.pick('oldfiles')()" },
22 { icon = " ", key = "g", desc = "Find Text", action = ":lua Snacks.dashboard.pick('live_grep')" },
23 { icon = " ", key = "c", desc = "Config", action = ":lua LazyVim.pick.config_files()()" },
24 { icon = " ", key = "r", desc = "Restore Session", action = ":lua require('persistence').load()" },
25 { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy" },
26 { icon = " ", key = "x", desc = "Lazy Extras", action = ":LazyExtras" },
27 { icon = "󰊳 ", key = "u", desc = "Update", action = ":Lazy update", group = "@property" },
28 { icon = "󰊳 ", key = "m", desc = "Mason", action = ":Mason", group = "@property" },
29 { icon = " ", key = "q", desc = "Quit", action = ":qa" },
30 },
31 },
32 sections = {
33 { section = "header" },
34 {
35 pane = 2,
36 section = "terminal",
37 cmd = "",
38 height = 8,
39 padding = 1,
40 },
41 -- { pane = 2, icon = " ", title = "Recent Files", section = "recent_files", indent = 2, padding = 1 },
42 { section = "keys", gap = 1, padding = 1 },
43 {
44 pane = 2,
45 icon = " ",
46 desc = "Browse Repo",
47 padding = 1,
48 key = "b",
49 action = function()
50 Snacks.gitbrowse()
51 end,
52 },
53 -- {
54 -- pane = 1,
55 -- icon = " ",
56 -- title = "Projects",
57 -- section = "projects",
58 -- indent = 2,
59 -- padding = 1,
60 -- },
61 function()
62 local in_git = Snacks.git.get_root() ~= nil
63 local cmds = {
64 {
65 title = "Git Info",
66 cmd = "git log -n 3 --pretty=format:'%h - %s - %an (%cr)'",
67 icon = " ",
68 height = 4,
69 },
70 {
71 icon = " ",
72 title = "Git Status",
73 cmd = "git --no-pager diff --stat -B -M -C",
74 height = 8,
75 },
76 -- gh ext install meiji163/gh-notify
77 {
78 title = "Notifications",
79 cmd = "gh notify -s -n2",
80 icon = " ",
81 section = "terminal",
82 action = function()
83 vim.ui.open("https://github.com/notifications")
84 end,
85 key = "N",
86 height = 3,
87 },
88 -- {
89 -- title = "Open Issues",
90 -- cmd = "gh issue list -L 3",
91 -- key = "i",
92 -- action = function()
93 -- vim.fn.jobstart("gh issue list --web", { detach = true })
94 -- end,
95 -- icon = " ",
96 -- height = 7,
97 -- },
98 {
99 icon = " ",
100 title = "Open PRs",
101 cmd = "gh pr list -L 3",
102 key = "P",
103 action = function()
104 vim.fn.jobstart("gh pr list --web", { detach = true })
105 end,
106 height = 7,
107 },
108 }
109 return vim.tbl_map(function(cmd)
110 return vim.tbl_extend("force", {
111 pane = 2,
112 section = "terminal",
113 enabled = in_git,
114 padding = 1,
115 ttl = 5 * 60,
116 indent = 3,
117 }, cmd)
118 end, cmds)
119 end,
120 { section = "startup" },
121 },
122 },
123 indent = {
124 animate = {
125 style = "down", -- "out", "up_down", "down", "up"
126 },
127 enabled = true,
128 indent = {
129 enabled = false,
130 only_scope = true,
131 hl = {
132 "SnacksIndentCustom2",
133 "SnacksIndentCustom3",
134 },
135 },
136 scope = {
137 enabled = true,
138 hl = "SnacksIndentCustom",
139 },
140 },
141 scroll = {
142 enabled = false, -- Disables smooth scrolling
143 },
144 },
145}
146

Additionally, I created a function which pops up with github notification information:

Unknown

I will paste the code for that below as well:

1-- Track the notification window ID
2local gh_notification_win_id = nil
3
4vim.keymap.set("n", "<C-7>", function()
5 -- Check if notifications window is already open, close it if it is
6 if gh_notification_win_id and vim.api.nvim_win_is_valid(gh_notification_win_id) then
7 vim.api.nvim_win_close(gh_notification_win_id, true)
8 gh_notification_win_id = nil
9 return
10 end
11
12 local success, git_notifications = pcall(function()
13 return vim.fn.system("gh notify -s -a -n5"):gsub("\n$", "")
14 end)
15
16 if not success or git_notifications == "" then
17 require("noice").notify("No GitHub notifications or error running command", "warn")
18 return
19 end
20
21 -- Strip ANSI escape sequences and format output
22 local cleaned = git_notifications:gsub("\27%[[%d;]+m", "") -- Remove ANSI color codes
23 local formatted = {}
24 for line in cleaned:gmatch("[^\r\n]+") do
25 -- Extract date/time and description
26 local date_time, description = line:match("%s*(%d+/%w+ %d+:%d+)%s*(.*)")
27 if date_time and description then
28 table.insert(formatted, string.format("%s %s", date_time, description))
29 end
30 end
31
32 -- Create a buffer for the notifications
33 local buf = vim.api.nvim_create_buf(false, true)
34
35 -- Set buffer content
36 vim.api.nvim_buf_set_lines(buf, 0, -1, false, formatted)
37
38 -- Calculate window dimensions
39 local width = math.min(160, vim.o.columns - 4)
40 local height = math.min(#formatted + 1, 15)
41
42 -- Center the window
43 local row = math.floor((vim.o.lines - height) / 2)
44 local col = math.floor((vim.o.columns - width) / 2)
45
46 -- Create floating window
47 local padding = 1 -- top, left, bottom, right
48 local win = vim.api.nvim_open_win(buf, true, {
49 relative = "editor",
50 width = width - 2 * padding,
51 height = height - 1 * padding,
52 row = row + padding,
53 col = col + padding,
54 style = "minimal",
55 border = "rounded",
56 title = "GitHub Notifications",
57 title_pos = "center",
58 })
59
60 -- Store window ID for toggle functionality
61 gh_notification_win_id = win
62
63 vim.bo[buf].modifiable = false
64 vim.bo[buf].buftype = "nofile"
65 vim.bo[buf].filetype = "gh-notifications"
66
67 -- Add keymaps to close the window
68 vim.api.nvim_buf_set_keymap(buf, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
69 vim.api.nvim_buf_set_keymap(buf, "n", "<Esc>", "<cmd>close<CR>", { noremap = true, silent = true })
70end, { desc = "Show GitHub notifications", silent = true })
71

Note that for these to work, you have to have github cli installed, in addition to an extention; if you're receiving a warning about gh notify -s -n5 not working, that's because you haven't installed the extension. You can do that with a simple command in your terminal outside of vim: gh ext install meiji163/gh-notify.

Comments disabled