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.

Delete a line with content using the shortcut [ Ctrl + Shift + k ].
Delete content In a Line
  • Toggle A Line Comment [ Ctrl + / ]

You can comment and uncomment a line using this shortcut.

Toggle a line comment in vscode using the shortcut [ ctrl + /]
Toggle a line comment

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.

Shortcut to toggle block comment on or off in vscode.
Toggle A Block Comment
  • 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.

Shortcut to move contents of a line up or down in the editor.
Move Line Up Or Down

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 the Ctrl + 1,2,3-9 command you can vertically split the editor window in order to have different files to edit.
Create additional editor columns to code side by side.

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.

Categorized in:

Programming,

Last Update: April 24, 2024

Tagged in:

,