0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00
vim/runtime/ftplugin/lua.vim

47 lines
1.3 KiB
VimL
Raw Normal View History

2004-06-13 20:20:40 +00:00
" Vim filetype plugin file.
2021-11-16 19:18:26 +00:00
" Language: Lua
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Max Ischenko <mfi@ukr.net>
" Last Change: 2021 Nov 15
2004-06-13 20:20:40 +00: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
2011-12-14 21:17:39 +01:00
let s:cpo_save = &cpo
set cpo&vim
2004-06-13 20:20:40 +00:00
" Set 'formatoptions' to break comment lines but not other lines, and insert
" the comment leader when hitting <CR> or using "o".
2021-11-16 19:18:26 +00:00
setlocal formatoptions-=t formatoptions+=croql
2004-06-13 20:20:40 +00:00
2021-11-16 19:18:26 +00:00
setlocal comments=:--
setlocal commentstring=--%s
2004-06-13 20:20:40 +00:00
setlocal suffixesadd=.lua
2021-11-16 19:18:26 +00:00
let b:undo_ftplugin = "setlocal fo< com< cms< sua<"
2004-06-13 20:20:40 +00:00
2021-11-16 19:18:26 +00:00
if exists("loaded_matchit") && !exists("b:match_words")
2004-06-13 20:20:40 +00:00
let b:match_ignorecase = 0
let b:match_words =
2021-11-16 19:18:26 +00:00
\ '\<\%(do\|function\|if\)\>:' .
\ '\<\%(return\|else\|elseif\)\>:' .
\ '\<end\>,' .
\ '\<repeat\>:\<until\>,' .
\ '\%(--\)\=\[\(=*\)\[:]\1]'
let b:undo_ftplugin .= " | unlet! b:match_words b:match_ignorecase"
endif
2004-06-13 20:20:40 +00:00
2021-11-16 19:18:26 +00: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
2011-12-14 21:17:39 +01:00
let &cpo = s:cpo_save
unlet s:cpo_save