How to reindent lines in IntelliJ IDEA / WebStorm? - intellij-idea

In Eclipse, I can select a few lines and press Ctrl + I to reindent those lines. How do I do the same in IntelliJ IDEA / WebStorm?
Note:
I don't want to "indent" or "unindent" the selected lines - that would "move" the text to the right or to the left manually. I want the IDE to be clever about how to position the lines.
I don't want to reformat anything, i.e. there should be no modifications to characters beyond the first non-whitespace character on every line.

Code | Auto-Indent Lines (Ctrl+Alt+I in Windows default keymap).

On a mac, it's Ctrl+Option+I by default.

What worked for me on mac was
⌘ + OPTION + L

Windows:
Ctrl + Alt + L
Mac:
⌘ + OPTION + L

In Webstorm the option can be found as "Reformat Code" in the keymap.
The default on Mac is Alt Cmd l

Related

How do you indent in Google Colab?

I can't figure out how to indent blocks of code in Google Colab. Pressing the tab does not indent. Right now, I'm resorting to pressing space twice for each line of code.
Simply do the following.
Select the text you want to indent.
On Mac, press command + curly braces
Mark the lines and you'll see the different kinds of indentation.
Copy the original indent and paste it instead of the new one.
Do the following.
Select the text you want to indent and then
On Windows:
Press Ctrl + { for the left indent
Press Ctrl + } for the right indent
On Mac:
Press cmd + { for the left indent
Press cmd + } for the right indent

Go to last line in Atom editor

I wonder if there is a way to navigate to the last line of the file in atom editor given that you don't it's number(for instance you've just opened log file). Something similar to Shift + G in vim.
It works the same as it does in every other macOS application:
Cmd+↓ jumps to last line (or ⇟ / end on a fullsize keyboard)
Cmd+↑ jumps to first line (or ⇞ / home on a fullsize keyboard)
If it still doesn't work, a third-party package might interfere. You can use the keybinding-resolver (it's bundled with Atom) to find out which package causes this conflict.
ubuntu 20.04
atom 1.50.0
ctrl + end to the file end
ctrl + home to the file head
Use ctrl+a to select all and then press ↑ to go to the top or ↓ to go to the bottom of the file. For the beginning / end of a line try ctrl-← and ctrl-→ or if it doesn't work try the same with shift or alt.

What is this symbol in the WebStorm Hide shortcut

What is the symbol next to the shift sign ?
Alt click doesn't do anything either.
That's Escape .. so the whole shortcut is Shift + Escape.
Some links:
http://osxdaily.com/2010/11/07/mac-keyboard-symbols/
http://nedbatchelder.com/blog/200808/mac_keyboard_symbols.html

Is there a keyboard shortcut to select current word?

In JetBrains PhpStorm, what is the keyboard shortcut to select the current word? (I mean the word where the cursor is)
Ctrl + W selects the current word (Extend selection).
Yes there is but it's different from one IDE to another, And here are 3 examples:
SublimeText: Selection -> Expand Selection to Word (The shortcut will be shown next to it according to your OS)
PhpStorm: Edit -> Extend Selection (The shortcut will be shown next to it according to your OS)
MAC Extended Selection Shortcut: ⌥ + ↑
MAC Shrink Selection Shortcut: ⌥ + ↓
MAC Select all occurrences: ˄ + Command + G
Visual Studio Code: Selection -> Add Next Occurrence (The shortcut will be shown next to it according to your OS)
MAC Add Next Occurrence: Command + D
MAC Select All Occurrences: Shift + Command + L
^+G
it should work across all JetBrains IDEs
If you have CamelHumps enabled, Alt + J will be your friend.
to select the current word in Php storm (if you're using Windows) you can use ctrl+j
you can change it from: setting → keymap → click the search icon next to the search filed(search by keyboard shortcuts) → type ctrl+j → find "Add Selection for Next Occurrence" and change the keyboard shortcut of that as you want
For the people that comes here in search of a way to just delete the word you are in the middle of, you can use ctrl+del+backspace (combining the two shortcuts ctrl+del / ctrl+backspace).
This deletes from the cursor to the beginning of the word (ctrl+ backspace) and then from the cursor to the end of the word (ctrl+del).
On Linux.
Select next word: Ctrl+Alt+J
Select all occurrences of word: Shift+Ctrl+Alt+J

Adding spaces in multiple lines simultaneously - in Pycharm

I occasionally need to go line-by line and change the indentation of the code.
Is there a shortcut in Pycharm where I can add spaces (format the indent) in the begining of multiple lines simultaneously without processing each line individually?
Highlight/ select the lines you want indented, then press TAB as often as needed until they reach the proper indent level.
You can remove spaces with SHIFT TAB.
You can also use CTRL+ALT+I to auto-indent the selection.
Select the block that you want to indent then press TAB. It will work.
To auto indent all the codes in Pycharm just press these sequencies:
CTR + A to select all the text files and then press
CTRL+ALT+I
Select all that you want to indent, then do CTRL+ALT+I to indent all of it. This should work in Pycharm
Use shift +alt on windows machine
Continuation indent for Mac pro: Preferences -> Editor -> Code Style -> the language -> Tabs and Indents
If Ctrl + ALT + I is not working and every time needs to press the Insert button to get the pointer.
So go to Tools -> Select Vim if it is checked then it will be disabled.
Now you can intend code directly selecting multiple lines.