Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do smart tabs in WebStorm/PHPStorm do?

I'm confused as to what smart tabs do in general preferences.

It says that:

Fine alignment to a necessary column is done only via spaces... If this check box is not selected, then spaces are used for alignment if necessary...

Doesn't that mean that spaces are used in alignment for both cases? Does it mean that it always uses spaces in the latter and only sometimes in the former?

Can someone illustrate with an example of the two cases?

like image 705
MonkeyBonkey Avatar asked Nov 26 '12 13:11

MonkeyBonkey


People also ask

What are smart tabs IntelliJ?

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.

How do I indent in Phpstorm?

If you need to adjust indentation settings, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. On the appropriate language page, on the Tabs and Indents tab, specify the appropriate indents options and click OK.

How do I switch between tabs in Phpstorm?

Switch between tabsIn the editor, press Ctrl+Tab . Keep pressing Ctrl for the Switcher window to stay open. Use Tab to switch between tabs and other files.

How do you set tabs to two spaces in IntelliJ?

To toggle between tabs and spaces: On the main menu, choose Edit → Convert Indents, and then choose To Spaces or To Tabs respectively.


1 Answers

If smart tabs option is enabled then only spaces are used for alignment, else tabs and spaces are used.

e.g: for the following code block

    function(first,               second) {     } 

without smart tabs

t---function(first,  t---t---t---.second) { t---} 

with smart tabs

t---function(first,  t---.........second) { t---} 
like image 78
bsrykt Avatar answered Oct 01 '22 00:10

bsrykt