Use Visual Studio Code like a Pro
Purpose |
Keystrokes |
Illustration |
Move line up/down |
⌥ ⇡ ⌥ ⇣ |
![move a line up/down move a line up/down](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/move-line-updown.gif) |
Move selected line(s) up/down |
⌥ ⇡ ⌥ ⇣ |
![move line selection up/down move line selection up/down](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/move-selection-updown.gif) |
Move cursor forward/backward by a word |
⌥ ⇢ ⌥ ⇠ |
![move by a word move by word](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/move-word-startend.gif) |
Move cursor to the beginning/end of the line |
⌘ ⇢ ⌘ ⇠ |
![Move cursor to the beginning/end of the line Move cursor to the beginning/end of the line](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/move-to-line-startend.gif) |
Move cursor to the beginning/end of file |
⌘ ⇡ ⌘ ⇣ |
![Move cursor to the beginning/end of file Move cursor to the beginning/end of file](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/move-to-file-startend.gif) |
Indent/outdent selection |
⌘ ] ⌘ [ |
![Indent/outdent selection Indent/outdent selection](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/move-selection-inoutdent.gif) |
Jump to a particular line number |
⌃ G |
![Jump to a particular line number Jump to a particular line number](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/move-to-lineno.gif) |
Purpose |
Keystrokes |
Illustration |
Insert a new line (above or below) and move cursor on it |
⌘ ⏎ ⌘ ⇧ ⏎ |
![Insert new line above/below Insert new line above/below](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/insert-line.gif) |
Purpose |
Keystrokes |
Illustration |
cut line where cursor is, without selection. Cut line is available for pasting. |
⌘ X |
![cut line without selection cut line without selection](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/cut-line.gif) |
Remove line where cursor is, without selection. Cut line is not available for pasting. |
⌘ ⇧ K |
![remove line remove line](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/remove-line.gif) |
Purpose |
Keystrokes |
Illustration |
copy line and paste it |
⌘ C ⌘ V |
![copy & paste line copy & paste line](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/copy-paste-line.gif) |
cut line and paste it |
⌘ X ⌘ V |
![cut & paste line cut & paste line](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/cut-paste-line.gif) |
copy line where cursor is, without selection, paste it up or down |
⌥ ⇧ ⇡ ⌥ ⇧ ⇣ |
![copy line & paste it up or down copy line & paste it up or down](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/copy-paste-line-updown.gif) |
Purpose |
Keystrokes |
Illustration |
Select occurences of selected text or the word where cursor is, then delete and type or paste to replace |
⌘ D |
![replace word/selection occurences replace word/selection occurences](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/replacing-word-occurences.gif) |
Select all occurences of selected text or the word where cursor is, then delete and type or paste to replace |
⌘ ⇧ L |
![replace word/selection occurences replace word/selection occurences](https://raw.githubusercontent.com/sahajre/vscode-pro-tips/master/./gifs/selecting-all-matches.gif) |
Purpose |
Keystrokes |
Illustration |
Purpose |
Keystrokes |
Illustration |
Purpose |
Keystrokes |
Illustration |