You cannot reassign an existing split command as far as I know, but you can achieve the same effect by writing a new split function and then using the command mode abbreviation ( cabbrev ),
Here's a / mapping function that should do what you want.
function! MySplit( fname ) let bufnum=bufnr(expand(a:fname)) let winnum=bufwinnr(bufnum) if winnum != -1 " Jump to existing split exe winnum . "wincmd w" else " Make new split as usual exe "split " . a:fname endif endfunction command! -nargs=1 Split :call MySplit("<args>") cabbrev split Split
Note that this will only βcheckβ for existing splits on the current tab, and hidden buffers are ignored. (However, it should not be too difficult to add more cases to improve this functionality.)
source share