Add window horizontal/vertical toggle
This commit is contained in:
17
vimrc
17
vimrc
@@ -374,3 +374,20 @@ function! PrintFile(fname)
|
|||||||
call delete(a:fname)
|
call delete(a:fname)
|
||||||
return v:shell_error
|
return v:shell_error
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ToggleWindowHorizontalVerticalSplit()
|
||||||
|
if !exists('t:splitType')
|
||||||
|
let t:splitType = 'vertical'
|
||||||
|
endif
|
||||||
|
|
||||||
|
if t:splitType == 'vertical' " is vertical switch to horizontal
|
||||||
|
windo wincmd K
|
||||||
|
let t:splitType = 'horizontal'
|
||||||
|
else " is horizontal switch to vertical
|
||||||
|
windo wincmd H
|
||||||
|
let t:splitType = 'vertical'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap <silent> <leader>wt :call ToggleWindowHorizontalVerticalSplit()<cr>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user