Re: [code] [textadept] snippet to set some lexer

From: Robert Gieseke <rob.g.att.web.de>
Date: Tue, 27 Aug 2013 07:46:26 +0200

Hi Alexander,

in your ~/.textadept/init.lua file you could create a snippet like the
following:

snippets['perl'] = "#!/bin/perl%<buffer:set_lexer('perl')>"

The part in %< > is Lua code and sets the lexer to perl.

It's a global snippet so you would create a new buffer, type perl, hit
tab to expand the snippet (and switch the lexer to Perl).

Hope this works for you,
Robert

Am 8/27/13 7:24 AM, schrieb A.M. Genaev:
> I want to make snippet 'perl' which print '#!/bin/perl' in the beginning of
> the current buffer and set perl-mode for this buffer. Please, help me.
>

-- 
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 Tue 27 Aug 2013 - 01:46:26 EDT

This archive was generated by hypermail 2.2.0 : Tue 27 Aug 2013 - 06:30:47 EDT