Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I almost always use the Insert spaces instead of tabs feature in gedit. The one exception is when writing a Makefile which requires tabs. I don't suppose there is a way to make this option dependent on the syntax being used? I.e. automatically switch back to tabs when Makefile is detected.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

There seems to be several ways to handle this.

Modelines

gedit has a modeline plugin. If you enable it you can use the Emacs modeline option Indent-tabs-mode (or any other supported modeline option with the same effect). By setting that option to true you can make gedit indent with tabs for the file in question. So, to enable tab indentation in a Makefile add the following line to it:

# -*- indent-tabs-mode:t; -*-

Makefiletab

There is a gedit plugin named Makefiletab which is said to "force the option spaces-instead-of-tabs off for all Makefiles." I do not know if it works though as I haven not tried it.

share|improve this answer
    
Thanks, I went for the modelines option. I had never heard of modelines before - looks very handy. –  trideceth12 Jan 28 '13 at 13:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.