Intellij idea quick defenition - intellij-idea

In eclipse when I mouse over a variable I see it quick defenition, when I mouse over with shift pressed, I see full defenition. But in idea, I always need to press some keys to do anything. Is there a way to simplify those tasks in idea?

The quick definition features is accessible with the shortcut ctrl + shift + I.
I don't think it's possible to access to it on a key + the mouse over.

You can edit the idea.properties found in the bin folder of IntelliJ application and add this line:
auto.show.quick.doc=true
The
This will give you the JavaDoc when hovering over a variable:

Related

CLion code navigation with C++ doesn't work

I've used AppCode (Intellij C++/ObjC IDE that replaces Xcode) for a while and really gotten used to being able to Ctrl+Click on any identifier to get to its definition/decleration.
Now on a new work place, I'm using CLion for a somewhat larger code base and Ctrl+Click hardly ever works. It only seem to work when the identifier is in the same file.
Is there anything I need to setup for this to work correctly? CLion seem to index the code successfully and doing text searches works fine.
You need to use import project functionality of CLion from File -> Import Project and give ok for CMakeLists.txt file automatic creation. Never mind the file is for CMake, you can build your project with other tools too, but CLion uses it for the dependencies.
Then append in the beginning of that file a line stating:
include_directories(.)
After that go to File -> Settings and there search for Keymap from the left and after that on right, right below the word "keymap" there is a selection element for taking for example Eclipse default keymapping in use and there you have at least (I tested only it) the ctrl + click functionality working like charm!!
kudos about the include_directories(.) goes to this question: CLion indexer does not resolve some includes in the project directory
You need to press ctrl + alt + shift + n.
And after pressing it a dialog box will appear to enter your variable/function name and click enter.
Tip: Filter the result for a better experience. Filter option is present on right side of the dialog box.
To get a quick peek of function/variable definition press ctrl + q while focusing on the variable or function.
To get the detailed or full definition of function press ctrl + shift + i while focusing on the variable or function.
I just looked at one of my more complicated teaching examples with multiple header/source files where this would come up.
What I see is that ctl-click (and the red/green arrows in the gutter) does work only in the same file. But I can right-click on a method from another file and choose to go to either the declaration (in header) or definition (in cpp).
The hotkeys to do this are not ctl-click. But you can remap hotkeys in IntelliJ ides, so you may be able to come up with hotkey combinations that don't seem too awkward to you.
What helped me was to run File > New CMake Project from Sources
Until that point, Ctrl+click in CLion would go to the definitions, but wouldn't find any usages.

IntelliJ IDEA Rebasing Commits window keyboard shortcuts

I very often do rebasing from IntelliJ IDEA as it is more convenient than command line.
There's one issue though. In the following window:
I have no idea how can I choose Action using just keyboard. Is this possible?
IDEA's documentation does not mention any shortcuts at all, but e.g. CTRL + D or ALT + UP/DOWN work for me there.
Issue is still opened on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-153448

How do I copy and paste the tooltip error message that pops up in IntelliJ IDEA?

IntelliJ IDEA automatically shows a red line if it cannot resolve some entities or it detects an error. Is there a way to copy and paste the content of that tooltip?
With eclipse I use the f2 to get the information.
I used the idea version 14.1.4 and use this way to copy the tooltips.
You can click the error line and the info will display, now you can right click to copy this error info.
Mouse shortcut:
Hover mouse over error in editor to bring up tooltip
Alt + click on error message inside tooltip to copy it to clipboard
For step 1 you can also bring up the tooltip for the current carret position by Ctrl + F1. For step 2 there does not seem to exist a keyboard shortcut at the time of writing (for IntelliJ 2018.1), see also IDEA-65636.
If you stumbled upon looking for solution for Linux version (and none of the above worked for you, like for me) click ctrl+alt+left mouse button on the tooltip, and you'll get its content into the clipboard :)
No, the tooltips don't offer a way to get that information from their context alone.
You could traditionally compile it instead via Build -> Compile and get the error message that way, instead. You can then select this text and do with it what you wish.
There is a bug report on this since 2011 (!) . Feel free /encouraged to vote for having the bug fixed:
https://youtrack.jetbrains.com/issue/IDEA-65636
IDEA-65636 I can't copy text from tooltip, though I can select it
Though honestly JetBrains infrequently gets around to non super critical bug fixes.

Shortcut for locate current file in Project Explorer in IntelliJ?

I read this post:
Locate current file in IntelliJ
Still the problem is that I do not want to have Autosccroll from Source enabled because my Project Explorer will be jumping up and down. Rather I need a shortcut to locate the current file in the Project explorer when I need to. ALT + F1 does work but you need to select from a context menu where you would like the file to be shown. In Resharper for example the shortcut is ALT+SHIFT+L but I am not able to find such a shorcut in IntelliJ?
There is no shortcut for this action in IntelliJ IDEA other than Alt-F1.
There is no default way of doing this.
I can think of 4 options:
You can install the plugin 'Scroll From Source' which will allow you set such a shortcut in the keymap settings (Default: Meta + Ctrl + S)
Use the target symbol in the project explorer, no shortcut but is default option.
Get used to having to press Alt + F1 and then Enter
Record a macro for the above key presses but this may be unreliable. You could then assign a shortcut key to play this marco.

how to return run default content for intellij

I used one of the best shortcuts for Intellij:
Ctrl+Shift+F10
And it runs default content, which will be open.
I don't know how, but now it really do nothing.
All other short cuts are ok. And this one is dead (doesn't work anymore).
How to return to this useful short cut (or general set to Intellij default)?
Well since you have a psvm method, and your focus is in the code for that class when you press the shortcut, and given your caps key isn't on, then you should see IntelliJ try to make before running your code.
Do you see it Making ?
If not, it's likely another plugin or action has stolen the key shortcut.
Go to Settings -> Ide Settings / Keymap, and type RunClass in the search box.
You should see this: Run context configuration -> Ctrl + Shift + F10
If the key shortcut is missing, assign it.
Hope this helps.
P.S. I was recently using the Haskell IntelliJ plugin which conflicted with this shortcut. Disabling it did the trick to restore it.