Jump to Line

It’s very common for shell tools to print out file names followed by a line number seperated by a colon. A common example is the gcc error message:

% gcc -c test.c
test.c: In function "main":
test.c:176: error: "baz" undeclared (first use in this function)
test.c:176: error: (Each undeclared identifier is reported only once
test.c:176: error: for each function it appears in.)

As you can see, the error is in file test.c on line 176.

As far as I know, no editor supports this format for opening files and jump to the according line directly. Therefore I have written a little script which splits up the given arguments and calls vim with the given filename and let it jump to the given line number.

The script is part of fooktils. You can download the script from the git repository.

↑Back to top