feat(nvim): save sessions for dashboard

This commit is contained in:
winston 2022-10-21 16:55:18 +02:00
parent 1e0cd481b6
commit cb814fcf0b
Signed by: winston
GPG key ID: 3786770EDBC2B481
2 changed files with 14 additions and 13 deletions

View file

@ -7,7 +7,7 @@ pcall(require, "lsp")
vim.o.termguicolors = true
-- map leader to space
vim.g.mapleader = " "
vim.o.cmdheight = 1
vim.o.cmdheight = 0
-- line numbers
vim.o.mouse = ""
vim.o.number = true

View file

@ -42,31 +42,27 @@ local function pad(string)
return str
end
db.session_directory = vim.fn.stdpath("cache") .. "/sessions"
db.custom_center = {
{
icon = "",
desc = pad("Restore last session"),
shortcut = "SPC s l",
action = "SessionLoad",
},
{
icon = "",
desc = pad("Open Projects"),
action = "Telescope project",
shortcut = "SPC f p",
},
{
icon = "",
desc = pad("Find File"),
action = "Telescope find_files find_command=rg,--hidden,--files",
shortcut = "SPC f f",
},
{
icon = "",
desc = pad("File Browser"),
action = "Telescope file_browser",
shortcut = "SPC f b",
},
{
icon = "",
desc = pad("Find word"),
action = "Telescope live_grep",
shortcut = "SPC f g",
},
{
icon = "",
desc = pad("Open Settings"),
@ -87,3 +83,8 @@ db.custom_footer = function()
plugCount .. " regrets",
}
end
vim.api.nvim_create_autocmd(
"VimLeavePre",
{ pattern = "*", command = "SessionSave" }
)