Open a file with keyboard that is actual a dir - intellij-idea

I hate using mouse in IDEA editors, and what bugs me is that I can't find a way to open file that has been translated with Babel for example to ES5. The file has 2 sub files that are translated to ES5. So when I press Alt+1 I jump to Project view, find the file, press enter and instead opening file content in the editor it opens a folder tree.
How can I open file with the keyboard instead opening file directory?

You can always use F4 -- it's a standard shortcut (in Default keymap) to open file for editing.
In case if you need to assign another shortcut .. or find out what shortut it is in your keymap/OS:
Settings/Preferences | Keymap
Look for Main Menu | View | Jump to Source action

Related

PhpStorm open file and replace the previous

I have an issue with my PhpStorm 2019.2.5, when I open a file and I want an another file, the IDE replace the previous file.
I can't have more one file open :(
Can you help me ?
Accordingly to your screenshot (https://i.ibb.co/7bz3TSq/phpstorm.png) I do not see any editor tabs there which suggests that you may have disabled them (on purpose or accidentally). If you set to not to show editor tabs then IDE will work as if only 1 tab is opened -- that's the current behaviour.
To resolve it: go to Settings (Preferences on macOS) | Editor | General | Editor Tabs and set Tab Placement option to be Top.

How to close unmodified tabs when opening a new one?

There is a feature on Sublime and VSCode that consists on: When you open a file in a new tab but you don't modify it, that tab closes when you open a new one. If you don't want that tab to close, then you hit command+s so it remains open.
On PhpStorm and WebStorm, when you open a new file even if you don't modify it, it remains open when you open a new file.
Any ideas on how to get that functionality on PhpStorm and WebStorm?
The feature's name is "preview tab"
Ctrl + Alt + s | Editor | General | Editor Tabs | Enable preview tab
There is no such feature... Please vote for IDEA-124569 to be notified on any progress with this request.
You can use View/Quick Definition (Alt+space or Cmd+Y in default OSX keymap) to preview the file without opening it in editor.
You can also try playing with editor tabs preferences (Preferences | Editor | General | Editor Tabs), enable Close non-modified files first, for example.

In Intellij IDEA how to compare 2 text files that are not part of an open project

I would like to compare 2 files in intellij. Both files are not part of a specific project.
Is there a way to do so?
I am running Intellij 15 and 16.
The following works for me in IntelliJ IDEA Ultimate 14.1.7 on Windows:
Open the first file in the IDE (either by dragging from Windows Explorer into the window, or by File / Open).
In the view menu, choose "Compare With…"
In the "Select Path" dialog that appears, select the second file (either directly, or by dragging from Windows Explorer into the dialog).
It then opens up in the traditional file comparison pane. If you try to edit one of the files, it presents the usual "Are you sure you want to edit a file that's not in your project" dialog, which one can accept if that's what one is trying to do.
You can use the "compare with clipboard" feature.
From https://www.jetbrains.com/help/idea/2016.1/comparing-files.html#clipboard:
Comparing a File in the Editor with the Clipboard Contents
Open the desired file in the editor.
Right-click the editor pane and
choose Compare with Clipboard on the context menu.
View and manage
differences in the Differences Viewer for Files.
You can use intellij to compare 2 files/clipboard/blank text etc
Use command Shift+Command+A to search Actions
Type "Open Blank Diff Window" to compare random text
type diff for all diff options.
I use this on the command line (with IntelliJ IDEA CE on a Mac):
/Applications/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea diff ~/Junk/file1.txt ~/Junk/file2.txt
Window > Editor Tabs > Split Vertically
Is that what you're looking for? It's what I was looking for.
Worked for me on Mac OS High Sierra + IntelliJ IDEA 2018.3
- File -> Open
- Select file 1
- View -> Compare with ...
- Select file 2
To use intelli's difference comparison between 2 different files, you can use the Compare With (Right click the file in Project window). There is also an option to Compare File in Editor. To use that option, ensure one file is open and selected, then right click the 2nd file, clicking Compare File in Editor

One-click file opening in AppCode like in Xcode

Can we set AppCode to open a file with one click? The default is two click like on non-macOS systems.
It would be more natural for those used to opening files with one click in Xcode.
In the gear menu for your project, select 'Autoscroll to source'. From the documentation:
If this option is on, AppCode automatically navigates from a file (or a class member) selected in the Project tool window to the corresponding source file (or its fragment) in the editor. If the corresponding file is not currently open, it will open automatically.

Is there a shortcut to delete the currently open file in PHPStorm?

When I navigate to a file deep in directories with Ctrl+Shift+N, I see that the file can be deleted, so I navigate to the project pane, and open all the nested directories and then finally delete the file, which is annoying.
Is there a keyboard shortcut to just delete the file currently open in the editor?
Yes, there is:
Press Alt+Home to focus the navigation bar. (⌘+↑ on Mac)
Then press Delete. (⌘+⌫ on Mac)
Even if the navigation bar is turned off, it'll pop up over the editor window.
External tools can solve this.
Create an external tool. The program to run is rm, and for the parameters use the $FilePath$ macro. I also tell it not to open the console.
Add a shortcut in keymap to this external tool to quickly delete the current file open in the editor.
Is there a keyboard shortcut to just delete the file currently open in the editor?
No -- wrong context. "Delete" will work with file when in the right context (e.g. Project View); when editing file (Editor is focused) it will be just deleting text.
so I navigate to project pane, and open all the nested directories and finally delete the file, which is annoying.
Navigate | Select In ... | Project View (Alt + F1, 1 on Windows/Linux using Default keymap)