When you compile a program and an error occur, the compiler will report the file name and line number with the error.
Usually, I use vi to access the file, then type “:line_num”, for example if I want to jump to line 123, I would type :123 after opening the file.
But there is a way to do that directly with vi by using +line_num. For example:
vi +123 code.c
To go to the last line, I would normally use the capital letter G when vi is started, but this can be done while opening the file as follows:
vi +$ code.c
One last tip: To go back at the top of the file in vi, simply use :0 or the capital letter H.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
|Support CNX Software - Donate via PayPal or become a Patron on Patreon|