ftravers
ftravers

Reputation: 3999

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?

Upvotes: 10

Views: 2797

Answers (2)

Damien B
Damien B

Reputation: 2003

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

Upvotes: 2

CrazyCoder
CrazyCoder

Reputation: 401877

Something is wrong with either your IDEA installation or the settings. Indentation works automatically on Enter, you don't have to hit Tab at all.

Try running with all the default settings after renaming IDEA config directory and see if you still can reproduce it. Specify your IDEA version and provide sample project with the steps to replicate the problem if the issue persists.

Upvotes: 0

Related Questions