Browse files

Pull request #19: Map K for help lookup (in normal mode)

  • Loading branch information...
2 parents d85872c + e3e7ab4 commit 090371f19c96c4ca265ba0d69c83ab2e9597afd1 @xolox committed Jun 17, 2014
Showing with 8 additions and 5 deletions.
  1. +1 −1 README.md
  2. +1 −1 autoload/xolox/lua.vim
  3. +3 −2 doc/ft_lua.txt
  4. +3 −1 ftplugin/lua.vim
View
2 README.md
@@ -8,7 +8,7 @@ The [Lua][lua] file type plug-in for [Vim][vim] makes it easier to work with Lua
* An automatic command is installed that runs `luac -p` when you save your Lua scripts. If `luac` reports any errors they are shown in the quick-fix list and Vim jumps to the line of the first error. If `luac -p` doesn't report any errors a check for undefined global variables is performed by parsing the output of `luac -p -l`
- * `<F1>` on a Lua function or 'method' call will try to open the relevant documentation in the [Lua Reference for Vim][lrv]
+ * `K` (normal mode) and `<F1>` (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
View
2 autoload/xolox/lua.vim
@@ -3,7 +3,7 @@
" Last Change: June 17, 2014
" URL: http://peterodding.com/code/vim/lua-ftplugin
-let g:xolox#lua#version = '0.7.19'
+let g:xolox#lua#version = '0.7.20'
let s:miscdir = expand('<sfile>:p:h:h:h') . '/misc/lua-ftplugin'
let s:omnicomplete_script = s:miscdir . '/omnicomplete.lua'
let s:globals_script = s:miscdir . '/globals.lua'
View
5 doc/ft_lua.txt
@@ -49,8 +49,9 @@ code in Vim by providing the following features:
report any errors a check for undefined global variables is performed by
parsing the output of 'luac -p -l'
-- '<F1>' on a Lua function or 'method' call will try to open the relevant
- documentation in the Lua Reference for Vim [6]
+- 'K' (normal mode) and '<F1>' (insert mode) on a Lua function or 'method'
+ 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,
global variables and library members using Control-X Control-U
View
4 ftplugin/lua.vim
@@ -1,7 +1,7 @@
" Vim file type plug-in
" Language: Lua 5.1
" Author: Peter Odding <peter@peterodding.com>
-" Last Change: August 31, 2013
+" Last Change: June 17, 2014
" URL: http://peterodding.com/code/vim/lua-ftplugin
if exists('b:did_ftplugin')
@@ -52,8 +52,10 @@ call add(s:undo_ftplugin, 'delcommand CheckGlobals')
" Define mappings for context-sensitive help using Lua Reference for Vim. {{{1
imap <buffer> <F1> <C-o>:call xolox#lua#help()<Cr>
nmap <buffer> <F1> :call xolox#lua#help()<Cr>
+nmap <buffer> K :call xolox#lua#help()<Cr>
call add(s:undo_ftplugin, 'iunmap <buffer> <F1>')
call add(s:undo_ftplugin, 'nunmap <buffer> <F1>')
+call add(s:undo_ftplugin, 'nunmap <buffer> K')
" Define custom text objects to navigate Lua source code. {{{1
noremap <buffer> <silent> [{ m':call xolox#lua#jumpblock(0)<Cr>

0 comments on commit 090371f

Please sign in to comment.