Not for normies
refactor: use rmagatti/auto-session for sessions
4 files changed, +11 -4
+1-0nvim/lazy-lock.json
| @@ -1,4 +1,5 @@ | ||
| 1 | 1 | { |
| 2 | + "auto-session": { "branch": "main", "commit": "517a75727d28a4d1ee9c79b56dde239a5408778f" }, | |
| 2 | 3 | "blink.cmp": { "branch": "main", "commit": "0590187042b60456edef3808cfa3a4f34b2e4027" }, |
| 3 | 4 | "fidget.nvim": { "branch": "main", "commit": "3f5475949679953af6d78654db29b944fa826e6a" }, |
| 4 | 5 | "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, |
+0-3nvim/lua/commands.lua
| @@ -50,8 +50,5 @@ command! -nargs=1 Tab tabnew | exe 'tcd '.<q-args> | ||
| 50 | 50 | |
| 51 | 51 | autocmd InsertLeave,TextChanged,FocusLost * if &modifiable && !&readonly | silent! wall | endif |
| 52 | 52 | 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' | |
| 56 | 53 | autocmd BufWritePre * silent! lua vim.lsp.buf.format() |
| 57 | 54 | ]]) |
+0-1nvim/lua/options.lua
| @@ -14,7 +14,6 @@ set fdo= | ||
| 14 | 14 | set foldmethod=expr |
| 15 | 15 | set foldexpr=v:lua.vim.treesitter.foldexpr() |
| 16 | 16 | set noswapfile |
| 17 | -set sessionoptions+=globals,localoptions,tabpages,winpos,resize,folds | |
| 18 | 17 | colorscheme tokyonight-moon |
| 19 | 18 | set undofile |
| 20 | 19 | 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 | +} |