When writing code for your next big project, editing your code is an essential step to keeping your project working as expected. Using visual studio code(vscode) you have default shortcuts/ key bindings that help you to edit your code faster and to increase your productivity. You can change the default key bindings but they are adequate for their purpose. Below are a few examples of the keybindings I use a lot when editing my code. This post will dwell on vscode shortcuts for productivity for editing that I use often.
VS CODE SHORTCUTS FOR PRODUCTIVITY-EDITING
These are a few of my most used shortcuts/keybindings that I normally use when writing code for my projects. They are as follows:
- Delete A Line [ Ctrl + Shift + k]
This shortcut allows you to delete the contents of a line.
- Toggle A Line Comment [ Ctrl + / ]
You can comment and uncomment a line using this shortcut.
Toggle a Block Comment [ Shift + Alt + A ]
Using this shortcut you can comment off a block of code selected. You can uncomment using the same shortcut.
- Move Line Up/Down [ Alt + Up Arrow/Down Arrow ]
Move the contents of a line, up or down using this shortcut. This is useful when you want to move a line of code to a new method/function or to re-arrange the flow of your code.
Split Editor Space Vertically [ Ctrl + 1 or 2 or 3 ]
Need to edit different files in a project without searching and opening files each time? Then this shortcut is here to help. It vertically splits the editor window allowing you to open a file in the new editor window for editing.
Using these shortcuts/keybindings speeds up your development workflow and increases your productivity. You can find my other vscode keybindings post here. The rest of my posts can be found here and as usual, you can find the cheat sheet for vscode keybindings here.