feat(nvim): save sessions for dashboard
This commit is contained in:
parent
1e0cd481b6
commit
cb814fcf0b
2 changed files with 14 additions and 13 deletions
|
@ -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
|
||||
|
|
|
@ -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" }
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue