2014-07-10 21:05:51 -07:00
|
|
|
" Vim filetype plugin file.
|
2022-09-10 05:54:13 -07:00
|
|
|
" Language: Lua
|
2021-11-17 02:02:59 -07:00
|
|
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
|
|
" Previous Maintainer: Max Ischenko <mfi@ukr.net>
|
2022-09-10 05:54:13 -07:00
|
|
|
" Contributor: Dorai Sitaram <ds26@gte.com>
|
2022-10-16 23:19:48 -07:00
|
|
|
" C.D. MacEachern <craig.daniel.maceachern@gmail.com>
|
2022-11-24 03:23:50 -07:00
|
|
|
" Last Change: 2022 Nov 19
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
if exists("b:did_ftplugin")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let b:did_ftplugin = 1
|
|
|
|
|
|
|
|
let s:cpo_save = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
2022-09-10 05:54:13 -07:00
|
|
|
setlocal comments=:--
|
|
|
|
setlocal commentstring=--\ %s
|
2021-11-17 02:02:59 -07:00
|
|
|
setlocal formatoptions-=t formatoptions+=croql
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2022-09-10 05:54:13 -07:00
|
|
|
let &l:define = '\<function\|\<local\%(\s\+function\)\='
|
|
|
|
|
2022-10-16 23:19:48 -07:00
|
|
|
" TODO: handle init.lua
|
2022-11-24 03:23:50 -07:00
|
|
|
setlocal includeexpr=tr(v:fname,'.','/')
|
2014-07-10 21:05:51 -07:00
|
|
|
setlocal suffixesadd=.lua
|
|
|
|
|
2022-10-16 23:19:48 -07:00
|
|
|
let b:undo_ftplugin = "setlocal cms< com< def< fo< inex< sua<"
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2021-11-17 02:02:59 -07:00
|
|
|
if exists("loaded_matchit") && !exists("b:match_words")
|
2014-07-10 21:05:51 -07:00
|
|
|
let b:match_ignorecase = 0
|
|
|
|
let b:match_words =
|
2022-09-10 05:54:13 -07:00
|
|
|
\ '\<\%(do\|function\|if\)\>:' ..
|
|
|
|
\ '\<\%(return\|else\|elseif\)\>:' ..
|
|
|
|
\ '\<end\>,' ..
|
|
|
|
\ '\<repeat\>:\<until\>,' ..
|
|
|
|
\ '\%(--\)\=\[\(=*\)\[:]\1]'
|
|
|
|
let b:undo_ftplugin ..= " | unlet! b:match_words b:match_ignorecase"
|
2021-11-17 02:02:59 -07:00
|
|
|
endif
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2021-11-17 02:02:59 -07:00
|
|
|
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
2022-09-10 05:54:13 -07:00
|
|
|
let b:browsefilter = "Lua Source Files (*.lua)\t*.lua\n" ..
|
|
|
|
\ "All Files (*.*)\t*.*\n"
|
|
|
|
let b:undo_ftplugin ..= " | unlet! b:browsefilter"
|
2021-11-17 02:02:59 -07:00
|
|
|
endif
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
let &cpo = s:cpo_save
|
|
|
|
unlet s:cpo_save
|
2022-09-10 05:54:13 -07:00
|
|
|
|
|
|
|
" vim: nowrap sw=2 sts=2 ts=8 noet:
|