Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Go to line in Atom editor from command line

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?

like image 480
D'Arcy Rittich Avatar asked Apr 06 '15 14:04

D'Arcy Rittich


People also ask

How do you jump to a line in an Atom?

Move the cursor to a specific line in the editor using ctrl-g.

How can I open the Atom editor from the command line in Windows?

You can open the last active terminal with the atom-ide-terminal:toggle command (Default: ctrl-` ). If no terminal instances are available, then a new one will be created. The same toggle command is used to hide the currently active terminal. From there you can begin typing into the terminal.

How do I start an Atom from the command line?

To enable opening Atom from the command-line, you will need to install shell commands from the either the Atom menu or the Atom Command Palette. In the Command Palette, search for “Window: Install Shell Commands”. To open a specific directory into the Project Explorer, you can add a path argument to the atom command.

How do you navigate an Atom?

To go up and down a single character, you can use Ctrl+P and Ctrl+N . To go left and right a single character, you can use Ctrl+B and Ctrl+F .


2 Answers

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.

Command Line for Atom

like image 173
Pavan Avatar answered Oct 17 '22 22:10

Pavan


The proper format for doing this is the following:

filename.txt:linenumber

example:

atom /your/path/to/the/file.txt:208
like image 26
Steve Ross Avatar answered Oct 17 '22 22:10

Steve Ross