Re: Some questions

From: Alain Delmotte <>
Date: Sun, 21 Mar 2010 21:26:19 +0100


Robert a écrit :
> On Mar 21, 6:32 pm, gummybears <> wrote:
>> Hi,
>> I am new to the textadept editor and to Lua, and I would like to learn
>> how to use lexers and snippets for Tex (not Latex, but ConText), Ruby
>> and Ruby on Rails. I installed textadept 2.1 on Ubuntu 9.10 in my user
>> directory (/home/username/textadept). I read the user manual, the wiki
>> pages, the Lua doc.
>> I moved some of the ''unused" lexers to clean up the Lexers menu.
>> Started textadept and selected modules
>> from the left pane. Right clicked the pane to create a new module
>> named Tex. This creates a directory
>> under textadept/modules named tex and some files (init.lua ...)
>> Now I open the snippets.lua file (looked at the other snippets files)
>> and inserted a simple snippet called p,
>> to insert some static text.
>> Restarted the editor and selected a tex file to test my snippet. In
>> the editor I typed p and hit the TAB key
>> to test if my snippet works. But nothing happens. I know snippets
>> should work, as I created a dummy cpp file
>> where the p shortcut results in the text print(%0)
>> I know, as I am a new textadept user, I am doing something wrong
>> (probably a lot).
>> Hope someone can help.
> You would have to call your module directory "latex", then it should
LaTeX and ConTeXt are completely different. There is almost no common
> work. Currently there is no lexer called 'Tex' and .tex files are
> associated with the Latex lexer.
Where is the association declared? To be changed?
> If I'm not mistaken the syntax isn't too different (ConText vs. LaTex)
> so it's probably okay to get started with.
> You could save the Latex lexer as Contex and start changing/adding the
> keywords that are different. Note that you would have to change
> "Latex" to "Context" in the LoadTokens function at the bottom. Then
> you could change the mime_type association to the new lexer.
> - Robert
Received on Sun 21 Mar 2010 - 16:26:19 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:40:38 EST