restructured nvim config
This commit is contained in:
parent
22d4936a21
commit
6bb0e86ded
9 changed files with 148 additions and 147 deletions
|
@ -3,45 +3,80 @@ return{
|
|||
"nvimdev/dashboard-nvim",
|
||||
lazy = false, -- As https://github.com/nvimdev/dashboard-nvim/pull/450, dashboard-nvim shouldn't be lazy-loaded to properly handle stdin.
|
||||
opts = function()
|
||||
-- local logo = [[
|
||||
-- ▐ ▄ ▄▄▄ . ▌ ▐·▪ • ▌ ▄ ·.
|
||||
-- •█▌▐█▀▄.▀·▪ ▪█·█▌██ ·██ ▐███▪
|
||||
-- ▐█▐▐▌▐▀▀▪▄ ▄█▀▄ ▐█▐█•▐█·▐█ ▌▐▌▐█·
|
||||
-- ██▐█▌▐█▄▄▌▐█▌.▐▌ ███ ▐█▌██ ██▌▐█▌
|
||||
-- ▀▀ █▪ ▀▀▀ ▀█▄▀▪. ▀ ▀▀▀▀▀ █▪▀▀▀
|
||||
-- ]]
|
||||
|
||||
local logo = [[
|
||||
██╗ █████╗ ███████╗██╗ ██╗██╗ ██╗██╗███╗ ███╗ Z
|
||||
██║ ██╔══██╗╚══███╔╝╚██╗ ██╔╝██║ ██║██║████╗ ████║ Z
|
||||
██║ ███████║ ███╔╝ ╚████╔╝ ██║ ██║██║██╔████╔██║ z
|
||||
██║ ██╔══██║ ███╔╝ ╚██╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║ z
|
||||
███████╗██║ ██║███████╗ ██║ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||
╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||
|
||||
████ ██████ █████ ██
|
||||
███████████ █████
|
||||
█████████ ███████████████████ ███ ███████████
|
||||
█████████ ███ █████████████ █████ ██████████████
|
||||
█████████ ██████████ █████████ █████ █████ ████ █████
|
||||
███████████ ███ ███ █████████ █████ █████ ████ █████
|
||||
██████ █████████████████████ ████ █████ █████ ████ ██████
|
||||
]]
|
||||
|
||||
logo = string.rep("\n", 8) .. logo .. "\n\n"
|
||||
|
||||
local opts = {
|
||||
theme = "doom",
|
||||
hide = {
|
||||
-- this is taken care of by lualine
|
||||
-- enabling this messes up the actual laststatus setting after loading a file
|
||||
statusline = false,
|
||||
},
|
||||
config = {
|
||||
header = vim.split(logo, "\n"),
|
||||
-- stylua: ignore
|
||||
center = {
|
||||
{ action = 'lua LazyVim.pick()()', desc = " Find File", icon = " ", key = "f" },
|
||||
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
||||
{ action = 'lua LazyVim.pick("oldfiles")()', desc = " Recent Files", icon = " ", key = "r" },
|
||||
{ action = 'lua LazyVim.pick("live_grep")()', desc = " Find Text", icon = " ", key = "g" },
|
||||
{ action = 'lua LazyVim.pick.config_files()()', desc = " Config", icon = " ", key = "c" },
|
||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||
{ 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" }
|
||||
local opts = {
|
||||
theme = "doom",
|
||||
hide = {
|
||||
statusline = false,
|
||||
},
|
||||
config = {
|
||||
header = vim.split(logo, "\n"),
|
||||
center = {
|
||||
{
|
||||
action = function()
|
||||
require("telescope.builtin").find_files()
|
||||
end,
|
||||
desc = " Find File",
|
||||
icon = " ",
|
||||
key = "f"
|
||||
},
|
||||
}
|
||||
{ action = "ene | startinsert", desc = " New File", icon = " ", key = "n" },
|
||||
{
|
||||
action = function()
|
||||
require("telescope.builtin").oldfiles()
|
||||
end,
|
||||
desc = " Recent Files",
|
||||
icon = " ",
|
||||
key = "r"
|
||||
},
|
||||
{
|
||||
action = function()
|
||||
require("telescope.builtin").live_grep()
|
||||
end,
|
||||
desc = " Find Text",
|
||||
icon = " ",
|
||||
key = "g"
|
||||
},
|
||||
{
|
||||
action = function()
|
||||
require("telescope.builtin").find_files({ cwd = vim.fn.stdpath("config") })
|
||||
end,
|
||||
desc = " Search Neovim files",
|
||||
icon = " ",
|
||||
key = "c"
|
||||
},
|
||||
{ action = 'lua require("persistence").load()', desc = " Restore Session", icon = " ", key = "s" },
|
||||
{ action = "LazyExtras", desc = " Lazy Extras", icon = " ", key = "x" },
|
||||
{ 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,
|
||||
},
|
||||
}
|
||||
|
||||
for _, button in ipairs(opts.config.center) do
|
||||
button.desc = button.desc .. string.rep(" ", 43 - #button.desc)
|
||||
|
@ -73,6 +108,7 @@ return{
|
|||
{ "<leader>qs", function() require("persistence").load() end, desc = "Restore Session" },
|
||||
{ "<leader>ql", function() require("persistence").load({ last = true }) end, desc = "Restore Last Session" },
|
||||
{ "<leader>qd", function() require("persistence").stop() end, desc = "Don't Save Current Session" },
|
||||
{ "<leader>db", "<cmd>:Dashboard<CR>", desc = "Dashboard"}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue