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.)
Please sign in to leave a comment.
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.
Thanks!
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:
For future reference, the "Makefile Language" plugin handles the tab vs spaces concern.
See https://plugins.jetbrains.com/plugin/9333-makefile-language