Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make intellij tab key function like eclipse tab key does

In eclipse when I press the tab key, it takes the current line to the correct indentation instantly...even if that is 5 tab's in. So

public class TabTest {
  public void func1() {
    int a = 1;
|int b = 2;

The '|' pipe being where the cursor is, when I hit tab once it looks correct

public class TabTest {
  public void func1() {
    int a = 1;
   |int b = 2;

In intellij I have to hit tab twice. Or here is another annoyance.

public class TabTest {
  public void func1() {
    int a = 1;|int b = 2;

In eclipse 'Enter' will result in

public class TabTest {
  public void func1() {
    int a = 1;
   |int b = 2;

In Intellij that takes an enter, tab, tab.

Anyone know how to get what i had in eclipse into intellij?

like image 784
ftravers Avatar asked Feb 01 '11 07:02

ftravers


People also ask

How do I set tab space in IntelliJ?

In IntelliJ IDEA, to convert existing tabs to spaces or vice versa, use File → Edit → Convert Indents → To Spaces (or To Tabs). The Reformat code shortcut Ctrl + Alt + L will also do this, while applying other changes.

What is IntelliJ smart tabs?

IDEA has a “smart tabs” option that you can turn on: If this check box is selected, IntelliJ IDEA inserts tabs for indentation and reformatting, but fine alignment to a necessary column is done only via spaces. This is done in order to preserve visual representation of the source code, when the Tab Size is changed.


1 Answers

From CrazyCoder comment, the solution seems to be :

  • map the tab key on the "Auto-indent Lines" action
  • unmap the tab key from the "Tab" and "Indent Selection" actions
like image 115
Damien B Avatar answered Sep 28 '22 08:09

Damien B