Okay, let's talk about VIM.
It all started with VI, which stands for visual.
It was released in 1976 as a screen-oriented editor for the operating system.
And screen-oriented was pretty new and pretty awesome in 1976, because most editing on computers
was line-oriented in those days.
In the 1980s, VIM was introduced as the improved version of VI, and it has replaced the original
VI command, even if you can still find VI on some minimal Linux installations.
As command-line work in the 1970s was line-oriented, not screen-oriented, VI was developed with
advanced features to program text file modifications.
And because of these advanced features, which are very convenient, VIM is still a very frequently
used editor.
As a best practice, I can recommend using Nano to edit text files in an easy way if
it's new to you, and use VIM if you want to edit text files more efficiently.
Now one thing you need to be aware of while working with VIM is that different modes are
available in VIM.
Command mode is the default mode after starting VIM.
And in command mode, well, you can enter commands.
If you want to get in command mode if you're not currently there, press escape.
And that is convenient because when you enter text, you will be in insert mode.
Insert mode is where you can type your text, and nothing will be interpreted as a command.
And if ever you want to get into insert mode, use I or one of the alternative commands.
Now this is a challenging thing, or one of the alternative commands, because in VIM,
there is often a couple of commands available to do something.
My recommendation, be a VIM minimalist.
And about just one way to get where you want to go, and all the other things are not that
important.
Now after inserting text, don't forget to get back to command mode to save your text
and exit using a command like colon WQ exclamation mark.
Let's do a quick demo.
So I'm using VIM on new text, which will create a file with the name new text.
If you look at the screen at the lower left corner, you can see new text new, and in the lower right
corner, you can see the current curve or position.
And anything I'm typing right now will be interpreted as a command.
So I'm typing a G, nothing is happening, and that's because I'm in command mode.
So if I want to type text, I need to press I for insert mode.
So now I'm in insert mode.
And once I'm happy with it, I want to save my changes.
I press escape, and then I'm back in command mode.
But back in command mode, I need to tell VIM what I want to do.
Well, at this point, I want to write and quit.
Have a look at the left corner where we can now see colon WQ exclamation mark.
Colon is just there because the command starts with a colon.
W stands for write, Q stands for quit, and exclamation mark means that VIM shouldn't
complain about anything if it's not really necessary.
And the result?
Well, the result is that now we have a file with the name new text.
As you can see, here it is, and it has a size of 23 bytes in total.
Now, as I told you, be a VIM minimalist.
But what I'm showing you right here is really not very much.
So let's talk about some advanced VIM options as well.