Barbarian Meets Coding

presents

Boost Your Coding Fu With VSCode and Vim
Chapter 20.Table of ContentsCheatsheet

Enhanced File Explorer, Panes and Palettes

You can take advantage of your newly learned Vim bindings to interact with the VSCode’s File explorer. Jump inside the File explorer via the command palette, or by simply moving from the code window via <CTRL-W> h and you’ll be able to:

  • Traverse file explorer up and down with k and j.
  • Expand directories with l (right) when the cursor is over a directory.
  • Collapse directories with h (left).
  • Open files with l (right) when the cursor is on a file.

This is nice if you’re new to a project and want to have an idea about how the project is structured. Otherwise, always prefer using Visual Studio’s Go To functionality. Remember:

  • Go To File with CMD-P in Mac (or CTRL-P in Windows/Linux)
  • Go To Symbol in File with CMD-SHIFT-O in Mac (or CTRL-SHIFT-O in Windows/Linux)
  • Go To Symbol in Workspace with with CMD-T in Mac (or CTRL-T in Windows/Linux)

Likewise you can use k and j with panes and palettes. Whenever you open a command palette or the Go To panes, you can:

  1. Type TAB which will take you to the selection area and,
  2. From there you can use k and j to go up and down to the item you desire.
  3. Press Enter and you’ll either open a file or perform a command palette action.

Jaime González García

Written by Jaime González García , Dad, Husband, Front-end software engineer, UX designer, amateur pixel artist, tinkerer and master of the arcane arts. You should follow him on Twitter where he shares useful stuff! (and is funny too).Jaime González García