This article is a small tutorial with a few simple steps on how to quickly edit readme.md with vim editor. Knowledge can be used for a quick edit of any document in the Linux terminal.
I made a simple typo in one of my project’s readme.md and noticed it after I already pushed the commit to the repository. For such cases, it is handy to know the vim editor and how to handle vim edit mode if you are in the terminal.
All you have to do is this:
- Go to file folder you want to edit. In our case, for example, it is a folder containing git repository with
- Get to the edit/insert mode by typing
- Fix the typo.
[Esc]keyboard to leave the vim insert mode.
- And finally, type
:wfor writing the change or
:xfor saving and exiting the vim. Hit
[Enter]and execute the command.
To save the file content to a new file named e.g NEW_FILE, we need to use
:w NEW_FILE or
:x NEW_FILE and hit