4 ms·
Another Vim tip: use sessions. vim -S <sessfile> will recover a session file. I set up these items in my .vimrc to make sessions a little easier to work wi
by kazinator 4y ago
Another Vim tip: use sessions.
vim -S <sessfile>
will recover a session file.
I set up these items in my .vimrc to make sessions a little easier to work with:
The + key (which has a useless default role of moving to the next line) is mapped to save the current session:
:nmap + :wa<Bar>exe "mksession! " . v:this_session<CR>
Then, a :S command for creating a new session, e.g. :S foo.
:command -nargs=1 S exec "mksession! " . expand('$top/') . expand('<args>')
This relies on a $top variable which I set like this:
:let $top=getcwd()
that has to do with https://news.ycombinator.com/item?id=33351155 https://news.ycombinator.com/item?id=33351155
I want sessions to be created in the top directory, rather than the directory of the current buffer.
- Keyframe 4y agohttps://github.com/xolox/vim-session https://github.com/xolox/vim-session I actually have in normal mode ,ss for save session and ,so for opening them. Central location of session dirs and that's it. Save session saves everything from files open, positions, tabs, you name it.