ChatGPT解决这个技术问题 Extra ChatGPT

Intellij shortcut to convert code to upper or lower case?

What is the Intellij shortcut to convert code to upper or lower case?


F
Felipe

Ctrl + Shift + U

In the future try typing: Ctrl + Shift + A and look for any actions you like. Here: Toggle Case.

Or ⌘ Command + Shift + U if you are using Mac OSX.


In case it helps someone who wanders in here: In Eclipse, this is CMD+SHFT+Y (lower) and CMD+SHIFT+X (upper)
I have trouble where sometimes pressing CTRL+SHIFT+U just replaces the selected text with the letter U.... sometimes it works, but usually it just does the replacing.
@Trenton - if you're using Ubuntu CTRL+SHIFT+U by default is used for Unicode input thus you're seeing the letter u. If you don't use it you should probably unbind it (looks like it's not so easy askubuntu.com/questions/367646/…) or define a new shortcut for this action in Intellijf
export XMODIFIERS="" ./bin/idea.sh solves to me, using Ubuntu.
@Kuba in October 2018 I can confirm that Debian does this too
P
Pascal MARTIN

According to the documentation :

Ctrl + Shift + U : Toggle case of the selected text block


Obsolete, do not toggle any more. It will only make characters upper case.
I
Ivan Aracki

I would highly recommend String Manipulation plugin for Intellij.

With a simple Alt + M (Option + M for Mac) you get:

https://i.stack.imgur.com/n716m.png

So you can easily manipulate with strings in the following way:

https://i.stack.imgur.com/aUU7n.gif


m
max

If you are an Ubuntu User you will notice that Ctrl + Shift + U will add an u instead of toggling the case.

The solution for me was to change the KeyMap from:

Ctrl + Shift + U --> Alt + Shift + U

You can do so with this Docs


V
Vinay Prajapati

Please check your hot-key settings first. You could go to

File > Settings > Search for Keymap > Search for Toggle Case

and see what hot-key has been configured. See screenshot below:-

https://i.stack.imgur.com/dyDCC.png

If not configured, create a new one for yourself.


m
max

Select the text/word/line to be modified and hitting Cntrl+Shift+U or Command+Shift+U` (MAC) works. Please look here for more detail


Any specific reason it is down voted? I just verified in IntelliJ and confirmed this
Had to convert a project from MSSQL (Pascal case) to Postgres (lowercase). This saved me a ton of time!
t
thatguy

Toggle case in Intellij IDE:

For Ubuntu OS use Ctrl+Shift+x or Ctrl+Shift+y

For Windows OS use Ctrl+Shift+u