session management

This commit is contained in:
♥ Minnie ♥ 2025-05-15 11:09:32 +08:00
parent b5b7fdebc6
commit eae19b0c19
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
4 changed files with 33 additions and 0 deletions

View file

@ -13,6 +13,7 @@
# Editor plugins and configurations
./plugins/editor/buffers.nix
./plugins/editor/comment.nix
./plugins/editor/sessions.nix
./plugins/editor/treesitter.nix
# UI plugins

View file

@ -8,11 +8,15 @@
clipboard = "unnamedplus";
conceallevel = 1;
updatetime=100;
undofile = true;
# Tabs & Spaces
tabstop = 2;
softtabstop = 2;
shiftwidth = 2;
expandtab = true;
# Using this config for sessionoptions is recommended:
sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions";
};
}

View file

@ -0,0 +1,21 @@
{ ... }: {
plugins.auto-session = {
enable = true;
settings = {
pre_save_cmds = ["Neotree close"];
post_restore_cmds = ["Neotree show"];
};
};
keymaps = [
{
mode = ["n"];
key = "<leader>ss";
action = ":SessionSearch<cr>";
options = {
desc = "Search sessions";
silent = true;
};
}
];
}

View file

@ -1,6 +1,13 @@
{...}: {
plugins.neo-tree = {
enable = true;
eventHandlers = {
neo_tree_window_after_open = ''
function(_)
vim.cmd("wincmd =")
end
'';
};
closeIfLastWindow = true;
};