How to open files in Intellij-IDEA with double click? - intellij-idea

My first day using this IDE...
is there a way to configure the IDE to open files in the project by double click? It is rather painful having to drag files from the project overview into the editor window.

You can change the KeyMap.
Go to File->Settings and find the keymap section.
You will have to create a new KeyMap by clicking copy, and then look in the View section for "Jump to Source" and change/add the keymap you want.
However, as Bozhidar Batsov noted, double clicking may not always work so well. Whether it works may vary by OS and/or windowing system. I have no trouble with it in Mac OS X, but it doesn't seem to work well in openSUSE.
There are also other predefined keymaps that you can select from this settings screen. They're set up to resemble other IDEs, so you might find them helpful if you're transitioning from something else.

It is easy way to do in windows.

I found a great solution to this problem by Jelmer Kuperus over at Orange11.
Create an .Xresources file in your home directory. Add the following line:
*multiClickTime: 400
Jelmer explains that this setting changes the default double-click speed from 200ms to 400ms, effectively slowing it down. Save the file and then run:
xrdb ~/.Xresources
The effect is immediate, no need to logout or reboot. Double-click in Intellij works as expected. I did try changing the mouse double-click speed in System Settings first before trying this out to see if that made a difference but it did not.
I am using Ubuntu 11.04, Intellij 10.5.2, and Sun JDK 1.6.0_26. YMMV

Use F4 to open quickly the selected files. Btw double clicking on files should work as well(at least in theory). Swing's buggy handling of such events, however, causes the double click to not always work in IDEA, so I eventually stopped double clicking and switched to using F4. You can also use "Autoscroll to source" from the projects menu - this will open the source files as soon as you select them in the project browser.

Related

Change default tool window behaviour in IntelliJ IDEA 2016

Every time I open a new project in IntelliJ IDEA, the first time I open a particular tool window, for example 'Maven Projects', it appears in 'pinned' mode and remains visible until either I close it, or I go to the view settings for the window (the little cog) and deselect "Pinned Mode". I don't want any of my tool windows to be pinned so this gets a little annoying.
Do you know of a way to change the default behaviour of new project / tool windows?
As far as IJ 2016.2 I don't know about a dedicated setting for this. However I used an approach which allows you to define a default layout for all projects. Although the window-pinning works, which is what this question is about, some may not be persisted, such as Group Modules setting in the maven tool-window.
Nonetheless, to configure the pinning, you need to do 2 simple things, which you can also see in the GIF below:
1) Manually go and unpin all desired windows
2) Open the Windows menu and select Store current layout as default
P.S. If you'll be using tool-windows that you've never opened before, or install new plugins which add their own tool-windows, just follow these steps again.

Can't type in IntelliJ

