Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert tabs to spaces phpStorm

Tags:

phpstorm

Is there easy way to convert tabs to spaces in phpStorm? At the moment I use regex replacing \t->\s\s\s\s and was wondering if there is easy way to do this, since I work with magento and extension developers have never heard of coding standarts, 100 files with tabs...

like image 883
bazinga Avatar asked Nov 13 '13 23:11

bazinga


People also ask

How do I convert tabs to spaces 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.

How do I convert tabs to spaces in Pycharm?

ctrl + shift + A => open pop window to select options, select to spaces to convert all tabs as space, or to tab to convert all spaces as tab.


1 Answers

I assume you are talking about indents (leading spaces). If so:

  • Edit | Convert Indents | To Spaces
  • Edit | Convert Indents | To Tabs

For this you need to open such file and select text you want to process.


Alternatively: you can process a bunch of files at once via "Code | Reformat Code..." (will be done accordingly to your Code Style).. but that will do actual full reformat, which may not be desirable in some cases (e.g. limited formatting rules; or rules do not fork as you need (limited options; edge cases); or whatever).

like image 91
LazyOne Avatar answered Oct 03 '22 19:10

LazyOne