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

Lines - vi Tutorial

From the course: Learning Vim

Start my 1-month free trial

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…

Contents