I'm using IntelliJ IDEA on my Mac to work on a project, and I keep on coming across an issue where I can't type. Occasionally when I switch to another application and then switch back to IntelliJ I can't type anything, and the cursor doesn't appear on text when I click on things. Does anyone know what causes this? After 1-2 minutes it goes back to normal, but it's started happening more frequently and it's pretty frustrating to not be able to type and have no way to fix it.
This is the version of IntelliJ I'm using:
IntelliJ IDEA 2016.1.3
Build #IC-145.1617, built on June 3, 2016
JRE: 1.8.0_76-release-b198 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Turn off Vim Emulator from Tools in the IntelliJ, like this picture:
I am encountering this issue aswell, ...
MAC os Mojave 10.14.2, Inteliij Community 2018.3.5
Aside from restarting / clearing caches, I found that cmd + leftShift + F still opens the search window, and all my keystrokes appeared in the searchbox!
After the searchshortcut, I was able to close the searchbox and work again!
The answer here helped me https://intellij-support.jetbrains.com/hc/en-us/community/posts/206152119-Can-t-type-in-editor-window
Quoting the author of the answer:
I had the same problem. It goes away after I click the icon at top of
the scroll bar. it happens frequently on windows 7/10, and
occasionally on mac. my colleagues said they have experienced it too
Have the same issue occasionally, can't type in any Intellij windows. My temporary/quick fix, is to:
Close any terminal windows in intellij
Use cmd+shift+f to pull up the search window.
Seems to fix it, for a while.
Closed IDEA, all IDEA projects! Even though in other IDEA windows I could type.
Removed .idea folder in the project I could not edit.
Restarted IDEA.
Then I was able to type!
Maybe you entered Vim emulator as said. Maybe only by mistake :).
Control-V is a frequently used shortcut. And Control-Alt_V is the shortcut to enable Vim mode so you can see the problem...
How to know in five seconds: type a ":" (colon) and if the cursor jump to end of the screen, that is vim. If so enter q to quit and then Control-Alt-V (on windows) to go back to IDEA standard mode.
vi is a powerful text editor since ever. But only if you pretend and know how to use it... There is even a warning on the IDEA install saying like "do not install unless you are familiar with Vim" in yellow bold text, iirc.
[Follows historic data, that you may find boring off-topic or interesting]
Today's editors opens the code in edit mode right away so you can start typing over existing code. Vim by the other hand opens the code in, let us say, browsing mode: there is a set of navigation keys to browse the code. Everything you type is supposed to be a command. When you want to edit you enter INSERT mode and then you can type new text. Only then.
Just for more historic data: vi navigation mode is great for studying code you do not know, using IDEA, since it does not change the text unless you tell it to, and some vi commands are clever.
One example:
"/" (forward slash) is one search command, and "z" is a smart scroll command so that:
/setCellFactory will search for the next match of "setCellFactory" and put the cursor there
Then if you type "z" the code will be positioned so that line is the first on screen. And if you type "." the line will be at the middle. And if you type "-" that line will be at the last position at the screen. And you can use these commands again and again. And new slash will go for the next match, like F3
This "z" thing is a feature I miss in Visual Studio, IDEA, Eclipse, Word, WordPad: these commands to scroll text AROUND a pattern... /pattern, z, z., z-. The alternative is the mouse wheel...
I am used to vi since the 80's and is the editor I still use today on Linux terminals so when this happened to me on IDEA I was lucky to remember and suspect of that on the first time.
Sorry if these details are boring
Ensure you haven't unintentionally enabled vim emulation. Go to IntelliJ Idea -> Preferences and select Plugins. Scroll down and look for the vim emulation plugin and if it's checked, then either uncheck it or uninstall it completely.
Ran into same issue with intelliJ 2017.1.2, but no VIM Plugin. However, I had just created an empty project with some .groovy files. I could edit the files in the groovy project, but not java projects.
Only way I could fix java projects, was blow-away workspace.xml files in each, then I could edit again. However, had to re-create tomcat configs, breakpoints, other IDE settings. etc.
I had a problem with entering characters when working with .story files. When I tried to type in any character, it appeared for a short while and immediately disappeared. The cause of the problem was jbehave plugin I was using. After uninstalling it and restarting IntelliJ everything was fine.
It seems to be because another window has the cursor and is not giving it back.
Check any open floated windows, click on them & then click back to your intellij instance
alternatively, if you have multiple intellij instances open the cursor could be there...
Go to the most recently opened IntelliJ instance
Check if the cursor has become stuck in that project's terminal window, or another window
no? check all other open IntelliJ instances
For me it happened because of vim
Om Mac, I solved it by navigating to File → Reload All from Disk.
Keyboard shortcut: ⌥ ⌘ Y
IntelliJ IDEA 2020.1.4
Try disabling plugins one at a time. It was the "BashSupport Pro" plugin that caused it for me. Disabled it and I could type again right away.
I read other comments saying some other plugins caused the issue as well.

IntelliJ IDEA 14 Copy and Paste not working with other applications

Couldn't find the simple solution on SO, so thought I would add this here for anyone looking in the future.
My symptom was that I could copy and paste within the IJ editor, but not from the editor to another application or from another app to the editor.
This was on Windows 10 with IntelliJ IDEA 14.1.6.
I have found the best solution yet (for me in any case). I have tried everything! Including adding and removing Keymap options. And this is actually where the problem lies...sort of.
When you have the Vim plugin installed, Ctrl + c and Ctrl + v is allocated to Vim.
To change that, go to Setting>>Other Settings>>Vim Emulation and set the Handler to IDE. Apply and OK, and Voila!
My solution (thanks to a similar issue reported with Android Studio) was to run IntelliJ as an admin.
Steps to always run IntelliJ in admin mode:
Right-click on IntelliJ icon in start menu search (or wherever you started it) -> Open file location
Right-click IntelliJ shortcut -> Open file location (yes, again to get to the .exe, not the shortcut.)
Right-click idea.exe -> Properties
Compatibility tab -> check Run this program as an Administrator
Right-click idea64.exe -> Properties (if you run IntelliJ in 64 bit mode)
Compatibility tab -> check Run this program as an Administrator
Same problem drove me completely insane but this
https://www.quora.com/Why-doesnt-Ctrl+V-and-Ctrl+C-work-in-IntelliJ-IDEA-14-0-2-on-Linux
worked for me:
You might try Ctrl+INS for copy and Shift+INS for paste and see if they work. They are the traditional cut and paste and have been around a lot longer than Ctrl+c/Ctrl+v.
i don't know why, but this worked!
To make copy/paste through shortcut keys working with Vim Plugin you need to change some settings of Intellij IDE's editor regarding vim emulation, you need to follow these steps for it:
Click Menu File > Settings... (or use shortcut Ctrl + Alt + S)
Select Editor -> Vim Emulation and find the shortcuts and change their Handler column value to IDE as shown in the screenshot below.
The Shortcuts will start working, happy coding :)
Another solution i've found
https://code.google.com/p/android/issues/detail?id=173201
was:
Try to minimize Idea window and move it on the same monitor where is the code that you want to copy and paste it. After this small minimize and move exercise the clipboard starts working.
Ctrl-Shft-V starts working after this for me!!!!!
Try to enable "Use national layouts". Settings- Keymap.
For some reason it worked for me.
PyCharm - Setting>>Vim Emulation Set - Control + V/P/A to IDE

