VSCode Bindings to Mimic my VIM Setup

I meant to post this with my prior posts re: the VSCode File Explorer Menu extension. I wanted to write something detailing my current setup in VSCode that that attempts to mimic my VIM setup.

The first bit of settings are the ones I have setup in Keyboard Shortcuts (i.e. keybindings.json), the second set are the ones that are in the settings which are attached to VSCode VIM’s normal mode bindings (gist available here).

keybindings.json

CommandKeyWhenNotes
list.focusDownjexplorerViewletVisible && filesExplorerFocus && !inputFocusGoes to the next item in the file explorer.
list.focusUpkexplorerViewletVisible && filesExplorerFocus && !inputFocusGoes to the previous item in the file explorer.
workbench.action.quickOpenPreviousRecentlyUsedEditorInGroupctrl+eThis opens up a list of most recently used files.
workbench.action.gotoSymbolctrl+f12This is technically from my Resharper days, but I decided to bring it over to VSCode. This opens a quick drop down of symbols in the file.
-workbench.action.openNextRecentlyUsedEditorInGroupctrl+tabOpens the next tab.
-workbench.action.openPreviousRecentlyUsedEditorInGroupctrl+shift+tabOpens previous tab.
workbench.action.toggleSidebarVisibility, e wfilesExplorerFocus && !editorTextFocusToggles and focuses on file explorer.
selectNextSuggestionctrl+jsuggestWidgetVisiblePicks next autocomplete suggestion.
selectPrevSuggestionctrl+ksuggestWidgetVisiblePicks previous autocomplete suggestion.
workbench.action.quickOpenSelectNextctrl+jinQuickOpenSimilar as above but for opening the next quick open item.
workbench.action.quickOpenSelectPrevctrl+kinQuickOpenSelects previous quick open item.
search.action.focusNextSearchResultctrl+jhasSearchResult && searchViewletVisiblePicks next search result when search widget is visible.
search.action.focusPrevSearchResultctrl+khasSearchResult && searchViewletVisiblePicks previous search result when search widget is visible.

settings.json

BeforeCommandsNotes
:workbench.action.gotoLineJumps to specified line number.
leader
r
editor.action.referenceSearch.triggerSearches for references under cursor.
leader
c
t
workbench.action.closeEditorsInGroupThis is closes the “split”. I often will open a split, do some work, then trigger this command to close it back out.
leader
s
t
workbench.action.files.showOpenedFileInNewWindowThis is probably one of the few things from VIM I wasn’t able to fully replicate, I used to pretty regularly use “:tab split” in Vim to create a new tab in VIM which was in it’s own way like a separate workspace (especially with plugins like Ctrl-Space). The closest I’ve come to replicating this in VSCode is to just open the file in a new window. Unfortunately it opens the file in complete isolation so you lose all of the project’s context.
leader
g
d
editor.action.goToTypeDefinitionJumps to type definition.
leader
g
i
editor.action.goToImplementationJumps to type implementation.
Tworkbench.action.terminal.toggleTerminalOpens up the Terminal.
leader
j
editor.action.marker.nextJumps to the next error/warning.
leader
k
editor.action.marker.prevJumps to the previous error/warning.
leader
t
workbench.action.toggleSidebarVisibilityToggles sidebar.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s