aboutsummaryrefslogtreecommitdiff
path: root/files/.vim/plugin/luarefvim.vim
diff options
context:
space:
mode:
authorAnton Bobov <bobov_a@sibsac.ru>2011-10-13 11:17:19 +0600
committerAnton Bobov <bobov_a@sibsac.ru>2011-10-13 11:17:19 +0600
commitda709cd9e90c3ab644bb92700f0ed40d965b80d3 (patch)
tree144e5470327f72b8489141cd7595b652c6c32616 /files/.vim/plugin/luarefvim.vim
Initial commit.
Diffstat (limited to 'files/.vim/plugin/luarefvim.vim')
-rwxr-xr-xfiles/.vim/plugin/luarefvim.vim30
1 files changed, 30 insertions, 0 deletions
diff --git a/files/.vim/plugin/luarefvim.vim b/files/.vim/plugin/luarefvim.vim
new file mode 100755
index 0000000..cb5664c
--- /dev/null
+++ b/files/.vim/plugin/luarefvim.vim
@@ -0,0 +1,30 @@
+" luarefvim plugin
+" This is somewhat based on CRefVim
+" Maintainer: Luis Carvalho <lexcarvalho@gmail.com>
+" Last Change: Jun, 3, 2005
+" Version: 0.2
+
+" initial setup: avoid loading more than once
+if exists("loaded_luarefvim")
+ finish
+endif
+let loaded_luarefvim = 1
+
+" mappings:
+vmap <silent> <unique> <Leader>lr y:call <SID>LookUp('<c-r>"')<CR>
+nmap <silent> <unique> <Leader>lr :call <SID>LookUp(expand("<cword>"))<CR>
+map <silent> <unique> <Leader>lc :help luaref<CR>
+
+function <SID>LookUp(str)
+ if a:str == "--" "comment?
+ silent! execute ":help lrv-comment"
+ elseif a:str == ""
+ silent! execute ":help luaref"
+ else
+ silent! execute ":help lrv-" . a:str
+ if v:errmsg != ""
+ echo "luarefvim: \`" . a:str . "\' not found"
+ endif
+ endif
+endfunction
+