diff --git a/README.md b/README.md index 022d8ac..48ccd8e 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The [Lua][lua] file type plug-in for [Vim][vim] makes it easier to work with Lua * `K` (normal mode) and `` (insert mode) on a Lua function or 'method' call will try to open the relevant documentation in the [Lua Reference for Vim][lrv] - * The ['completefunc'][cfu] option is set to allow completion of Lua 5.1 keywords, global variables and library members using Control-X Control-U + * The ['completefunc'][cfu] option is set to allow completion of Lua 5.2 keywords, global variables and library members using Control-X Control-U * The ['omnifunc'][ofu] option is set to allow dynamic completion of the variables defined in all modules installed on the system using Control-X Control-O, however it needs to be explicitly enabled by setting the `lua_complete_omni` option because this functionality may have undesired side effects! When you invoke omni completion after typing `require '` or `require('` you get completion of module names @@ -163,7 +163,7 @@ This software is licensed under the [MIT license](http://en.wikipedia.org/wiki/M ['omnifunc']: http://vimdoc.sourceforge.net/htmldoc/options.html#'omnifunc' [cfu]: http://vimdoc.sourceforge.net/htmldoc/options.html#%27completefunc%27 [dll]: http://en.wikipedia.org/wiki/Dynamic-link_library -[dof]: http://www.lua.org/manual/5.1/manual.html#pdf-dofile +[dof]: http://www.lua.org/manual/5.2/manual.html#pdf-dofile [download-lua-ftplugin]: http://peterodding.com/code/vim/downloads/lua-ftplugin.zip [download-misc]: http://peterodding.com/code/vim/downloads/misc.zip [gf]: http://vimdoc.sourceforge.net/htmldoc/editing.html#gf @@ -173,14 +173,14 @@ This software is licensed under the [MIT license](http://en.wikipedia.org/wiki/M [inc]: http://vimdoc.sourceforge.net/htmldoc/options.html#%27include%27 [inex]: http://vimdoc.sourceforge.net/htmldoc/options.html#%27includeexpr%27 [ll]: http://lua-users.org/wiki/LuaLint -[lof]: http://www.lua.org/manual/5.1/manual.html#pdf-loadfile +[lof]: http://www.lua.org/manual/5.2/manual.html#pdf-loadfile [lrv]: http://www.vim.org/scripts/script.php?script_id=1291 [lua]: http://www.lua.org/ [mit]: http://vimdoc.sourceforge.net/htmldoc/usr_05.html#matchit-install [ofu]: http://vimdoc.sourceforge.net/htmldoc/options.html#%27omnifunc%27 [pathogen]: http://www.vim.org/scripts/script.php?script_id=2332 -[pp]: http://www.lua.org/manual/5.1/manual.html#pdf-package.path -[req]: http://www.lua.org/manual/5.1/manual.html#pdf-require +[pp]: http://www.lua.org/manual/5.2/manual.html#pdf-package.path +[req]: http://www.lua.org/manual/5.2/manual.html#pdf-require [script]: http://www.vim.org/scripts/script.php?script_id=3625 [shell]: http://peterodding.com/code/vim/shell/ [tob]: http://vimdoc.sourceforge.net/htmldoc/motion.html#text-objects diff --git a/autoload/xolox/lua.vim b/autoload/xolox/lua.vim index 18dba1a..2ddf393 100644 --- a/autoload/xolox/lua.vim +++ b/autoload/xolox/lua.vim @@ -390,7 +390,7 @@ function! xolox#lua#getomnimodules() " {{{1 endfor let modules = keys(modulemap) " Always include the standard library modules. - call extend(modules, ['coroutine', 'debug', 'io', 'math', 'os', 'package', 'string', 'table']) + call extend(modules, ['bit32', 'coroutine', 'debug', 'io', 'math', 'os', 'package', 'string', 'table']) call sort(modules, 1) let blacklist = xolox#misc#option#get('lua_omni_blacklist', []) let pattern = printf('^\(%s\)$', join(blacklist, '\|')) diff --git a/autoload/xolox/lua_data.vim b/autoload/xolox/lua_data.vim index 6b40e28..714a8d6 100644 --- a/autoload/xolox/lua_data.vim +++ b/autoload/xolox/lua_data.vim @@ -3,10 +3,8 @@ " Last Change: July 6, 2014 " URL: http://peterodding.com/code/vim/lua-ftplugin -" This script contains static user completion data based on the Lua 5.1 -" reference manual and implementation (it also contains the 'goto' keyword -" from Lua 5.2 but hasn't been updated with regards to the standard library -" contents yet). +" This script contains static user completion data based on the Lua 5.2 +" reference manual and implementation. " Enable line continuation. let s:cpo_save = &cpo @@ -41,25 +39,22 @@ let g:xolox#lua_data#keywords = [ " Global variables. {{{1 let g:xolox#lua_data#globals = [ \ { 'word': '_G', 'kind': 'v' }, + \ { 'word': '_ENV', 'kind': 'v' }, \ { 'word': '_VERSION', 'kind': 'v' }, \ { 'word': 'arg', 'kind': 'v' }, \ { 'word': 'assert()', 'kind': 'f' }, + \ { 'word': 'bit32', 'kind': 'v' }, \ { 'word': 'collectgarbage()', 'kind': 'f' }, \ { 'word': 'coroutine', 'kind': 'v' }, \ { 'word': 'debug', 'kind': 'v' }, \ { 'word': 'dofile()', 'kind': 'f' }, \ { 'word': 'error()', 'kind': 'f' }, - \ { 'word': 'gcinfo()', 'kind': 'f' }, - \ { 'word': 'getfenv()', 'kind': 'f' }, \ { 'word': 'getmetatable()', 'kind': 'f' }, \ { 'word': 'io', 'kind': 'v' }, \ { 'word': 'ipairs()', 'kind': 'f' }, \ { 'word': 'load()', 'kind': 'f' }, \ { 'word': 'loadfile()', 'kind': 'f' }, - \ { 'word': 'loadstring()', 'kind': 'f' }, \ { 'word': 'math', 'kind': 'v' }, - \ { 'word': 'module()', 'kind': 'f' }, - \ { 'word': 'newproxy()', 'kind': 'f' }, \ { 'word': 'next()', 'kind': 'f' }, \ { 'word': 'os', 'kind': 'v' }, \ { 'word': 'package', 'kind': 'v' }, @@ -68,22 +63,33 @@ let g:xolox#lua_data#globals = [ \ { 'word': 'print()', 'kind': 'f' }, \ { 'word': 'rawequal()', 'kind': 'f' }, \ { 'word': 'rawget()', 'kind': 'f' }, + \ { 'word': 'rawlen()', 'kind': 'f' }, \ { 'word': 'rawset()', 'kind': 'f' }, \ { 'word': 'require()', 'kind': 'f' }, \ { 'word': 'select()', 'kind': 'f' }, - \ { 'word': 'setfenv()', 'kind': 'f' }, \ { 'word': 'setmetatable()', 'kind': 'f' }, \ { 'word': 'string', 'kind': 'v' }, \ { 'word': 'table', 'kind': 'v' }, \ { 'word': 'tonumber()', 'kind': 'f' }, \ { 'word': 'tostring()', 'kind': 'f' }, \ { 'word': 'type()', 'kind': 'f' }, - \ { 'word': 'unpack()', 'kind': 'f' }, \ { 'word': 'xpcall()', 'kind': 'f' }, \ ] " Standard library identifiers. {{{1 let g:xolox#lua_data#library = [ + \ { 'word': 'bit32.arshift()', 'kind': 'f'}, + \ { 'word': 'bit32.band()', 'kind': 'f' }, + \ { 'word': 'bit32.bnot()', 'kind': 'f' }, + \ { 'word': 'bit32.bor()', 'kind': 'f' }, + \ { 'word': 'bit32.btest()', 'kind': 'f' }, + \ { 'word': 'bit32.bxor()', 'kind': 'f' }, + \ { 'word': 'bit32.extract()', 'kind': 'f' }, + \ { 'word': 'bit32.replace()', 'kind': 'f' }, + \ { 'word': 'bit32.lrotate()', 'kind': 'f' }, + \ { 'word': 'bit32.lshift()', 'kind': 'f' }, + \ { 'word': 'bit32.rrotate()', 'kind': 'f' }, + \ { 'word': 'bit32.rshift()', 'kind': 'f' }, \ { 'word': 'coroutine.create()', 'kind': 'f' }, \ { 'word': 'coroutine.resume()', 'kind': 'f' }, \ { 'word': 'coroutine.running()', 'kind': 'f' }, @@ -91,19 +97,21 @@ let g:xolox#lua_data#library = [ \ { 'word': 'coroutine.wrap()', 'kind': 'f' }, \ { 'word': 'coroutine.yield()', 'kind': 'f' }, \ { 'word': 'debug.debug()', 'kind': 'f' }, - \ { 'word': 'debug.getfenv()', 'kind': 'f' }, \ { 'word': 'debug.gethook()', 'kind': 'f' }, \ { 'word': 'debug.getinfo()', 'kind': 'f' }, \ { 'word': 'debug.getlocal()', 'kind': 'f' }, \ { 'word': 'debug.getmetatable()', 'kind': 'f' }, \ { 'word': 'debug.getregistry()', 'kind': 'f' }, \ { 'word': 'debug.getupvalue()', 'kind': 'f' }, - \ { 'word': 'debug.setfenv()', 'kind': 'f' }, + \ { 'word': 'debug.getuservalue()', 'kind': 'f' }, \ { 'word': 'debug.sethook()', 'kind': 'f' }, \ { 'word': 'debug.setlocal()', 'kind': 'f' }, \ { 'word': 'debug.setmetatable()', 'kind': 'f' }, \ { 'word': 'debug.setupvalue()', 'kind': 'f' }, + \ { 'word': 'debug.setuservalue()', 'kind': 'f' }, \ { 'word': 'debug.traceback()', 'kind': 'f' }, + \ { 'word': 'debug.upvalueid()', 'kind': 'f' }, + \ { 'word': 'debug.upvaluejoin()', 'kind': 'f' }, \ { 'word': 'io.close()', 'kind': 'f' }, \ { 'word': 'io.flush()', 'kind': 'f' }, \ { 'word': 'io.input()', 'kind': 'f' }, @@ -134,10 +142,8 @@ let g:xolox#lua_data#library = [ \ { 'word': 'math.huge', 'kind': 'm' }, \ { 'word': 'math.ldexp()', 'kind': 'f' }, \ { 'word': 'math.log()', 'kind': 'f' }, - \ { 'word': 'math.log10()', 'kind': 'f' }, \ { 'word': 'math.max()', 'kind': 'f' }, \ { 'word': 'math.min()', 'kind': 'f' }, - \ { 'word': 'math.mod()', 'kind': 'f' }, \ { 'word': 'math.modf()', 'kind': 'f' }, \ { 'word': 'math.pi', 'kind': 'm' }, \ { 'word': 'math.pow()', 'kind': 'f' }, @@ -163,17 +169,16 @@ let g:xolox#lua_data#library = [ \ { 'word': 'package.config', 'kind': 'm' }, \ { 'word': 'package.cpath', 'kind': 'm' }, \ { 'word': 'package.loaded', 'kind': 'm' }, - \ { 'word': 'package.loaders', 'kind': 'm' }, \ { 'word': 'package.loadlib()', 'kind': 'f' }, \ { 'word': 'package.path', 'kind': 'm' }, \ { 'word': 'package.preload', 'kind': 'm' }, - \ { 'word': 'package.seeall()', 'kind': 'f' }, + \ { 'word': 'package.searchers', 'kind': 'm' }, + \ { 'word': 'package.searchpath()', 'kind': 'f' }, \ { 'word': 'string.byte()', 'kind': 'f' }, \ { 'word': 'string.char()', 'kind': 'f' }, \ { 'word': 'string.dump()', 'kind': 'f' }, \ { 'word': 'string.find()', 'kind': 'f' }, \ { 'word': 'string.format()', 'kind': 'f' }, - \ { 'word': 'string.gfind()', 'kind': 'f' }, \ { 'word': 'string.gmatch()', 'kind': 'f' }, \ { 'word': 'string.gsub()', 'kind': 'f' }, \ { 'word': 'string.len()', 'kind': 'f' }, @@ -184,57 +189,50 @@ let g:xolox#lua_data#library = [ \ { 'word': 'string.sub()', 'kind': 'f' }, \ { 'word': 'string.upper()', 'kind': 'f' }, \ { 'word': 'table.concat()', 'kind': 'f' }, - \ { 'word': 'table.foreach()', 'kind': 'f' }, - \ { 'word': 'table.foreachi()', 'kind': 'f' }, - \ { 'word': 'table.getn()', 'kind': 'f' }, \ { 'word': 'table.insert()', 'kind': 'f' }, - \ { 'word': 'table.maxn()', 'kind': 'f' }, + \ { 'word': 'table.pack()', 'kind': 'f' }, \ { 'word': 'table.remove()', 'kind': 'f' }, - \ { 'word': 'table.setn()', 'kind': 'f' }, \ { 'word': 'table.sort()', 'kind': 'f' }, + \ { 'word': 'table.unpack()', 'kind': 'f' }, \ ] " Function signatures. {{{1 " Sources: -" - http://www.lua.org/manual/5.1/manual.html#5 +" - http://www.lua.org/manual/5.2/manual.html#6 +" - http://smherwig.org/lua/proc/index.html " - http://w3.impa.br/~diego/software/luasocket/reference.html - let g:xolox#lua_data#signatures = { \ 'assert': 'assert(v [, message])', - \ 'collectgarbage': 'collectgarbage(opt [, arg])', - \ 'dofile': 'dofile(filename)', + \ 'collectgarbage': 'collectgarbage([opt [, arg]])', + \ 'dofile': 'dofile([filename])', \ 'error': 'error(message [, level])', - \ 'getfenv': 'getfenv([f])', \ 'getmetatable': 'getmetatable(object)', \ 'ipairs': 'ipairs(t)', - \ 'load': 'load(func [, chunkname])', - \ 'loadfile': 'loadfile([filename])', - \ 'loadstring': 'loadstring(string [, chunkname])', + \ 'load': 'load(ld [, source [, mode [, env]]])', + \ 'loadfile': 'loadfile([filename [, mode [, env]]])', \ 'next': 'next(table [, index])', \ 'pairs': 'pairs(t)', - \ 'pcall': 'pcall(f, arg1, ...)', + \ 'pcall': 'pcall(f [, arg1, ...])', \ 'print': 'print(...)', \ 'rawequal': 'rawequal(v1, v2)', \ 'rawget': 'rawget(table, index)', + \ 'rawlen': 'rawlen(v)', \ 'rawset': 'rawset(table, index, value)', \ 'select': 'select(index, ...)', - \ 'setfenv': 'setfenv(f, table)', \ 'setmetatable': 'setmetatable(table, metatable)', \ 'tonumber': 'tonumber(e [, base])', - \ 'tostring': 'tostring(e)', + \ 'tostring': 'tostring(v)', \ 'type': 'type(v)', - \ 'unpack': 'unpack(list [, i [, j]])', - \ 'xpcall': 'xpcall(f, err)', + \ 'xpcall': 'xpcall(f, msgh [, arg1, ...])', \ 'coroutine.create': 'coroutine.create(f)', \ 'coroutine.resume': 'coroutine.resume(co [, val1, ...])', \ 'coroutine.running': 'coroutine.running()', \ 'coroutine.status': 'coroutine.status(co)', \ 'coroutine.wrap': 'coroutine.wrap(f)', \ 'coroutine.yield': 'coroutine.yield(...)', - \ 'module': 'module(name [, ...])', \ 'require': 'require(modname)', \ 'package.loadlib': 'package.loadlib(libname, funcname)', - \ 'package.seeall': 'package.seeall(module)', + \ 'package.searchpath': 'package.searchpath(name, path [, sep [, rep]])', \ 'string.byte': 'string.byte(s [, i [, j]])', \ 'string.char': 'string.char(...)', \ 'string.dump': 'string.dump(function)', @@ -245,15 +243,16 @@ let g:xolox#lua_data#signatures = { \ 'string.len': 'string.len(s)', \ 'string.lower': 'string.lower(s)', \ 'string.match': 'string.match(s, pattern [, init])', - \ 'string.rep': 'string.rep(s, n)', + \ 'string.rep': 'string.rep(s, n [, sep])', \ 'string.reverse': 'string.reverse(s)', \ 'string.sub': 'string.sub(s, i [, j])', \ 'string.upper': 'string.upper(s)', \ 'table.concat': 'table.concat(table [, sep [, i [, j]]])', \ 'table.insert': 'table.insert(table, [pos,] value)', - \ 'table.maxn': 'table.maxn(table)', + \ 'table.pack': 'table.pack(...)', \ 'table.remove': 'table.remove(table [, pos])', \ 'table.sort': 'table.sort(table [, comp])', + \ 'table.unpack': 'table.unpack(list [, i [, j]])', \ 'math.abs': 'math.abs(x)', \ 'math.acos': 'math.acos(x)', \ 'math.asin': 'math.asin(x)', @@ -268,8 +267,7 @@ let g:xolox#lua_data#signatures = { \ 'math.fmod': 'math.fmod(x, y)', \ 'math.frexp': 'math.frexp(x)', \ 'math.ldexp': 'math.ldexp(m, e)', - \ 'math.log': 'math.log(x)', - \ 'math.log10': 'math.log10(x)', + \ 'math.log': 'math.log(x [, base])', \ 'math.max': 'math.max(x, ...)', \ 'math.min': 'math.min(x, ...)', \ 'math.modf': 'math.modf(x)', @@ -282,10 +280,22 @@ let g:xolox#lua_data#signatures = { \ 'math.sqrt': 'math.sqrt(x)', \ 'math.tan': 'math.tan(x)', \ 'math.tanh': 'math.tanh(x)', + \ 'bit32.arshift': 'bit32.arshift(x, disp)', + \ 'bit32.band': 'bit32.band(expr)', + \ 'bit32.bnot': 'bit32.bnot(x)', + \ 'bit32.bor': 'bit32.bor(expr)', + \ 'bit32.btest': 'bit32.btest(expr)', + \ 'bit32.bxor': 'bit32.bxor(expr)', + \ 'bit32.extract': 'bit32.extract(n, field [, width])', + \ 'bit32.replace': 'bit32.replace(n, v, field [, width])', + \ 'bit32.lrotate': 'bit32.lrotate(x, disp)', + \ 'bit32.lshift': 'bit32.lshift(x, disp)', + \ 'bit32.rrotate': 'bit32.rrotate(x, disp)', + \ 'bit32.rshift': 'bit32.rshift(x, disp)', \ 'io.close': 'io.close([file])', \ 'io.flush': 'io.flush()', \ 'io.input': 'io.input([file])', - \ 'io.lines': 'io.lines([filename])', + \ 'io.lines': 'io.lines([filename ...])', \ 'io.open': 'io.open(filename [, mode])', \ 'io.output': 'io.output([file])', \ 'io.popen': 'io.popen(prog [, mode])', @@ -295,16 +305,16 @@ let g:xolox#lua_data#signatures = { \ 'io.write': 'io.write(...)', \ 'file:close': 'file:close()', \ 'file:flush': 'file:flush()', - \ 'file:lines': 'file:lines()', + \ 'file:lines': 'file:lines(...)', \ 'file:read': 'file:read(...)', - \ 'file:seek': 'file:seek([whence] [, offset])', + \ 'file:seek': 'file:seek([whence [, offset]])', \ 'file:setvbuf': 'file:setvbuf(mode [, size])', \ 'file:write': 'file:write(...)', \ 'os.clock': 'os.clock()', \ 'os.date': 'os.date([format [, time]])', \ 'os.difftime': 'os.difftime(t2, t1)', \ 'os.execute': 'os.execute([command])', - \ 'os.exit': 'os.exit([code])', + \ 'os.exit': 'os.exit([code [, close])', \ 'os.getenv': 'os.getenv(varname)', \ 'os.remove': 'os.remove(filename)', \ 'os.rename': 'os.rename(oldname, newname)', @@ -312,19 +322,26 @@ let g:xolox#lua_data#signatures = { \ 'os.time': 'os.time([table])', \ 'os.tmpname': 'os.tmpname()', \ 'debug.debug': 'debug.debug()', - \ 'debug.getfenv': 'debug.getfenv(o)', \ 'debug.gethook': 'debug.gethook([thread])', - \ 'debug.getinfo': 'debug.getinfo([thread,] function [, what])', - \ 'debug.getlocal': 'debug.getlocal([thread,] level, local)', - \ 'debug.getmetatable': 'debug.getmetatable(object)', + \ 'debug.getinfo': 'debug.getinfo([thread,] f [, what])', + \ 'debug.getlocal': 'debug.getlocal([thread,] f, local)', + \ 'debug.getmetatable': 'debug.getmetatable(value)', \ 'debug.getregistry': 'debug.getregistry()', - \ 'debug.getupvalue': 'debug.getupvalue(func, up)', - \ 'debug.setfenv': 'debug.setfenv(object, table)', + \ 'debug.getupvalue': 'debug.getupvalue(f, up)', + \ 'debug.getuservalue': 'debug.getuservalue(u)', \ 'debug.sethook': 'debug.sethook([thread,] hook, mask [, count])', \ 'debug.setlocal': 'debug.setlocal([thread,] level, local, value)', - \ 'debug.setmetatable': 'debug.setmetatable(object, table)', - \ 'debug.setupvalue': 'debug.setupvalue(func, up, value)', - \ 'debug.traceback': 'debug.traceback([thread,] [message] [, level])', + \ 'debug.setmetatable': 'debug.setmetatable(value, table)', + \ 'debug.setupvalue': 'debug.setupvalue(f, up, value)', + \ 'debug.setuservalue': 'debug.setuservalue(udata, value)', + \ 'debug.traceback': 'debug.traceback([thread,] [message [, level]])', + \ 'debug.upvalueid': 'debug.upvalueid(f, n)', + \ 'debug.upvaluejoin': 'debug.upvaluejoin(f1, n1, f2, n2)', + \ + \ 'proc.kill': 'proc.kill(pid, [signal])', + \ 'proc.killall': 'proc.killall(name, [signal])', + \ 'proc.list': 'proc.list()', + \ 'proc.pidof': 'proc.pidof(name)', \ \ 'ftp.get': 'ftp.get(url)', \ 'ftp.put': 'ftp.put(url, content)', @@ -352,8 +369,6 @@ let g:xolox#lua_data#signatures = { \ 'smtp.message': 'smtp.message(mesgt)', \ 'socket.bind': 'socket.bind(address, port [, backlog])', \ 'socket.connect': 'socket.connect(address, port [, locaddr, locport])', - \ 'socket.dns.tohostname': 'socket.dns.tohostname(address)', - \ 'socket.dns.toip': 'socket.dns.toip(address)', \ 'socket.newtry': 'socket.newtry(finalizer)', \ 'socket.protect': 'socket.protect(func)', \ 'socket.select': 'socket.select(recvt, sendt [, timeout])', @@ -361,6 +376,10 @@ let g:xolox#lua_data#signatures = { \ 'socket.skip': 'socket.skip(d [, ret1, ret2 ... retN])', \ 'socket.sleep': 'socket.sleep(time)', \ 'socket.source': 'socket.source(mode, socket [, length])', + \ 'socket.gettime': 'socket.gettime()', + \ 'socket.dns.gethostname': 'socket.dns.gethostname()', + \ 'socket.dns.tohostname': 'socket.dns.tohostname(address)', + \ 'socket.dns.toip': 'socket.dns.toip(address)', \ 'socket.try': 'socket.try(ret1 [, ret2 ... retN])', \ 'url.absolute': 'url.absolute(base, relative)', \ 'url.build': 'url.build(parsed_url)', diff --git a/doc/ft_lua.txt b/doc/ft_lua.txt index dce7475..41272ad 100644 --- a/doc/ft_lua.txt +++ b/doc/ft_lua.txt @@ -54,7 +54,7 @@ code in Vim by providing the following features: call will try to open the relevant documentation in the Lua Reference for Vim [6] -- The |'completefunc'| option is set to allow completion of Lua 5.1 keywords, +- The |'completefunc'| option is set to allow completion of Lua 5.2 keywords, global variables and library members using Control-X Control-U - The |'omnifunc'| option is set to allow dynamic completion of the variables @@ -309,10 +309,10 @@ This software is licensed under the MIT license [18]. Š 2014 Peter Odding References ~ [1] http://www.lua.org/ -[2] http://www.lua.org/manual/5.1/manual.html#pdf-package.path -[3] http://www.lua.org/manual/5.1/manual.html#pdf-dofile -[4] http://www.lua.org/manual/5.1/manual.html#pdf-loadfile -[5] http://www.lua.org/manual/5.1/manual.html#pdf-require +[2] http://www.lua.org/manual/5.2/manual.html#pdf-package.path +[3] http://www.lua.org/manual/5.2/manual.html#pdf-dofile +[4] http://www.lua.org/manual/5.2/manual.html#pdf-loadfile +[5] http://www.lua.org/manual/5.2/manual.html#pdf-require [6] http://www.vim.org/scripts/script.php?script_id=1291 [7] http://peterodding.com/code/vim/lua-ftplugin/screenshots/omni-completion.png [8] http://peterodding.com/code/vim/downloads/lua-ftplugin.zip diff --git a/ftplugin/lua.vim b/ftplugin/lua.vim index 4b55f82..3a53f25 100644 --- a/ftplugin/lua.vim +++ b/ftplugin/lua.vim @@ -1,5 +1,5 @@ " Vim file type plug-in -" Language: Lua 5.1 +" Language: Lua 5.2 " Author: Peter Odding " Last Change: June 17, 2014 " URL: http://peterodding.com/code/vim/lua-ftplugin diff --git a/misc/lua-ftplugin/getsignatures.lua b/misc/lua-ftplugin/getsignatures.lua index 3e64f38..361248b 100755 --- a/misc/lua-ftplugin/getsignatures.lua +++ b/misc/lua-ftplugin/getsignatures.lua @@ -1,7 +1,7 @@ #!/usr/bin/env lua local http = require 'socket.http' -local webpage = http.request 'http://www.lua.org/manual/5.1/manual.html' +local webpage = http.request 'http://www.lua.org/manual/5.2/manual.html' local matches = {} for anchor, signature in webpage:gmatch '

%s*%s*%s*(.-)%s*%s*%s*

' do if anchor ~= signature then diff --git a/misc/lua-ftplugin/omnicomplete.lua b/misc/lua-ftplugin/omnicomplete.lua index 32a7354..2519938 100755 --- a/misc/lua-ftplugin/omnicomplete.lua +++ b/misc/lua-ftplugin/omnicomplete.lua @@ -16,7 +16,7 @@ global state. local keywords = { ['and'] = true, ['break'] = true, ['do'] = true, ['else'] = true, ['elseif'] = true, ['end'] = true, ['false'] = true, - ['for'] = true, ['function'] = true, ['if'] = true, ['in'] = true, + ['for'] = true, ['function'] = true, ['goto'] = true, ['if'] = true, ['in'] = true, ['local'] = true, ['nil'] = true, ['not'] = true, ['or'] = true, ['repeat'] = true, ['return'] = true, ['then'] = true, ['true'] = true, ['until'] = true, ['while'] = true } diff --git a/plugin/lua-ftplugin.vim b/plugin/lua-ftplugin.vim index 01191b5..05c6ce5 100644 --- a/plugin/lua-ftplugin.vim +++ b/plugin/lua-ftplugin.vim @@ -1,5 +1,5 @@ " Vim file type plug-in -" Language: Lua 5.1 +" Language: Lua 5.2 " Author: Peter Odding " Last Change: August 19, 2013 " URL: http://peterodding.com/code/vim/lua-ftplugin