From the course: Learning Vim
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Lines
- [Instructor] Sometimes we like to move to a specific line. This is common for example, when you have an error in your program. For example, assume you see the following error when trying to compile the code program. This is a very common output from compilers. We have the filename, we have the line, and, we have the column that the error happened. Another error is in line eight. So, I'd like to go quickly there. If you open the file, vim hello.go, and then you can type :8 + Enter. This will bring us to line eight. Here we can start fixing the code. Another way, is to type the line number, and then, copy the little g. Move back to the beginning of the file with g + g, and then, eight and Shift + g. And, we're back in line eight. You can use $ to move to the end of the line, and, zero to move to the beginning of the line. Use $ to move to the end of the line, then i to go into insert mode, and, we'll fix the problem. Change it to double quote, instead of single quote. Then, to save…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Navigate using keys: H, J, K, L1m 11s
-
(Locked)
Words, sentences, and paragraphs1m 46s
-
(Locked)
Challenge: Find word19s
-
(Locked)
Solution: Find word31s
-
(Locked)
Regular expressions1m 56s
-
(Locked)
Challenge: Search word8s
-
(Locked)
Solution: Search word14s
-
(Locked)
Screen movement47s
-
Challenge: Move screens5s
-
Solution: Move screens12s
-
(Locked)
Lines1m 40s
-
(Locked)
Challenge: Move lines14s
-
(Locked)
Solution: Move lines16s
-
(Locked)
Current word59s
-
(Locked)
Challenge: Find next instance of word23s
-
(Locked)
Solution: Find next instance of word22s
-
(Locked)
-
-
-
-
-
-