Convert spaces back to tab in Makefile

Occasionally when writing a makefile in CLion, the IDE will insert spaces instead of a single tab.  How do I replace those spaces with the required tab?

In general, I want CLion to convert tabs to spaces in my code.  However, when writing a Makefile (for gnu make, not CMake), there are places where tabs are required.  CLion usually inserts the necessary tabs correctly; but, sometimes it does not.  When this happens, how do I get the IDE to leave the tab where it is needed?  (Sometimes deleting the spaces and hitting tab works; but, other times it doesn't.)

2
4 comments

Hi Zachary.

CLion hasn't had any additional tabs for makefile indentation settings yet. I suppose that you can only change settings on the Preferences | Editor | Code Style | Other file types tab. Feel free to file the issue in our tracker.

2
Avatar
Permanently deleted user

Thanks!

0
Avatar
Permanently deleted user

I wanted to set things up like this in PHPStorm - I was able to achieve it using the EditorConfig plugin.

See https://www.jetbrains.com/help/phpstorm/configuring-code-style.html and https://editorconfig.org/

In my .editorconfig file, I added the following:

 


[Makefile]
indent_style = tab
6

For future reference, the "Makefile Language" plugin handles the tab vs spaces concern.

See https://plugins.jetbrains.com/plugin/9333-makefile-language

1

Please sign in to leave a comment.