Reputation: 171381
Most editors allow you to pass an argument when opening a file from the command line to go to a specific line number (and column) in the file.
How can I do this with Atom?
Upvotes: 21
Views: 11670
Reputation: 1977
Atom can open files and go to a specific line/column from the command line by appending :line_number
or :line_number:column_number
to the file name/path.
Examples:
atom README.md:58
atom README.md:57:5
atom myproject/Makefile:5:2
If the file is already open, it will move the cursor to the desired position.
If the column is omitted, it goes to the first column. If the line/column is greater than the number of lines in the file or columns in the line, it goes to the last line/column.
Upvotes: 10
Reputation: 655
Atom commands are similar to Visual Studio and sublime text in this scenario. First press the Ctrl+G in your keyboard then you will redirect to command line in the Atom editor, then type line number to navigate that line Number.
Upvotes: 22
Reputation: 1218
The proper format for doing this is the following:
filename.txt:linenumber
example:
atom /your/path/to/the/file.txt:208
Upvotes: 14