Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ctrl-o with ignore "No write since last change"

Tags:

vim

I can press ctrlO to go to the last jump point. However, if there are any changes in the current document it warns me with:

E37: No write since last change (add ! to override)

Is there a way to ignore that message and do ctrl-o and either (1) discard any changes; or (2) save any changes and do ctrl-o?

like image 834
David542 Avatar asked Jan 17 '26 08:01

David542


1 Answers

  1. Discard any changes --- No.

  2. Save any changes --- set autowrite or set autowriteall

  3. Hide buffer but keep it in memory (can ask for saving it later) --- set hidden

  4. Ask if you want to save a buffer --- set confirm

Note: (2), (3) and (4) are global options and change Vim behaviour for many(!) commands.

like image 75
Matt Avatar answered Jan 21 '26 08:01

Matt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!