lua-users home
lua-l archive

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


> Has anyone got a good lua.vim syntax file: something that recognizes
> function names, not just lua keywords ?
> 
> Example (highlights "thisMethod"):
> 
> local *function thisMethod*()
> end

If you create ~/.vim/after/syntax/lua.vim and add the following two
lines you should have what you want:

syntax match luaLocalFunc /\(local\s\+function\s\+\)\@<=\w\+/
containedin=luaFunctionBlock
highlight def link luaLocalFunc Function

If you remove the local\s\+ bit it will highlight all functions instead
of just local functions.

 - Peter Odding