irongit

refactor: use rmagatti/auto-session for sessions

huncholanehuncholaneauthored
parent b9d0132commit 2ff43f80116ec868de1e2c39c6b36dfbbf036ea1Browse files

4 files changed, +11 -4

+1-0nvim/lazy-lock.json
@@ -1,4 +1,5 @@
11 {
2+ "auto-session": { "branch": "main", "commit": "517a75727d28a4d1ee9c79b56dde239a5408778f" },
23 "blink.cmp": { "branch": "main", "commit": "0590187042b60456edef3808cfa3a4f34b2e4027" },
34 "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" },
45 "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
+0-3nvim/lua/commands.lua
@@ -50,8 +50,5 @@ command! -nargs=1 Tab tabnew | exe 'tcd '.<q-args>
5050
5151 autocmd InsertLeave,TextChanged,FocusLost * if &modifiable && !&readonly | silent! wall | endif
5252 silent! !mkdir .nvim -p
53-let mainroot=getcwd()
54-autocmd BufWritePre,VimLeavePre * silent! exe 'mks! '.mainroot.'/.nvim/session.vim'
55-autocmd VimEnter * %bd | silent! exe 'source '.mainroot.'/.nvim/session.vim'
5653 autocmd BufWritePre * silent! lua vim.lsp.buf.format()
5754 ]])
+0-1nvim/lua/options.lua
@@ -14,7 +14,6 @@ set fdo=
1414 set foldmethod=expr
1515 set foldexpr=v:lua.vim.treesitter.foldexpr()
1616 set noswapfile
17-set sessionoptions+=globals,localoptions,tabpages,winpos,resize,folds
1817 colorscheme tokyonight-moon
1918 set undofile
2019 let mapleader=" "
+10-0nvim/lua/plugins/auto-session.lua
@@ -0,0 +1,10 @@
1+vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
2+
3+---@type LazySpec
4+return {
5+ "rmagatti/auto-session",
6+ lazy = false,
7+ opts = {
8+ suppressed_dirs = { "~/", "~/Projects", "~/Downloads" },
9+ }
10+}