7
|
1 " Vim filetype plugin file.
|
26148
|
2 " Language: Lua
|
|
3 " Maintainer: Doug Kearns <dougkearns@gmail.com>
|
|
4 " Previous Maintainer: Max Ischenko <mfi@ukr.net>
|
|
5 " Last Change: 2021 Nov 15
|
7
|
6
|
|
7 " Only do this when not done yet for this buffer
|
|
8 if exists("b:did_ftplugin")
|
|
9 finish
|
|
10 endif
|
|
11
|
|
12 " Don't load another plugin for this buffer
|
|
13 let b:did_ftplugin = 1
|
|
14
|
3224
|
15 let s:cpo_save = &cpo
|
|
16 set cpo&vim
|
|
17
|
7
|
18 " Set 'formatoptions' to break comment lines but not other lines, and insert
|
|
19 " the comment leader when hitting <CR> or using "o".
|
26148
|
20 setlocal formatoptions-=t formatoptions+=croql
|
7
|
21
|
26148
|
22 setlocal comments=:--
|
|
23 setlocal commentstring=--%s
|
7
|
24 setlocal suffixesadd=.lua
|
|
25
|
26148
|
26 let b:undo_ftplugin = "setlocal fo< com< cms< sua<"
|
7
|
27
|
26148
|
28 if exists("loaded_matchit") && !exists("b:match_words")
|
7
|
29 let b:match_ignorecase = 0
|
|
30 let b:match_words =
|
26148
|
31 \ '\<\%(do\|function\|if\)\>:' .
|
|
32 \ '\<\%(return\|else\|elseif\)\>:' .
|
|
33 \ '\<end\>,' .
|
|
34 \ '\<repeat\>:\<until\>,' .
|
|
35 \ '\%(--\)\=\[\(=*\)\[:]\1]'
|
|
36 let b:undo_ftplugin .= " | unlet! b:match_words b:match_ignorecase"
|
|
37 endif
|
7
|
38
|
26148
|
39 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
|
40 let b:browsefilter = "Lua Source Files (*.lua)\t*.lua\n" .
|
|
41 \ "All Files (*.*)\t*.*\n"
|
|
42 let b:undo_ftplugin .= " | unlet! b:browsefilter"
|
|
43 endif
|
3224
|
44
|
|
45 let &cpo = s:cpo_save
|
|
46 unlet s:cpo_save
|