top | item 42820103

(no title)

carb | 1 year ago

What editor state are you losing when you leave vim?

I run a pretty light vanilla vimrc (60 lines maybe) and with two lines you can enable vim undofiles and returning the cursor to the last location upom reopening a file. For me, quitting vim is functionally equivalent to ^Z?

discuss

order

aldanor|1 year ago

You may lose LSP state like rust-analyzer's which takes a while to restore. You may lose opened buffers and positions within them (unless you have some session restore logic which may also take time), window layout, copy buffers, edit history and lots of other state.

carb|1 year ago

Ah I don't run any LSPs so that's fair.

Retaining positions, buffers, and edit history between sessions is all straightforward in vanilla vim though. Unless you run an autolinter or formatter that edits your target file and wipes the history.

Arch-TK|1 year ago

For that there is ra-multiplex (to which I contributed sockets support).

I don't use any other LSPs which have a long warmup time, but if I did then they can also be used behind ra-multiplex.

viraptor|1 year ago

You lose the open windows/tabs. Apart from trivial one-off scripts I basically never have only a single tab open.

Arch-TK|1 year ago

I don't use tabs, sometimes I use split windows (usually only when vim-diffing), mostly I use multiple terminal windows in a tiling WM. I do use multiple buffers but I usually don't care about editing more than one or two at a time and it's easy to re-open these whenever I need to.

carb|1 year ago

That's true for me too but usually my tabs and windows are managed one level higher, by the terminal emulator, or I'm opening vim with -o/-O to open a split window directly.