From 9379982b7ed35c1bae40725b11d2b372d9b56b1f Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 1 Sep 2020 20:34:19 -0400 Subject: vscodium updates --- vscode/settings.vim | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ vscode/windows.vim | 76 ----------------------------------------------------- 2 files changed, 75 insertions(+), 76 deletions(-) create mode 100644 vscode/settings.vim delete mode 100644 vscode/windows.vim (limited to 'vscode') diff --git a/vscode/settings.vim b/vscode/settings.vim new file mode 100644 index 00000000..3df722a1 --- /dev/null +++ b/vscode/settings.vim @@ -0,0 +1,75 @@ +" TODO there is a more contemporary version of this file +"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.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') + +" Better Navigation +nnoremap :call VSCodeNotify('workbench.action.navigateDown') +xnoremap :call VSCodeNotify('workbench.action.navigateDown') +nnoremap :call VSCodeNotify('workbench.action.navigateUp') +xnoremap :call VSCodeNotify('workbench.action.navigateUp') +nnoremap :call VSCodeNotify('workbench.action.navigateLeft') +xnoremap :call VSCodeNotify('workbench.action.navigateLeft') +nnoremap :call VSCodeNotify('workbench.action.navigateRight') +xnoremap :call VSCodeNotify('workbench.action.navigateRight') + +" Bind C-/ to vscode commentary since calling from vscode produces double comments due to multiple cursors +xnoremap :call Comment() +nnoremap :call Comment() + +nnoremap _ :call VSCodeNotify('workbench.action.toggleEditorWidths') + +nnoremap :call VSCodeNotify('whichkey.show') +xnoremap :call VSCodeNotify('whichkey.show') diff --git a/vscode/windows.vim b/vscode/windows.vim deleted file mode 100644 index e6ce55da..00000000 --- a/vscode/windows.vim +++ /dev/null @@ -1,76 +0,0 @@ -" TODO there is a more contemporary version of this file -"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.navigateDown') -xnoremap :call VSCodeNotify('workbench.action.navigateDown') -nnoremap :call VSCodeNotify('workbench.action.navigateUp') -xnoremap :call VSCodeNotify('workbench.action.navigateUp') -nnoremap :call VSCodeNotify('workbench.action.navigateLeft') -xnoremap :call VSCodeNotify('workbench.action.navigateLeft') -nnoremap :call VSCodeNotify('workbench.action.navigateRight') -xnoremap :call VSCodeNotify('workbench.action.navigateRight') - -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') - -" Bind C-/ to vscode commentary since calling from vscode produces double comments due to multiple cursors -xnoremap :call Comment() -nnoremap :call Comment() - -nnoremap _ :call VSCodeNotify('workbench.action.toggleEditorWidths') - -" nnoremap :call VSCodeCall('whichkey.show') -" xnoremap :call VSCodeCall('whichkey.show') - -nnoremap :call VSCodeNotify('whichkey.show') -xnoremap :call VSCodeNotify('whichkey.show') -- cgit v1.2.3