You'd have to override the default commands in your $HOME/.vimrc
with your own mappings that include this extra logic. When the normal move doesn't change the window any more (i.e. we're at the border already), jump to the other side.
"
" Wrap window-move-cursor
"
function! s:GotoNextWindow( direction, count )
let l:prevWinNr = winnr()
execute a:count . 'wincmd' a:direction
return winnr() != l:prevWinNr
endfunction
function! s:JumpWithWrap( direction, opposite )
if ! s:GotoNextWindow(a:direction, v:count1)
call s:GotoNextWindow(a:opposite, 999)
endif
endfunction
nnoremap <silent> <C-w>h :<C-u>call <SID>JumpWithWrap('h', 'l')<CR>
nnoremap <silent> <C-w>j :<C-u>call <SID>JumpWithWrap('j', 'k')<CR>
nnoremap <silent> <C-w>k :<C-u>call <SID>JumpWithWrap('k', 'j')<CR>
nnoremap <silent> <C-w>l :<C-u>call <SID>JumpWithWrap('l', 'h')<CR>
nnoremap <silent> <C-w><Left> :<C-u>call <SID>JumpWithWrap('h', 'l')<CR>
nnoremap <silent> <C-w><Down> :<C-u>call <SID>JumpWithWrap('j', 'k')<CR>
nnoremap <silent> <C-w><Up> :<C-u>call <SID>JumpWithWrap('k', 'j')<CR>
nnoremap <silent> <C-w><Right> :<C-u>call <SID>JumpWithWrap('l', 'h')<CR>