Re: [code] [textadept] Language specific settings

From: Robert Gieseke <rob.g.att.web.de>
Date: Mon, 27 Jan 2014 15:39:01 +0100

Hi Klaus,

Am 27.01.14 03:32, schrieb Klaus Borges:
> Hello,
>
> I'd like to know the appropriate way to put language specific settings,
> such as tab indenting for one specific language and space for others.
> Should I put those settings on the lexer file?

if it's only tab indenting (or a few properties) you could put in your
init.lua, e.g. for JavaScript:

events.connect(events.LEXER_LOADED, function(lang)
   if lang == 'javascript' then buffer.tab_width = 4 end
end)

You could check for multiple languages as well, of course.

The start of a more complete module in
~/.textadept/modules/javascript/init.lua could look like

local M = {}

events.connect(events.LEXER_LOADED, function(lang)
   if lang == 'javascript' then buffer.tab_width = 4 end
end)

snippets.javascript = {
   f = 'function'
}

return M

Hope this helps,
Robert

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 27 Jan 2014 - 09:39:01 EST

This archive was generated by hypermail 2.2.0 : Tue 28 Jan 2014 - 06:53:46 EST