Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shortcut Key to copy full file path in JetBrains IDE (PhpStorm, PyCharm, WebStorm etc..)

Is there any Shortcut Key or Option to Copy the full file path on which you are working?

Like: /var/www/html/code/info.php or /code/info.php

Thanks

like image 381
Surya Avatar asked Dec 25 '13 12:12

Surya


People also ask

How do you copy an entire line in PyCharm?

Duplicate the current line or selectionPress Ctrl+D or choose Edit | Duplicate Line or Selection from the main menu .

Where is the file path in IntelliJ?

You can also search for action with (Ctrl + Shift + A) (for mac Command + Shift + A) and then it will show you the Keyboard shortcut for particular action. If you want to change the Keymap you can open setting page and search for Keymap. Which is also shows the file path.


2 Answers

Right click on editor tab or on entry in Project View and choose "Copy path" action.

Alternatively: Edit | Copy Path Ctrl + Shift + C


If you need it to be relative to the project root -- use Copy Relative Path action instead.

Please note that this action is context dependant: when focus is on file (e.g. in Project View or some popup with files) it will be "Copy Relative Path" ... but when invoked inside the editor .. it will become "Copy Reference" (and will copy Class/Variable name etc).


Another option is to use custom plugin that provides such actions. There are few that can do that and more (even if invoked right from the Editor).

like image 76
LazyOne Avatar answered Sep 18 '22 13:09

LazyOne


It is strange, but in the latest version, JetBrains removed this option from the context menu (right-click on the file name tab) + removed from the Edit top menu.

So the alternative is to use triple-click on the shift + type copy path there.

like image 40
Andron Avatar answered Sep 19 '22 13:09

Andron