Knowing and applying the keyboard shortcuts is very useful and time-saving while coding/programming.
I have added some keyboard shortcuts that will help you while writing code in any editor.
Most of the shortcuts are common across most editors.
But you can modify them in most modern editors like sublime, VScode, atom, etc.
If you are using VScode you can install this extension that will change the default VScode shortcuts to sublime friendly shortcut.
I personally use the sublime shortcuts in VScode because it is familiar with sublime and easy to remember and also logical.
Keyboard Shortcuts to use:
Editing
Task / Command | Shortcut |
---|---|
Cut line | Ctrl + X |
Insert line after | Ctrl + ↩ |
Insert line before | Ctrl + ⇧ + ↩ |
Move line/selection up | Ctrl + ⇧ + ↑ |
Move line/selection down | Ctrl + ⇧ + ↓ |
Select line – Repeat to select next lines | Ctrl + L |
Select word – Repeat select others occurrences | Ctrl + D |
Jump to opening parentheses | Ctrl + M |
Select all contents of the current parentheses | Ctrl + ⇧ + M |
Delete Line | Ctrl + ⇧ + K |
Delete from cursor to end of line | Ctrl + KK |
Delete from cursor to start of line | Ctrl + K + ⌫ |
Indent current line(s) | Ctrl + ] |
Un-indent current line(s) | Ctrl + [ |
Duplicate line(s) | Ctrl + ⇧ + D |
Join line below to the end of the current line | Ctrl + J |
Comment/un-comment current line | Ctrl + / |
Block comment current selection | Ctrl + ⇧ + / |
Redo, or repeat last keyboard shortcut command | Ctrl + Y |
Paste and indent correctly | Ctrl + ⇧ + V |
Select next auto-complete suggestion | Ctrl + Space |
s before undoing change when repeated | Ctrl + U |
Wrap Selection in html tag | Alt + ⇧ + W |
Close current html tag | Alt + . |
Hard wrap line to ruler column setting | Alt + q |
Column selection up | Ctrl + Alt + Up |
Column selection down | Ctrl + Alt + Down |
Navigation/Goto Anywhere
Task / Command | Win |
---|---|
Quick-open files by name | Ctrl + P |
Goto symbol | Ctrl + R |
Goto word in current file | Ctrl + ; |
Goto line in current file | Ctrl + G |
General
Task / Command | Win |
---|---|
Command prompt | Ctrl + ⇧ + P |
Toggle side bar | Ctrl + KB |
Show scope in status bar | Ctrl + ⇧ + Alt + P |
Find and replace
Task / Command | Win |
---|---|
Find | Ctrl + F |
Replace | Ctrl + H |
Find in files | Ctrl + ⇧ + F |
Tabs
Task / Command | Win |
---|---|
Revert view to single column | Alt + ⇧ + 1 |
Split view into two columns | Alt + ⇧ + 2 |
Split view into three columns | Alt + ⇧ + 3 |
Split view into four columns | Alt + ⇧ + 4 |
Set view to grid (4 groups) | Alt + ⇧ + 5 |
Split view into two rows | Alt + ⇧ + 8 |
Jump to group where num is 1-4 | Ctrl + [NUM] |
Move file to specified group where num is 1-4 | Ctrl + ⇧ + [NUM] |
Tabs
Task / Command | Win |
---|---|
Toggle bookmark | Ctrl + F2 |
Next bookmark | F2 |
Previous bookmark | ⇧ + F2 |
Clear bookmarks | Ctrl + ⇧ + F2 |
Text Manipulation
Task / Command | Win |
---|---|
Transform to Uppercase | Ctrl + KU |
Transform to Lowercase | Ctrl + KL |
You can change the shortcuts as per your need.
Pressing CTRL+KS will open the keyboard shortcuts tab in VScode. Where you can manipulate those.
If you have any question, suggestion please comment below.