user1058398 user1058398 - 2 years ago 233
Bash Question

Open file in intellij editor with command lines

I am using intellij with a git bash terminal on windows.

I can use vim to read a file, but what I would really like would be a command to open a file diretly in the intellij editor.
I did have a look on the official doc but didn't find anything about that.

Any idea how could I achieve that ?


Answer Source

From Working with IntelliJ IDEA Features from Command Line:

Opening file in the editor

To open file for editing. In the command line, type the following:

<IntelliJ IDEA> <path1> --line <number> <path2>


  • <IntelliJ IDEA> is the platform-specific product launcher

  • <path1> is the path to the project that contains the desired file

  • <number> is the number of the line, where the caret should rest

  • <path2> is the path to the file to be opened

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download