Editor: VS Code

Misc links:

Hotkeys

Sidebar

  • Toggle side pane: CMD+B

Explorer:

  • Switch to file pane: SHIFT+CMD+E (How to remember? Same hotkey prefix for find: SHIFT+CMD+F)

  • Open file in next pane: Hold CMD while click the file or CMD+ENTER

Search:

  • Swith to the search pane: SHIFT+CMD+F (simialr to Explorer pane: SHIFT+CMD+E)

  • Switch search history: ALT+UP/DOWN

  • Path glob pattern:

    Click on the toggle to the right to enable the glob pattern syntax:
    
    * to match one or more characters in a path segment
    ? to match on one character in a path segment
    ** to match any number of path segments, including none
    {} to group conditions (e.g. {**/*.html,**/*.txt} matches all HTML and text files)
    [] to declare a range of characters to match (e.g., example.[0-9] to match on example.0, example.1, …)

Navigation in Editor

  • Switch editors p 1/2/3: CMD+1/2

  • in CMD+P Quick Open list, hit enter to open in current pane, hit CMD+\ to open in next pane.

  • Move active editor to left/right group: CTRL+CMD+LEFT/RIGHT

  • Switching files inside on editor: SHIFT+ALT+TAB

Editing

  • Show IntelliSense: CTRL+SPACE

  • Find by symbol (instead of find by text): CMD+SHIFT+O

    • When viewing JSON file, it'll find by the key.

    • When viewing HTML, it'll find by class or id.

  • File navigation:

    • :punch: Show list of files in one editor or go back and forth between files: CTRL+TAB

    • CTRL+- to go back last file

    • to last position: CMD+U

  • Code reformatting: CMD+K, CMD+F

  • Code folding: SHIFT+CMD+[ or ]

  • Trim trailing whitespace: CMD+SHIFT+X

Multi-cursor:

  • In Insert mode, use ALT/OPTION + click to add multiple cursor, then press ESC to go to view mode.

  • In Normal mode, use CMD+D to select multiple instances, then press ESC to go to view mode.

  • In Insert mode, select lines and use SHIFT+CMD+L to turn lines into selections. (Require custom keyboard setup, see eblow)

  • How to select all in file search result? CMD+F -> type search word -> ALT + ENTER

Terminal: "ctrl+`"

Custom Hotkeys

Task

A task is shortcut to run external action (grunt, shell) without leaving your editor, such as build, test, etc.

To use, press CMD+P and type: task TASK_NAME.

Sample task:

Debug

  • You can press F5 to debug any single file.

  • Link to doc

Packages

  • Monokai theme

  • Diff Tool

  • TSLint

  • TSLint

  • GitLens

  • Markdown All in One

  • Prettier

  • Quokka.js

  • SASS Formatter

  • TypeScrip[t Import Sorter]

  • Vim

  • Prettify JSON

  • Open Spec File

Code Formatting Setup

https://medium.com/@hamxiaoz/visual-studio-code-formatting-setup-9f40a95699ce

User Settings

Setup

How to add an "Open with VS Code" icon in Finder toolbar?

Go to my repo open-folder-with-vs-code and follow the instructions.

Last updated