I have a general workflow where I make a change in a file, save it, then immediately compile it so I can see the compiler errors. When I’m fiddling back and forth I will back out of a change I just made using the ‘undo’ button in Vim when a change just caused a new compiler error.
Because I’m using rustfmt on save this causes an additonal edit, and vim doesn’t seem to be able to back out of my previous change now. Additionally, because vim interprets a “whole file change” hitting ‘undo’ jumps to the top of the file, meaning I lose all context of where I was just working.
My workflow is so jarring and error-prone that I figure I must just be using all of these tools wrong.
How do people write Rust in vim?
Has anyone gotten around my undo-stack issue, or is my back-and-forth habit itself just bad and I need to learn a new way to write code?
I’m using nvim v0.3.1, plugins
['rustup', 'run', 'nightly-2018-09-22-x86_64-apple-darwin', 'rls']