Line-Comment shortcut on german keyboards - intellij-idea

What is the equivalent of CTRL + SLASH on german keyboards?
I know that US-Layouts got that / where the german _ is, since I used an US-Layout for some time. But CTRL + _ just collapses a method.

Just use the slash (Ctrl + /) on the numpad.

I found a solution for using the desired shortcut on Intellij Idea.
You just need to:
- click Ctrl+Alt+S to open the settings dialog box,
- choose "Keymap" from the left menu
- then search for keyword "comment".
- right click on "Comment with Block comment" and select add Keyboar Shortcuts.
- Type the shortcut you want to use and click ok.
For more details : https://www.jetbrains.com/help/idea/2016.3/configuring-keyboard-shortcuts.html

I just changed Ctrl + Slash and Ctrl + Shift + Slash to Ctrl + 7 and Ctrl + Shift + 7.
Works as expected, as they are the same key on german keyboards.
Problem is Ctrl + Shift + 7 is used for bookmarking a line, so I have to override this shortcut.

As of today it is still an unresolved IDEA issue, see this
https://youtrack.jetbrains.com/issue/IDEA-16116.
Defining a custom keymap seems to be the best solution.

A little late to the party, but maybe it helps someone...
I'm using Ubuntu 16.04 with the gnome desktop.
I frequently switch between the german and english keyboard layout.
In order to be able to use IntelliJ shortcuts with the english layout I had to change the order of the layouts in my system settings:
(gnome desktop) > settings > keyboard > Input source (top right corner)
There you find all configured input sources. I moved "english" to the top.
Now I can use all shortcuts based on the english layout, even when I switch to german. This means e.g. Ctrl + _ with the german or Ctrl + / with english layout would be line-comment in IntelliJ.

Not really an answer but I found this while googling and unfortunately had to add a custom keymap, too.
I now have it on CMD + ß. The combination is not used (which makes sense due to its QWERTZ relation). Works for me.

I just discovered that STRG(CTRL) + # works for my QWERTZ-Keyboard.
Hope it helps somebody!

