Re: Some questions

From: Robert <ro....at.web.de>
Date: Sun, 21 Mar 2010 10:45:06 -0700 (PDT)

On Mar 21, 6:32 pm, gummybears <oracle....at.gmail.com> 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
work. Currently there is no lexer called 'Tex' and .tex files are
associated with the Latex lexer.
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 - 13:45:06 EDT

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