xref: /vim-8.2.3635/runtime/ftplugin/lua.vim (revision 01a6c216)
1" Vim filetype plugin file.
2" Language:	Lua 4.0+
3" Maintainer:	Max Ischenko <[email protected]>
4" Last Change:	2012 Mar 07
5
6" Only do this when not done yet for this buffer
7if exists("b:did_ftplugin")
8  finish
9endif
10
11" Don't load another plugin for this buffer
12let b:did_ftplugin = 1
13
14let s:cpo_save = &cpo
15set cpo&vim
16
17" Set 'formatoptions' to break comment lines but not other lines, and insert
18" the comment leader when hitting <CR> or using "o".
19setlocal fo-=t fo+=croql
20
21setlocal com=:--
22setlocal cms=--%s
23setlocal suffixesadd=.lua
24
25
26" The following lines enable the macros/matchit.vim plugin for
27" extended matching with the % key.
28if exists("loaded_matchit")
29
30  let b:match_ignorecase = 0
31  let b:match_words =
32    \ '\<\%(do\|function\|if\)\>:' .
33    \ '\<\%(return\|else\|elseif\)\>:' .
34    \ '\<end\>,' .
35    \ '\<repeat\>:\<until\>'
36
37endif " exists("loaded_matchit")
38
39let &cpo = s:cpo_save
40unlet s:cpo_save
41
42let b:undo_ftplugin = "setlocal fo< com< cms< suffixesadd<"
43