Why has the 'to lowercase' shortcut been removed from VS2015? - ide

In previous versions of Visual Studio, you could make all selected text lowercase with CTRL+U, and all uppercase using CTRL+SHIFT+U.
The uppercase shortcut remains in the 2015 version of VS, the lowercase shortcut, however, has been removed.
Does anybody have any info regarding this?
I thought it may have been because it conflicted with a shortcut for newly introduced functionality which had to take priority, but the only CTRL+U shortcut relies on a previous combination of keys too.

I had the same issue because I have resharper installed which overwrites VS shortcut Ctrl+U
Instead of using the shortcut keys you can do it though menu (Edit -> Advanced -> Make Uppercase; Edit -> Advanced -> Make Lowercase) as you can see from the screenshot below that make upper has a shortcut while make lower doesn't!
to fix this issue you can go to Tools -> Options -> Environment -> Keyboard -> Type "makelowercase" in show commands containing: to filter commands -> Edit.MakeLowercase -> Press shortcut keys -> Ctrl+U. did you notice the lowest most filed "Shortcut currently used by:" that's how I knew that resharper is what overwriting this vs shortcut.

https://msdn.microsoft.com/en-us/library/ms165341.aspx
check the reference from the above link, you can see they are still using this shortcut for VS2015

I just ran into an issue that might shed light on why this was removed.
The keystroke for uncommenting is ctrl + k + u, which I managed to screw up without noticing the effects until it was too late to ctrl + z it away.
I had to do a whole bunch of find/replace to repair the damage that ctrl + u allowed me to inflict on my code.

Related

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

Line-Comment shortcut on german keyboards

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.

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.

How to disable escaping when copy and pasting in IntelliJ?

When I copy and paste string text into quotes Intellj always escapes certain characters like ", etc,. How can I disable this annoying feature?
You can use Ctrl+Alt+Shift+V (presumably ⌘+Alt / Option+Shift+V for OS X) to do Paste Simple (also available from the right-click context menu). This will paste your most recent clipboard content without escaping it.
Many other programs that offer "simple pasting" will use Ctrl+Shift+V instead, but in IntelliJ that opens an IntelliJ clipboard memory dialog, where you can choose previously copied text to paste.
Note that these are all default, but customizable, keyboard shortcuts.
I found the Ctrl + Shift + Alt + V combination a bit cumbersome, and after some digging I found an alternative solution that was more to my liking. I want to share it here in case it is useful to anyone else.
You can actually edit the key mappings for the paste simple command, and replace them with the standard Ctrl + V that most people are familiar with.
Simply go into File -> Settings -> Keymap and enter "paste" into the search box to bring up all the various paste commands. Double click "Paste Simple" and enter Ctrl + V for the shortcut.
You will be warned that the shortcut is currently assigned and you will be given the option to remove it. After doing so, you have pretty much replaced the annoying "enhanced paste" with the standard "simple paste".
Hope that helps someone out there :)
as of December 2019, at least in IntelliJ Ultimate 2019.3, there is a configuration option to disable this annoying behavior: Go to Editor --> Smart Keys --> Javascript and uncheck the "Escape text on paste in string literals" checkbox.

Intellij reformat on file save

