How to save an existing file?

To save an existing file in Vim, follow these steps:

  1. Press Esc to ensure you are in normal mode.
  2. Type :w and press Enter.

This command writes (saves) the changes made to the file without exiting Vim. If you want to save and exit at the same time, you can use :wq.

If you need to save the file under a different name, you can use :w new_filename.txt.

0 Comments

no data
Be the first to share your comment!