Vim Tutorial

preview_player
Показать описание
In this tutorial you'll learn all the vim commands I use when coding. The video starts out with the basics and then introduces you to more intermediate/advance techniques.

#vim


----
#benawad
Рекомендации по теме
Комментарии
Автор

2:10 Opening VIM
2:59 Exiting VIM
4:15 Save without quitting
4:25 Move with h, j, k, l
4:55 Going into insert mode
5:05 Going back to command mode
5:11 dd for delete line
5:40 Use arrow keys to move (not recommended)
6:00 G and gg for top and bottom lines
6:46 {, } to skip blocks of code
7:30 Using numbers to loop command
8:20 u for undo and redo
9:22 Cntrl+r for redo
10:05 yy for copying line
10:17 p for pasting line below
10:24 P for pasting line above
10:44 using dd to cut a line for pasting
11:24 use V for visual line mode to select lines
11:55 Do stuff with selected lines
12:15 o for inserting the new line below
12:45 O for inserting new line above
13:30 d+<command> to delete characters
14:55 w to jump forward words and b to jump backward
15:25 :<num> to jump to specific line
16:01 0 for the beginning of the line and $ for the end of the line.
16:10 ^ for beginning word
16:40 W for jumping forward a word (ignore punctuation)
17:50 t+<char> and f+<char> to go to specific character in a line
18:22 % to go to specific block parenthesis
20:05 c+<command> for changing characters
21:01 D to delete from cursor to end of line
23:44 * to search for other instances
25:27 ; to go to the next instance of a character when using t, f
26:11 zz to center your page based on the cursor's position
27:10 a to insert from the right of the character, i to insert from left
27:36 A to insert from the end of the line, I to insert from the beginning of the line
27:52 x to delete a character which cursor is on
28:34 ~ to change the case of a letter
29:32 . to repeat the last executed command
33:01 r to replace a letter, R to go to replace mode
34:34 Commend combo to move a chunk of code from bottom to top
36:11 Commend combo to wrap a chunk of code
36:48 >> to indent line, << to unindent
38:21 macros
44:44 Rafactoring example
51:38 v for selecting chunks of characters
53:02 Cntrl+v to select in a block format
56:12 /<chars> to search for words in the document, n goto next occurrence
57:03 Removing multiple occurrences using macros
1:01:45 VScode Emulation
1:02:50 Rebinding <Esc> in VSCode
1:03:38 Chrome emulation

shreym
Автор

As a regular Vim user, the key thing about Vim is that it doesn't have what you consider "keybinds", it has a dialect where you tell Vim what you want to do. All the keys involved are words to build a sentence telling Vim what you want to do. Don't memorize the complex commands, memorize the keywords in the dialect and you should have an easier time in Vim.

d3w : Delete 3 word(s)
y3w : Yank/Copy 3 word(s)
3p : Put/Paste 3 (times)
dt" : Delete To "
3j : 3 lines down
di": Delete inside "..."
dG: Delete to the bottom of the file

Final suggestion, don't copy someone's config, build your own and add things when needed to get a better understanding, in addition to being more prepared for using it in server environments where nothing is configured.

jex
Автор

This is what learning how to tie shoelaces as an adult must feel like

lanorothwolf
Автор

You don't dig holes with bulldozers.

ajfromAZ
Автор

The mission-critical feature of this video is the display of the keystrokes in a large font. Well done.

bagoquarks
Автор

if you want to format code select the code with shift+v and hit = to make the code perfect.

zeocamo
Автор

i tried vim before, and i looked into some vim commands, but watching them in action and with some use-cases is just way better for learning, of course i will not learn everything by the end of this video, but just knowing that those commands exists is so helpful


thanks man!

gonzalochristobal
Автор

Saw this video about 15 months ago. I started using vim, then Linux, and then got down a huge spiral of knowledge. I found my love of computers and programming again. Thanks for sending me down this rabbit-hole :)

rcht
Автор

(I recommend everyone to try relative line numbering. It will give you absolute superpowers. For example, instead of going up and down the screen with j and k repeatedly, you just look where you want to go, enter the amount of steps needed (which is visible directly on the screen without needing to do any math), then just press j or k one time. It is magic!)

dawid_dahl
Автор

5:11 What you refer to "command mode" is callen normal mode. Command mode is initiated by pressing ':'.

mflayer
Автор

Best vim presentation I have seen: Font size and keycast just about right, and the warm sexy voice, nice and slow.

peacher
Автор

I really wanted to watch this video, but I couldn't exit vim.

Loppy
Автор

I'm only in the first 13 minutes and have already learned a lot. You're a natural teacher because you show what you do while doing it.

MrDavidablake
Автор

Started learning Vim a few days ago, and this video has been on the most useful bits of info. Thanks Ben!

awys
Автор

I found this video on my phone and I have finally escaped my TTY3 after seven years there in limbo. Thanks.

SP.
Автор

Your video either pulls in a new user for vim. Or seals the deal for a beginner user. I've been using it for a few months now. At least I thought I was"using" vim. I need to start makin notes. gg!!!!

abhinandanj
Автор

Oh my God I've been barely touching what's possible. I might dedicate a 3 hour block of my day tomorrow to practice. I've been using vim for over a year now. I can't wait to use some of the things I'm learning in this video. I'm going to be so much faster. I didn't know about 't'. I've been only getting better as I Google things. Thank you!

willd
Автор

The missing practical Vim tutorial!
Fantastic video Ben!

ablanchi
Автор

Ben, i actually started using vscode's vim plugin at work cuz of you. Thank you from Brazil !

LHFsmileface
Автор

20:50 G
21:02 D delete to the end of the line
21:20 C delete to the end of the line and put to insert mode
21:40 ct}
23:43 * find
26:11 z focus the screen where your cursor at the center
29:33 . re does the last thing you do
36:08 O

tuananhdo