Visual Studio Code Keyboard Shortcuts for Programming Like a Pro

If we want to learn to program, the first thing we need is a good programming IDE. Depending on the type of program that we are looking to create, it is necessary to choose the environment that best suits our needs and the language that we are going to use. In addition to the many specialized IDEs that we can find, there are also universal tools that, each time, have more followers given their possibilities. And one of the best is Visual Studio Code .

What is Visual Studio Code

The “Visual Studio” brand has always been considered an environment created by Microsoft to program all kinds of programs for its own ecosystem (Windows, Server, Azure, etc). This platform has always been proprietary and, moreover, paid (and not exactly cheap). However, in 2015, Microsoft surprised users by creating a new tool under this brand completely free and open source: Visual Studio Code.

Visual Studio Code Keyboard Shortcuts for Programming Like a Pro

VSC is a cross-platform and multilanguage programming IDE created by Microsoft for all users who need a simple and accessible code editor. This editor is completely free for all users, open source (programmed in Electron and Node.js) and is available for Windows, macOS and Linux.

Among its main features we can highlight that it is a fully customizable editor . As standard we have a very basic functionality, with few more functions than a normal text editor. However, we can extend these functions by downloading and installing extensions . These extensions can be found within the program itself and allow us to specialize it in certain languages or add other functions not available as standard. In addition, users can change the theme and colors to suit their tastes or hobbies. We are facing one of the most versatile code editors that we can find.

Visual Studio Code - Extensiones 5

In addition to all of the above, this program is designed to work with Git (and GitHub, with one of the extensions we just talked about), includes advanced debugging systems, syntax highlighting, a code auto-completion function, functions to refactor your code, etc.

If we don’t have it installed yet, we can download the latest version of the program from the following link . In addition to the stable version, we can also download any of the development versions of the program to have early access to the latest features.

Learning the VSC keyboard shortcuts

All the functions of the program are at our fingertips with the mouse, within its menus. However, depending on what we are doing, taking our hands off the keyboard and going to the mouse, searching and clicking to perform a certain task can be unproductive.

Microsoft has adapted its code editor for ease of use thanks to keyboard shortcuts. A keyboard shortcut is a pre-configured key combination to perform a certain action. These shortcuts can be a single key (for example, the F keys) or a combination of keys, both of which typically use Control or Alt as launchers.

We can find a large number of shortcuts within Visual Studio Code. Some of them allow us to use the basic functions of the program more easily, such as:

  • Ctrl + K + S -> open the list of keyboard shortcuts.
  • Ctrl + Shift + P -> open the command palette.
  • Ctrl +, -> open settings.
  • Ctrl + Shift + X -> change the extensions panel.
  • Ctrl + T -> open the universal quick search panel.
  • Ctrl + N -> open new file.
  • Ctrl + Shift + N -> open new window.
  • Ctrl + F4 -> close file.
  • Ctrl + Shift + W -> close window.
  • F11 -> put in full screen.
  • Ctrl + B -> show or hide the sidebar.

We can also take advantage of these keyboard shortcuts to control the use of code files. For example:

  • Ctrl + O -> open file.
  • Ctrl + S -> save file.
  • Ctrl + Shift + S -> save file as
  • Ctrl + Shift + T -> open last closed tab.

Visual Studio Code also provides us with a large number of keyboard shortcuts that help us move through the entire code editor to be able to edit it more comfortably. The most important are:

  • Ctrl + C -> copy selection or the line that we have activated at that time.
  • Ctrl + X -> cut selection or the line that we have activated at that moment.
  • Ctrl + V -> paste the contents of the clipboard.
  • Ctrl + Shift + K -> delete line.
  • Home -> go to the beginning of the line.
  • End -> go to the end of the line.
  • Ctrl + Home -> go to the beginning of the file.
  • Ctrl + End -> go to the end of the file.
  • Alt + up / down -> move up or down one line.
  • Ctrl + / -> comment out a line.
  • Shift + Alt + A -> comment out a region.
  • Ctrl +] -> add indentation.
  • Ctrl + [-> remove indent.
  • Ctrl + P -> go to a file.
  • Ctrl + G -> go to a line.
  • Ctrl + T -> show all symbols.
  • Ctrl + Shift + O -> go to a symbol.
  • F8 -> go to the next compiler warning.
  • Shift + F8 -> go to the previous compiler warning.
  • Ctrl + Shift + M -> show the problem panel.
  • Ctrl + -> split the editor.
  • Ctrl + 1/2/3 -> open one of the editors.
  • Ctrl + Shift + Avpag -> move editor down.
  • Ctrl + Shift + Repag -> move editor up.

And, of course, VSC will show us a series of keyboard shortcuts that will help us to edit the code more easily. Among others, we can highlight:

  • Ctrl + F -> open search panel.
  • Ctrl + H -> open the replace panel.
  • Ctrl + Shift + H -> replace in files.
  • F3 -> find next.
  • Shift + F3 -> search previous.
  • Alt + Enter -> select all matches of the same term.
  • Ctrl + D -> add current selection to search.
  • Ctrl + L -> select current line.
  • Ctrl + Shift + L -> select all lines in the current section.
  • Ctrl + F2 -> select all matches of a current word.
  • Shift + Alt + Right Arrow -> expand selection.
  • Shift + Alt + Left Arrow -> pick selection.
  • Alt + Click -> add cursor.
  • Ctrl + Alt + up / down -> add cursor above or below.
  • Ctrl + U -> undo the last cursor.

Finally, the keyboard shortcut “Ctrl +` “allows us to show the terminal integrated into the program, very useful in debugging tasks.

Some of the keyboard shortcuts that we have just seen may change depending on the operating system that we use. In our case we have put the keyboard shortcuts for Windows, but if we use macOS or Linux, although many will coincide, others (like Ctrl + F4, for example) will be assigned to other keys.