Open a file in Intellij - externally

Hello all,

Say that the Intellij (5.1) is running and we want to make is open a file using the command-line.
How can we do this?

In particular, we are interested in having a quick navigation from the Perforce-client to the Intellij: clicking a button at a selected file in the P4Win will open it in the Intellij.

Thank you,

Rami

0
5 comments

You can accomplish this with the "External Tools" (Settings | IDE Setting | External Tools) feature to execute a program that takes the current file as its argument (there are several macros available, most likely you need the $FilePath$ macro). With the Customizations feature (Settings | IDE Settings | Customizations) you can add your external tool definition e.g. to the main toolbar or wherever you'd like it.

Sascha

0

What I meant is a little different:
*Not *to open the current file/dir of the Intellij in an external tool...
But, having an external tool on focus (e.g. P4Win) "push" its current selected file into the Intellij so the Intellij opens it.

Thank you,

Rami

0

Sorry, I didn't read carefully enough. AFAIK, IDEA doesn't have such a possibility out-of-the-box. Maybe there's some plugin around (IIRC, there was one for earlier IDEA versions named "FileAssociations", http://www.intellij.org/twiki/bin/view/Main/IDEAFileAssociations) that works or you can use as a start for an own plugin.

Sascha

0

I think the FileAssociation plugin does that, it registers IDEA as the default app for java files, so doubleclicking one would open it in IDEA. Haven't tried it, though.

HTH,
Andrei

0

Please sign in to leave a comment.