I'm using IntelliJ IDEA to write Java and finding the default Tab behaviour (inserting a tab at the cursor position) quite annoying. I want it to behave like Shift-Tab.
Shift-Tab de-indents the cursor line if there is no selection, or every line in the selection if there is one, regardless of the cursor's position on the line. I tried to make Tab behave the same way by changing the keymap settings: I unbound the Tab key from Editor Actions → Tab so that it'd perform Edit → Indent Selection. But that only makes it indent the selection: if there's no selection, pressing Tab now does nothing.
It appears that the de-indent action for Shift-Tab is actually Editor Actions → Unindent Selection, but there's no corresponding action for indenting.
How can I make the Tab key indent the current line (increase the indent by one stop) if there is no selection?
This works on at least IDEA 14+ but I haven't tested it on anything before that
You can press Ctrl+W which selects the nearest item to the cursor and then press Tab to indent or Shift+Tab to unindent the current line.
Not exactly what you need, but you can try Code
| Auto-Indent Lines
. There is also a known bug about the difference in the selection indent/unindent behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With