Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Write tabs in Makefile in IntelliJ/PhpStorm when configured globally to use spaces?

I use PhpStorm/IntelliJ. It is configured to indent using spaces by default because I use PHP's PSR-2 standard a lot. I don't want to change the default indentation settings.

However I want to write makefiles and they require to use tabs for indentation.

How can I write makefiles in PhpStorm/IntelliJ with spaces as default indentation?

like image 461
Matthieu Napoli Avatar asked Sep 12 '15 15:09

Matthieu Napoli


People also ask

How do I enable tabs in IntelliJ?

In 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 I view tabs and spaces in IntelliJ?

Select this checkbox to have IntelliJ IDEA display whitespaces or tabs (depending on the Code Style settings). You can select the following options: Leading: select this checkbox to add whitespaces before your code line. Inner: select this checkbox to display whitespaces inside the line of your code.

How do I change the spacing 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 .


1 Answers

1) By now, there is a Makefile plugin for PhpStorm.

If you use this plugin and create a Makefile, it will automatically use tabs.

2) Another solution is to change the Makefile not to use tab as prefix. However, I do not like this solution very much because it requires a newer version of gmake which makes it less portable.

like image 189
Sybille Peters Avatar answered Sep 16 '22 15:09

Sybille Peters