There are several ways to edit a file. One of most common text editors for this is Vi
or Vim
. More rarely, there is the Nano
editor. But these are only the default text editors build into every Linux distributions. You can always install gedit
or sublimetext
for a more easy experience.
Vim
Vim is an open source editors for all kinds of ASCII text, just like Nano. It is an improved clone of the previous Vi. It is an extremely powerful editor. For tasks that go beyond that, Vim provides an interface to external programs, such as grep
, awk
, sed
.
Normal
All inputs are considered as editor commands.Inser
All entered characters are inserted into the buffer.Visual
The visual mode is used to mark a contiguous part of the text, which will be visually highlighted.Command
It allows us to enter single-line commands at the bottom of the editor. Usually helps with replacing text section, deleting, and sorting.Replace
The newly entered will overwrite existing characters unless there are no more old characters at the current cursor positionEx
Emulates the behavior of the text editors Ex (super import)
Can always use the vimtutor
to help understand and learn how the vim text editor works.