"VSCode function! s:split(...) abort let direction = a:1 let file = a:2 call VSCodeCall(direction == 'h' ? 'workbench.action.splitEditorDown' : 'workbench.action.splitEditorRight') if file != '' call VSCodeExtensionNotify('open-file', expand(file), 'all') endif endfunction function! s:splitNew(...) let file = a:2 call s:split(a:1, file == '' ? '__vscode_new__' : file) endfunction function! s:closeOtherEditors() call VSCodeNotify('workbench.action.closeEditorsInOtherGroups') call VSCodeNotify('workbench.action.closeOtherEditors') endfunction function! s:manageEditorSize(...) let count = a:1 let to = a:2 for i in range(1, count ? count : 1) call VSCodeNotify(to == 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize') endfor endfunction command! -complete=file -nargs=? Split call split('h', ) command! -complete=file -nargs=? Vsplit call split('v', ) command! -complete=file -nargs=? New call split('h', '__vscode_new__') command! -complete=file -nargs=? Vnew call split('v', '__vscode_new__') command! -bang Only if == '!' | call closeOtherEditors() | else | call VSCodeNotify('workbench.action.joinAllGroups') | endif nnoremap s :call split('h') xnoremap s :call split('h') nnoremap v :call split('v') xnoremap v :call split('v') nnoremap n :call splitNew('h', '__vscode_new__') xnoremap n :call splitNew('h', '__vscode_new__') nnoremap :call VSCodeNotify('workbench.action.focusBelowGroup') xnoremap :call VSCodeNotify('workbench.action.focusBelowGroup') nnoremap :call VSCodeNotify('workbench.action.focusAboveGroup') xnoremap :call VSCodeNotify('workbench.action.focusAboveGroup') nnoremap :call VSCodeNotify('workbench.action.focusLeftGroup') xnoremap :call VSCodeNotify('workbench.action.focusLeftGroup') nnoremap :call VSCodeNotify('workbench.action.focusRightGroup') xnoremap :call VSCodeNotify('workbench.action.focusRightGroup') nnoremap = :call VSCodeNotify('workbench.action.evenEditorWidths') xnoremap = :call VSCodeNotify('workbench.action.evenEditorWidths') nnoremap > :call manageEditorSize(v:count, 'increase') xnoremap > :call manageEditorSize(v:count, 'increase') nnoremap + :call manageEditorSize(v:count, 'increase') xnoremap + :call manageEditorSize(v:count, 'increase') nnoremap < :call manageEditorSize(v:count, 'decrease') xnoremap < :call manageEditorSize(v:count, 'decrease') nnoremap - :call manageEditorSize(v:count, 'decrease') xnoremap - :call manageEditorSize(v:count, 'decrease') nnoremap _ :call VSCodeNotify('workbench.action.toggleEditorWidths')