diff --git a/plugin/offside.vim b/plugin/offside.vim new file mode 100644 index 0000000..0644d5c --- /dev/null +++ b/plugin/offside.vim @@ -0,0 +1,23 @@ +function! s:InnerOffside() " {{{ + let l:line = line('.') + let l:indent = indent(l:line) + for l:start in range(l:line, 0, -1) + if indent(l:start) <# l:indent + break + endif + endfor + for l:end in range(l:line, line('$') + 1) + if indent(l:end) <# l:indent + break + endif + endfor + return (l:start + 1) . 'GV' . (l:end - 1) . 'G' +endfunction " }}} + + +vnoremap InnerOffside InnerOffside() + +if !hasmapto('InnerOffside') + vmap io InnerOffside + onoremap io :normal vio +endif