I remember seeing in either IntelliJ or Eclipse the setting to reformat (cleanup) files whenever they are saved. How do I find it (didn't find it in the settings)
This solution worked better for me:
Make a macro (I used Organize Imports, Format Code, Save All)
Assign it a keystroke (I overrode Ctrl+S)
Note: You will have to check the box "Do not show this message again" the first time for the organized imports, but it works as expected after that.
Step-by-step for IntelliJ 10.0:
Code -> "Optimize Imports...", if a dialogue box appears, check the box that says "Do not show this message again.", then click "Run".
Tools -> "Start Macro Recording"
Code -> "Optimize Imports..."
Code -> "Reformat Code..."
File -> "Save all"
Tools -> "Stop Macro Recording"
Name the macro (something like "formatted save")
In File -> Settings -> Keymap, select your macro located at "Main Menu -> Tools -> "formatted save"
Click "Add Keyboard Shortcut", then perform the keystroke you want. If you choose Ctrl+S like me, it will ask you what to do with the previous Ctrl+S shortcut. Remove it. You can always reassign it later if you want.
Enjoy!
For IntelliJ 11, replace
step 2. with: Edit -> Macros -> "Start Macro Recording"
step 6. with: Edit -> Macros -> "Stop Macro Recording"
Everything else remains the same.
IntelliJ 12
8. The Preferences contain the Keymap settings. Use the input field to filter the content, as shown in the screenshot.
I suggest the save actions plugin. It also supports optimize imports and rearrange code.
Works well in combination with the eclipse formatter plugin.
Search and activate the plugin:
Configure it:
Edit: it seems like it the recent version of Intellij the save action plugin is triggered by the automatic Intellij save. This can be quite annoying when it hits while still editing.
This github issue of the plugin gives a hint to some possible solutions:
https://github.com/dubreuia/intellij-plugin-save-actions/issues/63
I actually tried to assign reformat to Ctrl+S and it worked fine - saving is done automatically now.
Below is Neil's answer updated.
IntelliJ 13 Steps:
Code -> Reformat Code
Edit -> Macros -> Start Macro Recording
Code -> Reformat Code
File -> Save all
Edit -> Macros -> Stop Macro Recording
Name the macro (something like "formatted save")
File -> Settings -> Keymap
Right click on the macro. Add Keyboard Shortcut. Set the keyboard shortcut to Control + S.
IntelliJ will inform you of a hotkey conflict. Select "remove" to remove other assignments.
I set it to automatically clean up on check-in, which is usually good enough for me. If something is too ugly, I'll just hit the shortcut (Ctrl-Alt-L, Return). And I see they have an option for auto-formatting pasted code, although I've never used that.
If you have InteliJ Idea Community 2018.2 and above the steps are as fallows:
In the top menu you click: Edit > Macros > Start Macro Recordings
(you'll see a window lower right corner of your screen confirming
that macros are being recorded)
In the top menu you click: Code >
Reformat Code (you'll see the option being selected in the lower
right corner)
In the top menu you click: Code > Optimize Imports
(you'll see the option being selected in the lower right corner)
In the top menu you click: File > Save All
In the top menu you click: Edit > Macros > Stop Macro Recording
You name the macro: "Format Code, Organize Imports, Save"
In the top menu you clock: File > Settings. In the settings windows you click Keymap
In the search box on the right you search "save". You'll find Save All (Ctrl+S). Right click on it and select "Remove Ctrl+S"
Remove your search text from the box, press on the Collapse All button (Second button from the top left)
Go to macros, press on the arrow to expand your macros, find your saved macro and right click on it. Select Add Keyboard Shortcut, and press Ctrl+S and okay.
Restart your IDE and try it.
I know what you're going to say, the guys before me wrote the same thing. But I got confused using the steps above this post, and I wanted to write a dumb down version for people who have the latest version of the IDE.
Ctrl + Alt + L is format file (includes the two below)
Ctrl + Alt + O is optimize imports
Ctrl + Alt + I will fix indentation on a particular line
I usually run Ctrl + Alt + L a few times before committing my work. I'd rather it do the cleanup/reformatting at my command instead of automatically.
Rejoice! In IDEA 2021.2 there is finally "File->Settings->Tools->Actions on Save" where you can select "Reformat code", "Optimize imports", "Rearrange code", "Run code cleanup", "Run eslint --fix" etc.
If you're developing in Flutter, there's a new experimental option as of 5/1/2018 that allows you to format code on save.
I wound up rebinding the Reformat code... action to Ctrl-S, replacing the default binding for Save All.
It may sound crazy at first, but IntelliJ seems to save on virtually every action: running tests, building the project, even when closing an editor tab. I have a habit of hitting Ctrl-S pretty often, so this actually works quite well for me. It's certainly easier to type than the default bind for reformatting.
IntellIJ 14 && 15: When you are checking in code in Commit changes dialog, tick the Reformat code checkbox, then IntelliJ will reformatting all the code that you are checking in.
Source: www.udemy.com/intellij-idea-secrets-double-your-coding-speed-in-2-hours
For PyCharm/IntelliJ IDEA:
Install black.
$ pip install black
Locate your black installation folder.
On macOS / Linux / BSD:
$ which black
/usr/local/bin/black # possible location
On Windows:
$ where black
%LocalAppData%\Programs\Python\Python36-32\Scripts\black.exe # possible location
Note that if you are using a virtual environment detected by PyCharm, this is an unneeded step. In this case the path to black is $PyInterpreterDirectory$/black.
Open External tools in PyCharm/IntelliJ IDEA
On macOS: PyCharm -> Preferences -> Tools -> External Tools
On Windows / Linux / BSD: File -> Settings -> Tools -> External Tools
Click the + icon to add a new external tool with the following values:
Name: Black
Description: Black is the uncompromising Python code formatter.
Program: <install_location_from_step_2>
Arguments: "$FilePath$"
Format the currently opened file by selecting Tools -> External Tools -> black.
Alternatively, you can set a keyboard shortcut by navigating to Preferences or Settings -> Keymap -> External Tools -> External Tools - Black.
Optionally, run Black on every file save:
Make sure you have the File Watchers plugin installed.
Go to Preferences or Settings -> Tools -> File Watchers and click + to add a new watcher:
Name: Black
File type: Python
Scope: Project Files
Program: <install_location_from_step_2>
Arguments: $FilePath$
Output paths to refresh: $FilePath$
Working directory: $ProjectFileDir$
Uncheck “Auto-save edited files to trigger the watcher” in Advanced Options
To format Python files with Black, I followed this guide, which also uses File Watcher:
https://black.readthedocs.io/en/stable/editor_integration.html
Since version 2020.1, you can activate Run on save for files directly in the Preferences of the Prettier plugin:
I thought there was something like that in IntelliJ, but I can't find it. The only clean-up that happens at save is that white space at the ends of lines is removed. I thought I had to specify that behavior at one point, but I don't see anything related at this point.
If it's about Prettier, just use a File Watcher :
references => Tools => File Watchers => click + to add a new watcher => Prettier
https://prettier.io/docs/en/webstorm.html#running-prettier-on-save-using-file-watcher