This commit is contained in:
Talia 2017-11-13 08:06:02 +01:00
commit 4a022485c9

11
vimrc
View file

@ -108,8 +108,10 @@ endfunc
function! s:autoClose_HelperClose(open, close) function! s:autoClose_HelperClose(open, close)
if getline(".")[col(".")-1] ==# a:close if getline(".")[col(".")-1] ==# a:close
return "\<Right>" return "\<Right>"
elseif match(getline("."+1), "\M^\s*".escape(a:close, "\\")) elseif getline(line(".")+1)
if match(getline(line(".")+1), "\M^\s*".escape(a:close, "\\"))
return "\<Down>\<Home>\<C-o>f".a:close."\<Right>" return "\<Down>\<Home>\<C-o>f".a:close."\<Right>"
end
else else
return a:close return a:close
end end
@ -528,10 +530,15 @@ endfunction
" augroup END " augroup END
" --- Lua Stuff --- " --- Lua Stuff ---
" Matches all types of Lua string!
" \v(["'])\zs.{-}\ze\\@1<!\2|\[(\=*)\[\zs.{-}\ze\]\3\]
au BufNewFile,BufRead *.lua :call <sid>init_lua_file() au BufNewFile,BufRead *.lua :call <sid>init_lua_file()
function! s:init_lua_file() function! s:init_lua_file()
command! -buffer Requires lex MatchingLines("^\\s*require\\>.*$") command! -buffer Requires call setloclist(0, MatchingLinesDict("\\vrequire\\s*\\(?(([\"'])\\zs.{-}\\ze\\\\@1<!\\2|\\[(\\=*)\\[\\zs.{-}\\ze\\]\\3\\])\\)?"))
command! -buffer Functions call setloclist(0, MatchingLinesDict("^\\v(\\s*\\zs(local\\s*)?function\\s*[a-zA-Z0-9.:_]*\\(.*\\)(\\s*--.*|\\ze.*)|.*function\\(.*\\)(\\s*--.*|\\ze.*))$"))
call s:autoClose_AddPair("[", "]") call s:autoClose_AddPair("[", "]")
call s:autoClose_AddPair("(", ")") call s:autoClose_AddPair("(", ")")