Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ: Specify per-project tab size

Tags:

Is there a way to set the tab size in IntelliJ for a single file only, or at most for a single project?

I use a tab size of 3 for all my code; however, I'm collaborating on a project with an author who prefers a tab size of 4. Is there a way to set the tab size to 4 for only those files that are part of this project?

like image 281
Zack Avatar asked May 24 '12 18:05

Zack


People also ask

How do I set tab length in IntelliJ?

Open the Settings dialog by navigating to File -> Settings . Under Project Settings [yourproject] on the left side of the dialog, navigate to Code Style -> General . The Tab size is configurable on that pane, and the value you provide applies only to the project named yourproject .

How do I change tabs in IntelliJ?

Switch between tabsTo move between tabs, press Alt+Right or Alt+Left . You can also switch between recently viewed tabs or files. In the editor, press Ctrl+Tab . Keep pressing Ctrl for the Switcher window to stay open.

How do I change the indent spacing in IntelliJ?

Press Ctrl+Alt+S to open the IDE settings and select Editor | Code Style. Select the Detect and use existing file indents for editing checkbox. Apply the changes and close the dialog.

What is the ideal tab size?

The default value for the tab-size property is 8 space characters, and it can accept any positive integer value.


1 Answers

Open the Settings dialog by navigating to File->Settings. Under Project Settings [yourproject] on the left side of the dialog, navigate to Code Style->General. The Tab size is configurable on that pane, and the value you provide applies only to the project named yourproject.

like image 196
Matt Avatar answered Oct 04 '22 01:10

Matt