diff options
| author | bh <qn+git@excalibur.computer> | 2025-11-12 23:57:20 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2025-11-12 23:57:20 +0800 |
| commit | cc5ca2e8c8fa3cf2e60321fdb0cb4ddb66551ff2 (patch) | |
| tree | f6173f63d1bd48710728817bd338838654ec60de /lua/config/dashboard.lua | |
Initial Commit
Diffstat (limited to 'lua/config/dashboard.lua')
| -rw-r--r-- | lua/config/dashboard.lua | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/lua/config/dashboard.lua b/lua/config/dashboard.lua new file mode 100644 index 0000000..c317a71 --- /dev/null +++ b/lua/config/dashboard.lua @@ -0,0 +1,84 @@ +return function() +local db = require("dashboard") + +-- Safe fortune function +local function quote() + local handle = io.popen("fortune -s") -- run fortune + local result = handle:read("*a") -- read all output + handle:close() + -- Remove all newlines and carriage returns + result = result:gsub("\r",""):gsub("\n"," ") + return result +end + +db.setup { + theme = "hyper", + config = { + week_header = { + enable = false -- or true if you want date/time header + }, + header = { + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██╔╝██╔╝██║", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║", + " ╚═╝ ╚═══╝╚══════╝╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", + " ", + " " .. os.date("%A, %B %d, %Y"), -- your custom date/day line + "", + "[TIP: To exit Vim, use a Sledgehammer!]", + "" -- optional empty line to separate from center shortcuts + }, + shortcut = { + { + icon = " ", + desc = "New File", + key = "n", + action = "enew" + }, + { + icon = " ", + desc = "Find File", + key = "f", + action = "Telescope find_files" + }, + { + icon = " ", + desc = "Recent Files", + key = "r", + action = "Telescope oldfiles" + }, + { + icon = " ", + desc = "Open Config", + key = "c", + action = "edit ~/.config/nvim/" + }, + { + icon = " ", + desc = "SLEDGEHAMMER!", + action = "qa" + }, + }, + packages = { + enable = true -- set to true if you want plugin count display + }, + mru = { + enable = true, -- set true if you want MRU files + limit = 10, + icon = " ", + label = "Recent", + cwd_only = false + }, + project = { + enable = false, -- set true if you want project list + limit = 8, + icon = " ", + label = "Projects", + action = "Telescope find_files cwd=" + }, + footer = { "", quote() }, + }, +} +end |
