Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ: how to open files in an existing IntelliJ from the command line

I always have an IntelliJ running. Sometimes I want to open a file from outside IntelliJ. I can drag and drop a file to IntelliJ if am in the Finder, but if I am on the command line on OS X, how can I instruct IntelliJ to open a certain file? I am looking for something similar to the mate command provided by TextMate.

like image 365
avernet Avatar asked Apr 23 '10 02:04

avernet


People also ask

How do I open a IntelliJ file in terminal?

From the main menu, select View | Tool Windows | Terminal or press Alt+F12 .

How do I access files in IntelliJ?

Open settings by pressing Ctrl+Alt+S and navigate to Languages & Frameworks | SQL Dialects. and select directories or files for which you want to change a dialect. Click Open.

How do I open IntelliJ from command prompt?

Firstly add a path of IntelliJ till bin to an environment variable. This will open IntelliJ with a given path. Show activity on this post. (Re)creating the idea shell command from the Tools menu works for IntelliJ 2019.

How use IntelliJ command line?

We can open the terminal window with ⌥F12 on macOS, or Alt+F12 on Windows and Linux. The terminal supports all the same commands that the operating system supports. and press enter. When MongoDB is running in the terminal session, we can go back to writing the application code in the editor.


3 Answers

It's actually already implemented in the linux and OS X version of IntelliJ IDEA.

Tools > Create Command-line Launcher... 

Not sure it's available for windows.

like image 104
Timothée Jeannin Avatar answered Sep 23 '22 17:09

Timothée Jeannin


Edit your ~/.bash_profile adding the following, changing the path to version of IntelliJ you'd like to use:

alias "ij=open -a /Applications/IntelliJ\ IDEA\ 9.0.2.app"

Then from the command line, open files with ij your-file.txt.

like image 29
avernet Avatar answered Sep 22 '22 17:09

avernet


idea is the command you are looking for.

At least if you install "IntelliJ IDEA Ultimate", it will create the command idea by default in /usr/local/bin/

like image 26
Klas Mellbourn Avatar answered Sep 22 '22 17:09

Klas Mellbourn