2014-07-10 21:05:51 -07:00
|
|
|
" Vim filetype plugin file.
|
2021-11-17 02:02:59 -07:00
|
|
|
" Language: Lua
|
|
|
|
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
|
|
" Previous Maintainer: Max Ischenko <mfi@ukr.net>
|
|
|
|
" Last Change: 2021 Nov 15
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
" Only do this when not done yet for this buffer
|
|
|
|
if exists("b:did_ftplugin")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
" Don't load another plugin for this buffer
|
|
|
|
let b:did_ftplugin = 1
|
|
|
|
|
|
|
|
let s:cpo_save = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
|
|
|
" Set 'formatoptions' to break comment lines but not other lines, and insert
|
|
|
|
" the comment leader when hitting <CR> or using "o".
|
2021-11-17 02:02:59 -07:00
|
|
|
setlocal formatoptions-=t formatoptions+=croql
|
2014-07-10 21:05:51 -07:00
|
|
|
|
2021-11-17 02:02:59 -07:00
|
|
|
setlocal comments=:--
|
|
|
|
setlocal commentstring=--%s
|
2014-07-10 21:05:51 -07:00
|
|
|
setlocal suffixesadd=.lua
|
|
|
|
|
2021-11-17 02:02:59 -07:00
|
|
|
let b:undo_ftplugin = "setlocal fo< com< cms< 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 =
|
2021-11-17 02:02:59 -07:00
|
|
|
\ '\<\%(do\|function\|if\)\>:' .
|
|
|
|
\ '\<\%(return\|else\|elseif\)\>:' .
|
|
|
|
\ '\<end\>,' .
|
|
|
|
\ '\<repeat\>:\<until\>,' .
|
|
|
|
\ '\%(--\)\=\[\(=*\)\[:]\1]'
|
|
|
|
let b:undo_ftplugin .= " | unlet! b:match_words b:match_ignorecase"
|
|
|
|
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")
|
|
|
|
let b:browsefilter = "Lua Source Files (*.lua)\t*.lua\n" .
|
|
|
|
\ "All Files (*.*)\t*.*\n"
|
|
|
|
let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
|
|
|
endif
|
2014-07-10 21:05:51 -07:00
|
|
|
|
|
|
|
let &cpo = s:cpo_save
|
|
|
|
unlet s:cpo_save
|