2 ms·
> I am glad vim has the option to place the swap files where you want them, and make them unique (by setting 'directory' to end with "//"). i am glad as well.
by geocar 5y ago
> I am glad vim has the option to place the swap files where you want them, and make them unique (by setting 'directory' to end with "//").
i am glad as well. not every program supports --exclude/--except.
i used to keep swapfiles in a single global directory, but i've instead started to try to stash my swapfiles "near" the code:
alias vi='vim --cmd "$(x="$(git rev-parse --show-toplevel 2>/dev/null)"; [ "x$x" != x/ ] && mkdir -p "$x/.git/_vim" 2>/dev/null && echo "set dir=$x/.git/_vim//")"'
this seems to have some advantages: for example, i can do a find / -name '*.swp' to figure out what i was working on when most of the files are readme.md
(i should note, real ed doesn't create ed.hup files; that's a weird gnuism)
> For vim and ed and every other console program, I would run them inside screen(1) to avoid losing work due to network troubles, and network disconnects is usually where I get my SIGHUP.
i don't like screen very much, even though i do continue to use it (owing more to its ubiquity and utility); it's full of all kinds of questionable ui decisions, and so many features i use so infrequently i need to constantly be re-reading the manual. i think if you have learned it and liked it okay, but all i ever want is terminal mobility, and i get a much nicer experience out of two tools:
- mosh: https://mosh.org/ https://mosh.org/
- reptyr: https://github.com/nelhage/reptyr https://github.com/nelhage/reptyr
using mosh means i don't get SIGHUP, and if i lose my local display, i can open another mosh, reptr my old session (it's still there!) and keep on hacking.