Open a new vsplit or jump to next split (if exists)

1 Point

Alexander Tsygankov Alexander Tsygankov

10 years ago

Use Tab to open a new split or jump to the existing one.

  nnoremap <silent><Tab> :call MoveOrOpenSplit()<CR>
  function! MoveOrOpenSplit() " {{{
    let curNr = winnr()
    wincmd w
    if winnr() == curNr
      exe 'vsplit'
      wincmd w
    endif
  endfunction " }}}