# VS Code Hotkeys
| | url:: [VS Code Hotkeys](https://code.visualstudio.com/docs/getstarted/keybindings) |
| ---- | ---- |
- Command Pallette
- cmd-shift-p
- Terminal
- ctrl-\` (backtick)
- toggle terminal panel
- shift-ctrl-\` (backtick)
- Launch new shell in terminal panel
- ctrl-opt-\` (backtick)
- Maximize terminal panel toggle
- Quick Open
- cmd-p
- Distinct from command pallete - you know the name of the file - you can quickly type it in without having to hunt through folders
- Search current editor
- cmd-f
- Search all files and folders
- (in the currently selected folder)
- shift + command + F
- Select Words
- Cmd-D
- Selects word at cursor or selects next highlighted word.
- Cmd-U
- "Cursor undo"
- Unselects last selected word from Cmd-D (and other situations?)
- Cmd-Shift-L
- Adds multi-cursor at each selected word
- Reveal current file in VS Code Explorer
- `Ctrl-Opt-R`
- Reveal current file in Finder
- `Opt-Cmd-R`
- Toggle File Explorer
- Great to quickly get more screen real estate
- cmd-b
- Double-click edge of sidebar to resize to the current content of the sidebar.
- Toggle Sidebar Focus
- cmd-shift-e if you just want to toggle focus to the file explorer specifically.
- Arrow keys to move up and down and collapse and uncollapse folders
- Enter to open file in new tab (permanently (like a double-click to keep the file open)) and focus on that file
- Space to temp-open the file and keep focus on sidebar
- Via custom shortcut v
- Cmd-N to create new file in currently selected folder in Explorer Sidebar
- You can type chars to filter what files you cycle through via up-down arrows. E.g., you can type .js and every up or down arrow will go to the next file that contains .js
- ? Use ⌃/⌘+ 0 to set focus to the Siebar and ⌃/⌘+ 1 to set it to the editor. On a Mac, you can use ⌃/⌘+ ⇣ to select a file in the Sidebar Explorer with your keyboard. On Windows just press the enter key. ?
- Navigate between open tabs (Chronological?)
- Ctrl-Tab & Ctrl-Shift-Tab
- shift + command + \] OR \[
- Next|Previous Tab (Spatial)
- `Opt-Cmd-Right|Left`
- Focus Tab 1-9?
- `Ctrl-1-9`
- Split/move Current editor tab to the right|Left|Up|Down
- Can move the current editor tab left or right respectively
- Really great because it moves the tab to a new split view instead of copying it which the UI does
- `Ctrl-Cmd-Right|Left|Up|Down`
- Focus Group Right|Left|Below|Above
- `Hyper-Right|Left|Down|Up`
- Focus Group 1-8-last
- `Cmd-1-9`
- Focus Sidebar (Primary)
- `Cmd-0`
- Move Line Down/Up
- Ideally this would be universal to other apps
- opt/alt + Arrow UP or DOWN
- Duplicate Line Down/Up
- shift + opt/alt + Arrow UP or DOWN
- Multicursor
- Opt-Cmd-Up or Down (Mac)
- Ctrl-Alt-Up or Down (Win)
- Zen Mode
- cmd-k z
- esc esc to exit
- Indent/unindent
- Cmd-\[ or \]
- Auto Format/Auto Indent
- https://stackoverflow.com/questions/52176705/visual-studio-code-how-to-indent-selection
- Selection
- 'CTRL + K, CTRL + F'
- Whole Document
- 'SHIFT + ALT + F'
- Custom Keyboard Shortcuts
- Toggle between editor and terminal (and toggle between terminals)
- // Place your key bindings in this file to override the defaults \[ // Toggle to terminal focus { "key": "ctrl+\`", "command": "workbench.action.terminal.focus" }, // Toggle to editor focus { "key": "ctrl+\`", "command": "workbench.action.focusActiveEditorGroup", "when": "terminalFocus" }, //cycle to next terminal session { "key": "shift+cmd+\]", "command": "workbench.action.terminal.focusNext", "when": "terminalFocus" } \]
- https://peteskelly.com/custom-vscode-bindings/
- Cmd-N creates new file in currently selected folder in Explorer Sidebar instead of just a new tab that you have to manually save
- https://stackoverflow.com/questions/39599514/vs-code-add-a-new-file-under-the-selected-working-directory
- { "key": "ctrl+n", "command": "explorer.newFile" }
- Delete line
- `Shift-Cmd-K`
- Select line
- CmdiL
- Cut/copy commands work on whole line when there is no selected text
- Insert line below
- cmd-enter
- Insert line above
- Shift-cmd-enter
- Smart select expand/shrink (to brackets, quotes, etc.)
- ⌃⇧⌘→
- ⌃⇧⌘←