It's been almost 4.5 years and I just want to share with you guys, which route I took because of only this issue (more or less). Sorry that this is not an answer in the proper stackoverflow manner.
I switched my keyboard setting to "US - International" and only use this one for everything I do nowadays. You can have the umlauts (by pressing Shift + ä and then your desired letter) on windows and macos. An all the "special keys" feel so much more natural! While you have to do finger-splits for certain characters, they use AT MAX the shift key on US layouts. Feels so much nicer to write and code like that!
I know, this is probably not what you are going to do, but I can tell you, that I find more and more people who did that and not a single one of them regretted that. Obviously that means, that you should be able to type blindly. :) At least, most keyboard I use, don't have the US layout on it. I adapted to it pretty fast though.
So basically, having the umlauts takes a tiny little bit more effort, but this is really worth it, because everything else makes so much sense on the US layout and you will get all the keymaps as they were intended to be used. Not those crappy "translations" that sometimes don't make sense, like this annoying line-comment thingy here.
Update 2021:
Compare how you write those characters on a US layout compared to whichever layout you are using. There are dramatically less keys involved in using those chars and I can write them faster and also with less wear and tear on my fingers.
;
:
/
`
'
#
<>
[]
{}

I also struggle with this shortcut and could'nt find the right combination.
The only solution i found is to change to English keybord layout using Alt+Shift and then use Strg+Underscore for commenting and back to german layout Alt+Shift.
This helps for the moment. Hope for a better solution.

I solved this by changing the shortcut. You can do this the following way:
In Android Studio in the top menu, click on Android
Studio->Preferences...
A new window pops up, in the side menu of it select Keymap. Now
you see a list. Click on Main menu -> Code -> Comment with
Line Comment (doubleclick) -> add keyboard shortcut.
A small window pops up. You can now simply press the shortcut you
prefer and click ok.
Don't forget to save your changes by clicking OK or Apply.
The configured shortcut should work immediately.

Copying over a solution I found in one of the comments in Jetbrain's bug tracker (see https://youtrack.jetbrains.com/issue/JBR-216#focus=Comments-27-4838035.0-0 )
[...]
I found the plugin "Keyboard Nationalizer". Install the Plugin, restart IntelliJ and execute the Action "Generate National Keymap" - that's it.
After generating a German layout, the shortcuts can be used again

If you are on macOS (MacBook, ...) and have a German keyboard you can make the command + / keymap work like this:
Step 1 - macOS settings
Disable the "Hilfemenü anzeigen" ("Open the Help menu") shortcut in the keyboard settings of macOS:
Step 2 - IDEA settings
In the keymap preferences of IntelliJ IDEA (or Android Studio) add the keymap shift + command + 7 for "Comment with Line Comment". Note: I used the "macOS" keymap settings as the basis, and adding a keymap will create your personal copy of the settings.
Now it should work the same way as in Visual Studio Code for example.

In my current version of IDEA v.20221.1.4 there is an option "Use national layouts for shortcuts (require restart)". Activate it, nothing changed.
Then I check the documents of IDEA, it says you need to install the "Keymap Nationalized" plugin to use it. Deatails about this plugin can be found here: https://plugins.jetbrains.com/plugin/14625-keymap-nationalizer
After install this plugin in IDEA. Double click "Shift" button in IDEA, the "search every" windows will be opened. Find the setting for Keymap Nationalized plugin. Now you can choose the language for the keymap. You will see new keymaps were added, for example there is a new keymap for the Comment with line added.

For MacBook Pro & Air, command + shift + 7 works fine in Visual Studio Code.

If you have a numpad, try using command + /(from the numpad). It worked for me.

Related

Alt+Enter does not work properly IntelliJ [duplicate]

When working with IntelliJ on a JavaProject it shows to use alt + enter to import a class for example, but this isnt working anymore. It worked in the past, but something must have changed, -the shortcut is still set,-other shortcut would work- i cant assign alt+enter manually, although if i reset it to default it gets set to it, any ideas how to fix my problem? btw my keyboard layout is german, but i dont think it is the problem because it worked in the past, my os is win 7. edited: when i am working within the IDE and i e.g. write Arrays.toString(a); and didn't import "java.util.Arrays" yet, the IDE says: " ? java.util.Arrays? Alt+Eingabe"    (Eingabe = Enter in German) so when i assign a different shortcut it works, but with Alt+Enter it doesnt thanks in advance for any help.
"Well, it means IDE doesn't see the shortcut for some reason. Probably it's already used by some other application or the operating system. – CrazyCoder 25 mins ago "
i closed all applications and it turns out that, Facebook GameRoom, running in the background, somehow is the reason the shortcut doesn't work, i have no idea why, but thats the solution
many thanks to CrazyCoder
It was working earlier but it stopped working due to unknown reason,
One workaround is Try fn+Alt+Enter
I had the same problem
and it turned out to be the keyboard language in Windows, It wasn't english,
so just make sure you are on English
On my side, culprit is some VPN software called PulseSecure
fn + Alt+Enter+Shift worked for me (credits #ketankk).
My problem solved. just try :
LEFT Alt + Enter
LEFT Alt+Enter
Looks like some languages override Right Alt behavior, at least in case of Lithuanian Left Alt is working fine with Lithuanian enabled, Right does not, when switch to English, everything is fine again. Was pulling hair to figure out why out of nowhere it stops working, thanks
In my case hint is showing Alt + Shift + Enter, but Ctrl+Shift+Enter works for some reason oO
In my case, I mapped Alt+Enter to a system shortcut (for expanding the current window) and I forgot. So it might not be another program, but your past self-sabotaging you.
I have the same issue. Alt+Insert not working while I was trying to generate getters/setters for my POJO class.
I just added another shortcut for that "Generate" operation.
If you are using Intellij Idea, you can do that by following steps:
Go to File -> Settings -> Keymap.
On the search bar appeared, search for "Generate", you will find an entry to which assigned shortcut will be Alt+Insert.
Right click on this entry and select 'Add Keyboard shorcut'.
Now, type your own shortcut that you want. In my case, I used Ctrl+Shift+G.
It worked fine and now I am using my new shortcut for Generate operation.
I had the same problem while upgrading to a new IDE version. The cause was a plugin error in new IDE version, I resolved disabling/updating that plugin.

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

How to customize FoxitReader shortcut keys

Recently, FoxitReader for Linux was officially introduced and I love it.
http://www.webupd8.org/2015/09/foxit-pdf-reader-sees-new-linux-release.html
However, somehow FoxitReader does not support shortcut keys for any comment tools. This is quite inconvenience for me, especially when I have to use the trackpad of my laptop to select the tool first.
So I would like to ask if is there any way to configure the shortcut keys of FoxitReader?
I do not see this feature in the preference of FoxitReader, so looking into the configuration files of FoxitReader in Linux could be a possible solution. But I am don't know how to do it.
Thanks for taking time reading my post!
Not sure for linux but in window u can do this
Right click on toolbar at top
select customise quick access toolbar
then follow this
Update:
Foxit version 2.4.1
By default, they provide for highlight light text using Ctrl+h (Linux)
Unfortunately this feature is not currently available. I'm sorry I can't give you a better answer. We (Foxit) are currently working on adding shortcut keys in future versions.
Try:
Right-click the toolbar region -> Customize Toolbar -> choose the Keyboard tab -> choose the View menu -> change the shortcuts for Next Page and Previous Page.
See the shortcuts available in foxit.
For the newest version:
Right click the ribbon under the "Home" section.
Select customize ribbon.
Navigate to the keyboard tab
I used this specifically to set the highlight tool. The section to find the highlight tool option is not intuitive so if your interested in setting the highlight shortcut just navigate to the comment section.
It is impossible to customized the shortcut on the Linux version. But for the windows version, Adiii has provided the solutions.
Two commonly used shortcut, which is already predefined in the Linux version is
CTRL + L: highlight
CTRL + N: note
Hope it helps.
The FoxIt Linux version do not support keyboard customization, BUT we can easily use FoxIt (Windows) on Linux via Wine + PlayOnLinux.
I set it up on my Ubuntu 18 by:
Download the Foxit Windows version from https://www.foxitsoftware.com/pdf-reader/
Install via PlayOnLinux. (including adding a shortcut to the FoxitReader.exe)
Move the shortcut FoxitReader.desktop to the .local/share/applications and select any pdf file > properties > set the default application as FoxitReader.
This gives me the power of keyboard shortcut customization at a small price of slightly longer startup time.
The answer provided by user Adiii is sufficient above.
I would like to add,
the default option to highlight on foxit linux is ctrl + H
that option is occupied on windows for entering reading mode, since u would be highlighting more than entering the reading mode, assining alt+H to reading mode and assigning ctrl + H to highlight is the prudent choice.

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.

intellij shortcuts

ctrl+shift+ (left/right arrows) (undo,redo) stopped working for me.
It used to be accurate but now I cant predict where it will take me.
It happened before, then got fixed, but now it looks like it is jumping to weird places.
cant make a sense out of it.
Same goes for the f4 in the form editor. it use to take me to declaration of the component in the code the but now it only puts me in the top of the class.
10x
Please refer to the list of the known issues with the back/forward functionality:
http://youtrack.jetbrains.net/issue/IDEA-63218
http://youtrack.jetbrains.net/issue/IDEA-64656
http://youtrack.jetbrains.net/issue/IDEA-65070
http://youtrack.jetbrains.net/issue/IDEA-63748
http://youtrack.jetbrains.net/issue/IDEA-63082
You might to check if you have accidentally switched the keymap. You can check it by following these steps:
Ctrl + `
switch keymap
choose "default copy"
One reason for this can be accidentally changed of keymap. If that is the case, we can change it to default. Follow below step for that.
Open Setting (Ctrl + Alt + s or File -> Settings) then select keymap from left side bar. Then select Restore Defaults like below image.
If your Restore Defaults is gray colored like me, then your keymap in the default state, which means nothing is changed. If not there is change.