When I've just typed a huge command such as:
:e ~/Projects/foo/app/views/bar.rhtml
Vim inevitably tells me that I haven't saved the current buffer. Is there a quick way to repeat the command with an exclamation point, without having to retype the whole thing?
:e! #
When specifying vim files, %
is a shortcut to the current file and #
is a shortcut to the "previous" (really, more like "other") file, which in your case is ~/.../bar.rhtml
q:
will bring up the history and you can edit the commands directly and then hit enter to run them again, or you can do as zigdon suggested and :<up><home><right>!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With