open file outside of project in Intellij IDEA - intellij-idea

Would specifically like to edit /etc/hosts without leaving the Intellij window. How can I open this file while working on some arbitrary project in Intellij?

Clicking on the File menu (Left hand corner) then clicking Open does the trick, just like most applications.
To set a shortcut for that File Open click you can click on File then settings (Ctrl+Alt+S) and then under Keymap search for File Open. Right click open and you should see the add shortcut dialog. I'm a bit surprised there isn't a default shortcut for this.

Related

View file in project view Intellij

I have started using Intellij and I am trying to find a feature that was in eclipse. I often navigate to a file either through the code or through a CTRL-N search. When I have the file I found open, I want to see which project and which folder of the project the file is in. I found a way to open the file in Windows Explorer which tells me what I want but I would rather stay in intellij and see the folders on the left expanded to the location of the file. Does this exist in intellij?
Thanks
On the heading of Project Explorer panel their will be a circle with 4 lines inside it.
Press that it will take you to the place where you file is inside the project
Image upload not working thats why explaination

How to reformat all the open files in IntelliJ

Is there any shortcut to reformat the code in all the open files in IntelliJ? I'm specifically looking for a way to reformat all the open files inside editor and not all the files in project.
The closest that I could recommend is to select the root folder from the project explorer and press alt+command+L(MAC OS). Reformat Code window pops up. In the pop-up, select the scope as Open files and Click run. It formats all the open files
Intellij Documentation -->https://www.jetbrains.com/help/idea/reformat-and-rearrange-code.html#reformat_module_directory

Change home directory for opening projects in IntelliJ

I've been searching around and confused with the results here as the others here in stackoverflow are saying its not possible or is via the vmoptions file. But all I wanted was just simply change the projects home directory showing when I'm opening my projects as I have to navigate too many folders just to get to my directory where all my projects are. Hence I'm posting this question.
To do so, after opening IntelliJ with any existing project,
Go to File > Settings / Ctrl + Alt + S
On the left pane, navigate to Appearance & Behavior . System Settings
Find the Project Opening section, and then click the folder icon to find the directory to set the new home directory for opening projects.
Click Apply
Then you'd now be able to automatically navigate to this directory whenever trying to open your projects folder.

Add shortcut to open specific url in browser - Intellij Shortcut

I want to add Shortcut to open specific URL (let say localhost:3000) in IntelliJ. I read the documentation and try to figure it out on my own by messing around the Keymap, but No luck. Is this possible? What I want is to create a shortcut to open specific URL. If my custom shortcut is Alt +; then it should open http://localhost:3000. Is this feasible in IntelliJ?
Yes you can do this with the following steps...
1. Define an external Tool for Localhost
File > Settings...
Tools > External Tools
Define your Tool with
Program: C:\Program Files (x86)\Google\Chrome\Application\chrome.exe (in Windows 10)
Arguments: http://localhost:3000
2. Define your shortcut
File > Settings...
Keymap
Choose External Tools > Localhost on the right side
Right click and choose 'Add Keyboard Shortcut'
Type your Shortcut
You should see it in the dialog
3. Use the Shortcut
Hope it helps.

intellij usability question - how to add a button that opens working folder

There's a small feature I have been yearning about in intellij idea and I will give it a try in this forum, maybe it is already possible.
In brief: I want a button that opens the working folder of the project I am working on.
Since this is the folder I put my settings files I am doing the following operation dozens of times a day -
open the run/debug configuration.
go to my activbe project tab.
copy the working directory.
open run (win+r).
paste the folder path and press enter.
X dozens of times.
Is there a way to add a button somewhere that opens my working folder?
BTW: I know that in the project settings - External tools - I can add actions. but there is no workingFolder in the macros. is there a way to add the working folder? (eventhough a button would be better)
Thanks a lot.
If you need to manage files, why not do it right from IntelliJ? If you have to go to explorer, right click any file or folder in the project panel, and there's a "Show in Explorer" option in Windows (no default key mapping). There's also "Show Path" (ctrl+alt+F12), which lets you open Explorer to any parent directory of the selected file all the way up to the drive. Finally, "Copy Path" (ctrl+shift+C) will copy the absolute path to the clipboard. (This is in IDEA 10.5, but I know Copy Path has been there a long time.)