X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=vim%2F.vim%2Fplugin%2Fdefsplit.vim;h=7beb26bc11949cddc49ebac403d6cbde96d988b7;hb=c87a6c5de579ab6ae0e5d27b233b83bab85e17f6;hp=f995c8a072f4499927a01f576b113ab0725f45ce;hpb=8d4331f8ac20bfb0f5c6ce4ea0ada9618216c6f8;p=dotfiles.git diff --git a/vim/.vim/plugin/defsplit.vim b/vim/.vim/plugin/defsplit.vim index f995c8a..7beb26b 100644 --- a/vim/.vim/plugin/defsplit.vim +++ b/vim/.vim/plugin/defsplit.vim @@ -32,9 +32,8 @@ " Also there is :Brsplit command behaving similarly, but it splits other " types of brackets: "{}", "[]". -if exists("g:loaded_defsplit") | finish | endif -let g:loaded_defsplit = 1 if !exists("g:defsplit_shift") | let g:defsplit_shift = " " | endif +if exists('*Defsplit') | finish | endif function! s:bracket_find(brs_allowable, line, offset) let possible = [] @@ -45,7 +44,7 @@ function! s:bracket_find(brs_allowable, line, offset) return min(possible) endfunction -function! s:defsplit(brs_allowable, single_line_comma, ...) +function! s:Defsplit(brs_allowable, single_line_comma, ...) if a:0 == 0 | let skip = 0 | else | let skip = str2nr(a:1) | endif let shift = g:defsplit_shift let line = getline(".") @@ -95,9 +94,9 @@ function! s:defsplit(brs_allowable, single_line_comma, ...) normal "_dd endfunction -command! -nargs=? Defsplit call s:defsplit(["("], v:false, ) -command! -nargs=? Brsplit call s:defsplit(["(", "[", "{"], v:false, ) -command! -nargs=? Defsplits call s:defsplit(["("], v:true, ) -command! -nargs=? Brsplits call s:defsplit(["(", "[", "{"], v:true, ) +command! -nargs=? Defsplit call s:Defsplit(["("], v:false, ) +command! -nargs=? Brsplit call s:Defsplit(["(", "[", "{"], v:false, ) +command! -nargs=? Defsplits call s:Defsplit(["("], v:true, ) +command! -nargs=? Brsplits call s:Defsplit(["(", "[", "{"], v:true, ) command! Undefsplit normal ^v%$J:keepp s/^\(.*\)\([([{]\) \(.*[^,]\),\?\([)\]}]\)\(.*\)$/\1\2\3\4\5:keepp s/, \?\([)\]}]\+\)$/\1/e: