#vi/#nvi folks, what's the best way to call aspell, and reload the file?

:w :aspell check %

and then, once you make changes, to reload:

1GdG:r

?

@rl_dane

If you've made changes, just using

:e!

(or just :e if you haven't modified the buffer since the :w command) will reload the (modified) file from disk. However it has the unfortunate side-effect of losing your undo history.

@gumnos

Ok, cool!

What exactly do :e and :e! do differently?

@rl_dane

:e

without a filename following it re-edits the current file, re-reading it from disk like you wanted. If you've made changes that it hasn't yet written (which you do with your :w so mostly a non-issue here), the

:e!

means "abandon any unsaved changes and reread the file from disk". I mentally read the "!" modifier on ex commands as "and I mean it" or "dagnabbit".

:w
"The file on disk has been changed since last you wrote it"
:w!

"(over)write the file, dagnabbit!" 😆