Re: [code] Tabs and Indentation by file type

From: Robert Gieseke <>
Date: Sun, 18 Aug 2013 11:17:38 +0200

Hi Michael,

Am 8/18/13 11:01 AM, schrieb Michael Richter:
> OK, I've tinkered with this for a while and can't figure it out.
> How do I get Textadept to use tabs/8 for indentation for Makefiles *only*.
> More generally, how do I set tabs/spaces/indentation amount by file type.
> I've tried putting it into the lexer. I've tried making a subdirectory
> under ~/.textadept/modules and putting the stuff in a post_init.lua file
> and I never see the indentation/tabs settings change in the actual editor.

try this in your init.lua:

events.connect(events.LANGUAGE_MODULE_LOADED, function(lang)
   if lang == 'makefile' then
     buffer.use_tabs = true
     buffer.tab_width = 8

The Python module [1] shows how this could be included in a language
module file, it should be fine in your init.lua, though. Just in case
you want more Makefile snippets …

(Thanks for asking this -- it reminded me that I wanted this quite a few
times but was too lazy to actually put it in my init.lua)



You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Sun 18 Aug 2013 - 05:17:38 EDT

This archive was generated by hypermail 2.2.0 : Sun 18 Aug 2013 - 06:37:32 EDT