Vimで画面分割して指定行に移動する - daisuzu's notes が便利そうだったので自分で使う用に少し手を加えた。
count がなかったら、そのまま split, vsplit を実行する。
execute cnt . 'G'
だと曖昧だと怒られたので cursor() を使ってみた。
nnoremap _ :SplitAndGo split<CR>
nnoremap <bar> :SplitAndGo vsplit<CR>
command! -count=1 -nargs=1 -complete=customlist,SAG_Complete SplitAndGo call SplitAndGo(<q-args>)
function! SplitAndGo(cmd)
execute a:cmd
if !v:count
return
endif
execute "normal! " . v:count . 'G'
endfunction
function! SAG_Complete(ArgLead, CmdLine, CursorPos)
return ['split', 'vsplit']
endfunction