lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


David Olofson wrote:

> However, I can't remember seeing an editor with a
> "highlight matching keyword" feature...

Rici Lake wrote:

> The standard vim lua highlighter has the nice feature of
> colouring the end in function ... end a different colour
> than the end in do ... end. 

Also, Vim's matchit plugin allows jumping between control
flow keywords with the same key ("%") that normally jumps to
the matching parenthesis.  Do ":help matchit" for more
details.

According to the documentation it supports Lua
out-of-the-box, but my copy didn't, so I had to add:

  " Lua
  au FileType lua if !exists("b:match_words") |
    \ let b:match_words =
    \ '\<\%(do\|function\|if\)\>:' .
    \ '\<\%(return\|else\|elseif\)\>:' .
    \ '\<end\>,' .
    \ '\<repeat\>:\<until\>'
    \ | endif

-- 
Aaron