Last active
May 3, 2023 13:57
-
-
Save ryaustin/937042e5a5866e9b3ccb5ef0ea22eb22 to your computer and use it in GitHub Desktop.
Visual Studio Code shortcuts for the productive developer.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**VS CODE Productivity Shortcuts** π©βπ»π§π½βπ»π¨πΌβπ»π©πΌβπ»π©πΎβπ» | |
A kind note: I haven't tested these on windows, if you notice an error, drop it in the comments :). | |
1. Opening and closing sidebar π | |
The sidebar can be opened and closed without clicking on the left-hand side tab using the following shortcuts. | |
Mac β Command + B | |
Windows β Ctrl + B | |
ββ | |
2. Select word β€΅οΈ | |
I use this one to select the word at my cursers current position. This is useful when you want to change the name of a variable or function. | |
You can also highlight the word and continue to use the shortcut to highlight the next instance of the word. | |
Mac β Command + D | |
Windows β Ctrl + D | |
ββ | |
3. Split Editor π | |
A split editor (side by side) is often useful if you need to compare two files or refer to another file while making changes to a different file | |
Mac β Command + \ or 2,3,4 | |
Windows β Shift + Alt + \ or 2,3,4 | |
3b. Close Window πͺ | |
Mac β Command + w | |
Windows β Ctrl + w | |
βββ | |
4. Copy line up/down Β© | |
If you need to copy the current line to the line above or below, the following shortcut can be used. | |
Mac β Shift + Option + Up/Down | |
Windows β Shift + Alt + Up/Down | |
ββ | |
5. Code formatting ππ½ββοΈ | |
Code formatting allows indenting the code based on the rules already set up in the editor. | |
Windows β Shift + Alt + F | |
Mac β Shift + Option + F | |
ββ | |
6. Command Palette π¦ΈββοΈ | |
This is one of the most important key combinations to know in VS Code. You can access all available commands based on your current context using: | |
MAC β Command + Shift + P | |
Windows/Ubuntu: Ctrl +Shift + P | |
6b. Some cool command Palette shortcuts π¦Ήπ½ββοΈ | |
> - Right angle bracket exposes all the command palette shortcuts and just about anything that can be done in vs code. | |
: - go to a specific line in your code after typing a colon in the command palette. | |
@ - @ symbol exposes all of the symbols in the file. Think of this like an automatic outline that allows you to jump to any function/method quickly. A shortcut to expose just this tool is: | |
MAC β Command + Shift + . | |
Windows β Ctrl + Shirt + . | |
ββ | |
7. Move line β¬οΈ | |
Mac β Option + Up/Down arrow | |
Windows/Ubuntu β Alt + Up/Down arrow | |
ββ | |
8. Delete a line β | |
Mac -- Command + Shift + K | |
Windows -- Ctrl + Shift + K | |
-- | |
9. Duplicate line π | |
You can make the duplications of the same line using: | |
Mac β Command + Shift + D | |
Windows/Ubuntu β Ctrl + Shift + D | |
ββ | |
10. Open / Close Terminal π©πΎβπ» | |
Quickly open and close a terminal using: | |
Mac -- Comand + j | |
Windows -- Ctrl + j | |
-- | |
11. Split Terminal δ· | |
Splitting a terminal can be done using: | |
Mac -- Command + / | |
Windows -- Ctrl + / | |
hint: when working with a virtual environment, splitting a terminal will often open in the context of your virtual env which is sweet π | |
-- | |
12. Stage Selected Ranges πͺ | |
If you tend to stage changes line by line you can do so by using: | |
Under source control highlight the lines to commit then, | |
Mac -- Command + K to mark the line then Command + Option + S to stage | |
Windows -- Control + K to mark the line then Control + Alt + S to stage | |
-- | |
13. Jump to a spceific line __ | |
Mac -- Control + G | |
Windows __ Ctrl + G | |
-- | |
14. Return to previous place (after a jump) β | |
After jumping to a spcific line or function, you can return to the previous place using: | |
Mac -- Control + - | |
Windows -- Ctrl + - | |
-- | |
15. SORT YO SYMBOLS (Sort Symbols) π±π€©π€― | |
Sorry for being loud on this one but it's a huge help when working | |
in a larger code base. | |
Mac -- Cmd + Shift + o then press : and you can search or sort by an array of factors. | |
Windows -- Ctrl + Shift + o | |
This one is a game changer for me, hope you find it useful. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment