How to use Vim, part I
A few days ago,@CodeLongAndPros received an anonymous tip, through his penguin minions, to write a tutorial about Vim. He will also stop talking about himself in the third person.
So, here goes!
Vim is a modal editor.
If you type dd in VSCode,
But in Vim, you'll delete a line.
This is because Vim has 5 modes. (You'll only use three 90% of the time). They are:
You'll have two options:
- Use Linux and install Vim
- Use my Repl
- Use GVim
If you go to my repl, keep in mind a lot of stuff, fun stuff, won't work.
If you use Linux you can do:
sudo pacman/apt/emerge/ynm/dnf install/-Syu/-a vim
If you use Micro$oft's trash, you can use GVim
After you've installed Vim, summon it with
$ vim ~/.vimrc
For NT, look at this.
From hereon out, I won't support NT. You're on your own.
When you invoke Vim, you'll see this:
Btw, the status bar at the bottom is custom.
Your's may or may not look like mine, but it'll be generally the same.
If you see some nonsense like
ggVGd, enter it as you see it
However, if you see someting in brackets, without a
\ before it, do what it says:
<ESC>: Press esc
<CR>: Press enter
<F5>: Press f5
cat in your Vim window.
Nothing should happen.
You should see this:
You have the text
Please enter the char
: in normal mode. You should see this:
Congrats! You just saved a file!
This one's a doozy.
Most people joke about quitting Vim:
There are a couple ways:
You can do
:wq to exit + save,
:q! to exit and not save
You can do
:x in place of
You can also do
ZZ to s + q and
ZQ to q.
Part II will come out soon!
The first time I opened vim I spent like literally 10 min just writing garbage in insert mode bc I had no idea that normal mode even existed XD I was just
:wq :q :x :fgjotfjkwosoxksbuwpqpqpqdkdbshisjssjheeeeellllppppmeeeeee
Hm I’m sorry if I’m being rude :/
Post | |-> Comment
If you reply to that comment:
Post | |- Comment | |- Sub_comment
But if you reply to
Post | |- Comment | |- Sub_comment | |- Actually replying to sub_comment. (Should be):" |- Actually replying to sub-comment.