feat: add dashboard + persistenace
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
"copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" },
|
"copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" },
|
||||||
|
"dashboard-nvim": { "branch": "master", "commit": "000448d837f6e7a47f8f342f29526c4d7e49e9ce" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||||
"github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
|
"github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
|
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
|
||||||
"omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "ec1a2431f8872f650a85ed71c24f0715df2e49c2" },
|
"omnisharp-extended-lsp.nvim": { "branch": "main", "commit": "ec1a2431f8872f650a85ed71c24f0715df2e49c2" },
|
||||||
"onedarkpro.nvim": { "branch": "main", "commit": "44775f8206ee43b692e7f3dc894ddc47996ee523" },
|
"onedarkpro.nvim": { "branch": "main", "commit": "44775f8206ee43b692e7f3dc894ddc47996ee523" },
|
||||||
|
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
"plenary.nvim": { "branch": "master", "commit": "3707cdb1e43f5cea73afb6037e6494e7ce847a66" },
|
||||||
"rainbow-delimiters.nvim": { "branch": "master", "commit": "85b80abaa09cbbc039e3095b2f515b3cf8cadd11" },
|
"rainbow-delimiters.nvim": { "branch": "master", "commit": "85b80abaa09cbbc039e3095b2f515b3cf8cadd11" },
|
||||||
"telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" },
|
"telescope-themes": { "branch": "main", "commit": "9b7c368b83b82b53c0a6e9e977f8329e5f1fe269" },
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
return {
|
||||||
|
"nvimdev/dashboard-nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
config = function()
|
||||||
|
local logo = [[
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
███▄ █ ▒█████ ▒█████ ███▄ █ ▓█████ ▄████▄ ▄▄▄ ██▀███ ▓█████ ██████
|
||||||
|
██ ▀█ █ ▒██▒ ██▒ ▒██▒ ██▒ ██ ▀█ █ ▓█ ▀ ▒██▀ ▀█ ▒████▄ ▓██ ▒ ██▒▓█ ▀ ▒██ ▒
|
||||||
|
▓██ ▀█ ██▒▒██░ ██▒ ▒██░ ██▒▓██ ▀█ ██▒▒███ ▒▓█ ▄ ▒██ ▀█▄ ▓██ ░▄█ ▒▒███ ░ ▓██▄
|
||||||
|
▓██▒ ▐▌██▒▒██ ██░ ▒██ ██░▓██▒ ▐▌██▒▒▓█ ▄ ▒▓▓▄ ▄██▒░██▄▄▄▄██ ▒██▀▀█▄ ▒▓█ ▄ ▒ ██▒
|
||||||
|
▒██░ ▓██░░ ████▓▒░ ░ ████▓▒░▒██░ ▓██░░▒████▒ ▒ ▓███▀ ░ ▓█ ▓██▒░██▓ ▒██▒░▒████▒▒██████▒▒
|
||||||
|
|
||||||
|
█ █░ ▒█████ ██▀███ ██ ▄█▀ ██░ ██ ▄▄▄ ██▀███ ▓█████▄ ▓█████ ██▀███
|
||||||
|
▓█░ █ ░█░▒██▒ ██▒▓██ ▒ ██▒ ██▄█▒ ▓██░ ██▒▒████▄ ▓██ ▒ ██▒▒██▀ ██▌▓█ ▀ ▓██ ▒ ██▒
|
||||||
|
▒█░ █ ░█ ▒██░ ██▒▓██ ░▄█ ▒▓███▄░ ▒██▀▀██░▒██ ▀█▄ ▓██ ░▄█ ▒░██ █▌▒███ ▓██ ░▄█ ▒
|
||||||
|
░█░ █ ░█ ▒██ ██░▒██▀▀█▄ ▓██ █▄ ░▓█ ░██ ░██▄▄▄▄██ ▒██▀▀█▄ ░▓█▄ ▌▒▓█ ▄ ▒██▀▀█▄
|
||||||
|
░░██▒██▓ ░ ████▓▒░░██▓ ▒██▒▒██▒ █▄ ░▓█▒░██▓ ▓█ ▓██▒░██▓ ▒██▒░▒████▓ ░▒████▒░██▓ ▒██▒
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
]]
|
||||||
|
|
||||||
|
local opts = {
|
||||||
|
theme = "doom",
|
||||||
|
hide = {
|
||||||
|
statusline = false,
|
||||||
|
},
|
||||||
|
config = {
|
||||||
|
header = vim.split(logo, "\n"),
|
||||||
|
center = {
|
||||||
|
{ action = 'lua require("telescope.builtin").find_files()', desc = " Find File", icon = " ", key = "f" },
|
||||||
|
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
||||||
|
{ action = 'lua require("telescope.builtin").oldfiles()', desc = " Recent Files", icon = " ", key = "r" },
|
||||||
|
{ action = 'lua require("telescope.builtin").live_grep()', desc = " Find Text", icon = " ", key = "g" },
|
||||||
|
{
|
||||||
|
action = 'lua require("persistence").load()',
|
||||||
|
desc = " Restore Session",
|
||||||
|
icon = " ",
|
||||||
|
key = "s",
|
||||||
|
},
|
||||||
|
{ action = "Lazy", desc = " Lazy", icon = " ", key = "l" },
|
||||||
|
{
|
||||||
|
action = function()
|
||||||
|
vim.api.nvim_input("<cmd>qa<cr>")
|
||||||
|
end,
|
||||||
|
desc = " Quit",
|
||||||
|
icon = " ",
|
||||||
|
key = "q",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
footer = function()
|
||||||
|
local stats = require("lazy").stats()
|
||||||
|
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
|
||||||
|
return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require("dashboard").setup(opts)
|
||||||
|
|
||||||
|
for _, button in ipairs(opts.config.center) do
|
||||||
|
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||||
|
button.key_format = " %s"
|
||||||
|
end
|
||||||
|
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
return {
|
||||||
|
"folke/persistence.nvim",
|
||||||
|
event = "BufReadPre",
|
||||||
|
config = function()
|
||||||
|
local persistence = require("persistence")
|
||||||
|
|
||||||
|
persistence.setup({␍
|
||||||
|
dir = vim.fn.stdpath("data") .. "/sessions/",
|
||||||
|
need = 1,
|
||||||
|
branch = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>qs", persistence.load, { desc = "Load session for the current directory" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>qS", persistence.select, { desc = "Select session to load" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>ql", function()
|
||||||
|
require("persistence").load({ last = true })
|
||||||
|
end, { desc = "Load last session" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>qd", persistence.stop, { desc = "Stop Persistence" })
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -15,7 +15,6 @@ return {
|
|||||||
"lukas-reineke/indent-blankline.nvim",
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
main = "ibl",
|
main = "ibl",
|
||||||
config = function()
|
config = function()
|
||||||
|
|
||||||
local highlight = {
|
local highlight = {
|
||||||
"RainbowRed",
|
"RainbowRed",
|
||||||
"RainbowYellow",
|
"RainbowYellow",
|
||||||
@@ -40,7 +39,10 @@ return {
|
|||||||
|
|
||||||
vim.g.rainbow_delimiters = { highlight = highlight }
|
vim.g.rainbow_delimiters = { highlight = highlight }
|
||||||
|
|
||||||
require("ibl").setup({ scope = { highlight = highlight } })
|
require("ibl").setup({
|
||||||
|
scope = { highlight = highlight },
|
||||||
|
exclude = { filetypes = { "dashboard" } },
|
||||||
|
})
|
||||||
|
|
||||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
||||||
end,
|
end,
|
||||||
|
|||||||
Reference in New Issue
Block a user