IntelliJ IDEA - Key board right click doesn't work

I am using IntelliJ IDEA Ultimate v 13.1, and I am fond of using key board short cuts, rarely use mouse. I am relatively new to this IDE as earlier I always worked on eclipse.
My question is about performing right click operations by pressing the right click key on key board (usually found near the right side Ctrl key on external key boards). The problem is when I press this key, nothing happens but when I click the mouse right click and things just happen. This is applicable on editor, project explorer and I guess everywhere in the IDE.
Is there a switch I should turn on and it will work or any other way to get key board right click work in IDEA? Thanks very much for your responses.
I know it is an old question, but it popped up as 1st result when I searched for my issue, and I figured it out with some of the context in Ketan#'s answer.
Fix:
Go to File -> Settings -> Keymap
Search for "Show Context Menu"
Add a new keyboard shortcut. When prompted, press the "right click" (aka "context menu") key.
For me, It simply works after just restart the IntelliJ IDE
Sometimes accidents just happen for good! This one falls in that category :)
Somehow IDEA was unable to load any of my projects, and I thought of deleting '.IntelliJIdea13' directory from my user directory. Initially I didn't change my keymap (shortcuts) to Eclipse and right click just works fine.
In any case the problem is there for IntelliJ to fix. They should allow right click from keyboard to work even when shortscuts are mapped to Eclipse style.
I tried to change the shortcuts to Eclipse and keyboard right click stopped working. When I change it to default, it starts working.
If you was installed it with jetbrains toolbox you can't made it easily.
I made a script written in php but you could adapt it to other languages:
https://gist.github.com/firegore2/0ba76d74f070b07eda5a12f3f24ba054

Intellij ignores the selected keyboard layout

This seems like a bug in IntelliJ 12: Every couple of times when I switch between keyboard layouts (English and Hebrew) IntelliJ get stuck on one of them and ignore the windows selected keyboard layout. This happens only for intelliJ, all other programs respond as usual to the windows selected keyboard layout.
Is there at least a workaround, or a way to reset IntelliJ's keyboard layout? The only thing that seems to work for me so far is restarting my machine...
(My OS is Windows 7 Enterprise 64bit)
This is 100% reproduced when you switch keyboard layout in quick class search (Ctrl+N). Also in intellij idea 13.
Something like:
Open quick search menu when keyboard is not in English layout (Russian e.g.)
Type anything
Switch to English
Congratulations! you stuck in russian layout :) restart your intellij idea!
When I ceased to switch layout in search, I forgot about this problem.
UPD: it's suitable for most part of text inputs (even for search and file creation)
I've just had this problem on PyCharm 2020.2.3
Here's how I've solved it:
Go to Settings -> Keymap
At the bottom of the window, check the option Use national layouts for shortcuts (require restart)
That did the trick
restarting IntelliJ also works.
I wonder how they managed to get such a stupid bug, this is not an easy bug to write, especially in Java.
That was found to be more like a global Microsoft/Oracle bug. Simple workaround from IntelliJ's issue tracker: use Windows' language parameters to assign a hotkey (Ctrl + number) for changing the layout directly to a desired language. This suddenly will affect both Windows And IDEA. It's said that bug was fixed in Win8. A bit more info: here
In 2020 bug is still relevant in the most IDEs based on IntelliJ. For example I observe this in PyCharm now.
There is workaround for Windows:
Go to Language Bar - Settings... - Advanced Key Settings
Set key sequence of To English action to Ctrl + 1
Set key sequence of to other your language to Ctrl + 2
Apply
Go to IntelliJ/PyCharm and switch language by new sequences
After that bug disappears and you can switch language by traditional method
For me the following actions seem to resolve the issue:
Go to Control Panel
Select Clock, Language & Region
Press Region
In the opened window choose English for Format.
Also all my settings except the location are set to English (locale, default keyboard etc.)
This fix worked on my mac, access Preferences -> Editor -> Typing Corrector from the intellij IDEA menu. If you are able to navigate to the same window on your OS, you can try this.
Uncheck Enable keyboard layout correction in the Typing Corrector window
I got the same issue in Ubuntu 16.04. Restarting IDEA doesn't change anything. But Changing the default layout to be the one I want by default ensured ubuntu work well with it.
Go to the search textfield above file editor.
Switch layout.
Type smth.
Click somwhere in the file editor.
Write smth with swithed layout.