VS Code Linux Shortcuts for 10x Productivity

It is possible to become more efficacious and proficient with any tool when you know how to use shortcuts. Consider this for a moment.

Do you think it is okay if someone repeatedly selects text by dragging through the mouse and selecting the cut option from the menu for once instead of pressing Ctrl+X? or by holding down the mouse button to copy the entire text instead of pressing Ctrl+A?

There is no exception to this rule when it comes to Linux shortcuts. Every user of the VS code should be familiar with some Linux keyboard shortcuts.

Almost every Linux user is familiar with the Bourne Again SHell (Bash) since it is the pre-configured shell in most distributions.

It may be difficult for beginners to grasp how to use the VS code, especially since you have to use your arrow keys to navigate. It can also be annoying to have to repeatedly type the same commands, each slightly different.

Despite this, Linux proffers a substantial array of keyboard shortcuts and history functions that makes it simple to work with the VS code productively. A list of the most frequently used VS code Linux keyboard shortcuts has been compiled to help you save time.

TL;DR: The complete blog can be viewed here in a shortened version.

Table Of Contents

  1. Fundamental shortcuts
  2. Editing basics
  3. Multi-cursor and selection
  4. Display
  5. Search and replace
  6. Navigation
  7. File management
  8. Debug
  9. Shortcuts for the Linux Terminal

1. The fundamental shortcuts

i.) Display command palette

We can look for alternative commands in the command palette by pressing this shortcut. The command palette is quite useful, for say, when an individual who is on the lookout for a typical command in VS code, but does not remember the command.

Ctrl + Shift + P

ii.) Create a new window/instance

We can open a completely new window by using this Linux shortcut, which opens a completely new window or instance of the application.

Ctrl + Shift + N

iii.) Exit the window or instance

By pressing [CTRL] + [SHIFT] + [W], you can close the current window in most software applications. Furthermore known as Ctrl + W, Ctrl + W is a shortcut for Linux used for closing programs, windows, tabs, and documents.

Ctrl + Shift + W

iv) Settings for users

The settings window opens when you press this Linux shortcut. We can view the current settings here or modify them if necessary.

Ctrl + ,

v.) Shortcuts for the keyboard

This VS code Linux shortcut opens a new tab in which all of the current shortcuts are listed.

Ctrl + S
The fundamental shortcuts
The fundamental shortcuts

2. Editing basics

i.) Cut the line (empty selection)

This Linux hotkey cut an object\line that has been highlighted, such as a text or image.

Ctrl + X

ii.) Copy the line (empty selection)

To copy a highlighted image, text, or other object, right-click the object and select copy or simply use this shortcut.

Ctrl + C

iii.) To move the line up/down

By using this command in VS code, a line can be moved downward or upward.

Alt + ↓ / Alt + ↑

iv.) Delete the line

The Ctrl+Shift+K keyboard combination is used to delete a line quickly in VSCode. Simply place the cursor on the line you wish to delete and hit the keys.

Ctrl + Shift + K

v.) Insert the line below/ above

Inserting lines above and below are executed by pressing Ctrl+Enter and Ctrl+Shift+Enter, respectively.

Ctrl + Enter

(or)

Ctrl + Shift + Enter

vi.) Advance to the matching bracket

As a result of implying this command line shortcut in Linux, jump to the bracket that matches.

Ctrl + Shift + \

vii.) Indent / Outdent line

When copying lines between files or modifying code, you may end up with inaccurately indented code. By applying this shortcut, you can efficiently indent or outdent lines. Move multiple lines together by selecting them all.

Ctrl + ]  /  Ctrl + [

viii.) Toggles between beginning and ending

In order toggle between the beginning of the line and  the ending of the line, press home or end.

Home / End

ix.) Navigate to the file's the beginning/end

By pressing Ctrl + Home or Ctrl + End, you can go to either the beginning or the end of a line.

Ctrl + Home / Ctrl + End

x.) Move up and down a line

If you press down the Ctrl + ↑ / Ctrl + ↓ shortcut, either it will be scrolled up or down by a line.

Ctrl + ↑ / Ctrl + ↓

xi.) Pan up/down on the page

By employing this Linux shortcut, the page can be scrolled up/down.

Alt + PgUp / PgDn

xii.) Fold or unfold the region

When you place your cursor inside a block of code, you can quickly fold it with Ctrl+Shift+[. You can also unfold the collapsed region by pressing Ctrl + Shift + ] simultaneously.

Ctrl + Shift + [ / Ctrl + Shift + ]

xii.) Fold and unfold all subregions

You can fold (collapse) all subregions by pressing Ctrl + K and then Ctrl + [ and Unfold (uncollapse) all subregions by pressing Ctrl + K Ctrl + ].

Ctrl + K & Ctrl+ [ / Ctrl + K & Ctrl+ ]

xiv.) Fold and unfold all regions

You can fold (collapse) all regions by pressing Ctrl + K and then Ctrl + 0 and Unfold (uncollapse) all regions by pressing Ctrl + K and then Ctrl + J.

Ctrl + K & Ctrl + 0 / Ctrl + K & Ctrl+J

xv.) Include line comment

Ctrl+K, Ctrl+C is a primary keyboard shortcut for adding line comment. Pressing these keys together will comment out just the selected code.

Ctrl + K & Ctrl + C

xvi.) Disable line comment

You can uncomment the code by pressing Ctrl + K + U. Furthermore, you can uncomment by pressing this shortcut.

Ctrl + K + U

xvii.) Switch line comment

The line comment characters should be added at the beginning of each selected line, or they should be removed if they already exist.

Ctrl + /

xviii.) Activate block comments

A keyboard shortcut called Ctrl + Shift + A allows you to toggle block comments.

Ctrl +Shift + A

xix.) Toggle word wrap

Word wrap can be toggled by pressing the right combination of keys in VS Code. To do so, just press Alt + Z if you are using Windows or Linux.

Alt + Z

3. Multi-cursor and selection

i.) The cursor will be inserted

Anywhere in the document you can insert an additional cursor by using this keyboard shortcut.

Alt + Click

ii.) To insert the cursor above or below

The shortcut instantly replicates the line based on the direction chosen with the arrows, so you don't have to copy and paste a line. It is important to highlight a block of text or code before moving it this way.

Shift + Alt + ↑ / Shift + Alt + ↓

iii.) Revert the last cursor move

Misspelled a command? You can discard the current command in the Linux terminal by pressing Ctrl+U instead of backspace. The current cursor position is erased along with everything up to the beginning of the line when you use this shortcut.

Ctrl + U

iv.) Place cursor at end of selected lines

Adding the cursor to the end of highlighted selections can also be a shortcut that helps you develop faster.

Shift + Alt + I

v.) Choose the current line

By pressing this shortcut, you will clear your screen in the VS code terminal. You can do this equivalent to the "clear" command.

Ctrl + L

vi.) Widen / Constrict the selection

This VS code Linux keyboard shortcut lets you move and expand the selection easier when you select a section of code. Left and right arrows can be used to move in whichever direction you choose.

Shift + Alt + → / Shift + Alt + ←

vii.) To select a column (box)

You can select each line of code or text by dragging your cursor across it. In addition, this shortcut terminal hotkeys allows you to select a group of lines partly. If you drag over multiple lines, they will all be selected.

Shift + Alt + drag the mouse
Multi-cursor and selection
Multi-cursor and selection

4. Display

i.) Enable fullscreen

You can enable Fullscreen mode by pressing the shortcut F11 and also you can disable it using the same shortcut.

F11

ii.) Change zoom levels

You can adjust the Zoom level in VS Code with this shortcut as you it is implied to increase and decrease the Zoom level.

Ctrl + + / -

iii.) Switch the display of the sidebar

When you're working on an open file, you often need more space. Whenever necessary, you can use this keyboard/Linux shortcut to display or conceal the sidebar.

Ctrl + B

5. Search and replace

i.) To find

This terminal Linux shortcut key Ctrl + F implies that the find and replace bar will be displayed for the current document when pressed.

Ctrl + F

ii.) To replace

The Linux shortcut key Ctrl + H is applied to replace.

Ctrl + H

iii.) To find the next/previous

Finding the next or finding the previous is performed by pressing this Linux shortcut F3 or Shift + F3.

F3 / Shift + F3

iv.) Invoke find match for all instances

In case you need to modify all the results from a search, selecting all results with this keyboard shortcut will allow you to accomplish that.

Alt + Enter

v.) Adding selection to a new find match

By using this Linux VS code shortcut, you can add a selection to the next find match.

Ctrl + D

vi.) Toggle the previous selection to the new find match

By using the Linux terminal hotkey/shortcut, it is possible in moving the last selection to the next find match.

Ctrl + K & Ctrl + D
Search and Replace
Search and Replace

i.) To display all symbols

By pressing Ctrl+T, all symbols will display across all files.

Ctrl + T

ii.) Navigate to line…

A specific line of code can be found by finding the code at that line. With this Linux VS code hotkey / shortcut, you don't have to search for the line manually.

Ctrl + G

iii.) To go to file

Through this shortcut, we can find, open, and search for specific files in the project you are currently working on. It is extremely convenient when working on complex tasks.

Ctrl + P

iv.) To go to symbol…

When you hold down the shortcut key Ctrl+Shift+O, you can navigate to symbols inside a file.

Ctrl + Shift + O

v.) Display the problems panel

You can display the Problems panel in VS code terminal by pressing this shortcut Ctrl + Shift + M.

Ctrl+Shift+M

vi.) To move to the next error or warning

In the Error List or Output window, pressing this Linux shortcut key F8 switches to the next error.

F8

vii.) Revert to the preceding error or warning

When using the Error List or Output window, this Linux keyboard shortcut F8 helps you go to the previous error.

Shift + F8

viii.) Displays the editor group history

With this keyboard shortcut, you can toggle between multiple tabs and choose which one to open when you have a lot of tabs open. The shortcut shows a list of tabs and lets you select one to open, and you can toggle between them easily.

Ctrl + Shift + Tab

ix.) Move backward

To go backward in VS code, use this Linux keyboard shortcut.

Ctrl + Alt + -

x.) Move forward

You can keep moving forward by using this Linux keyboard shortcut.

Ctrl + Shift + -

xi.) Switches tab moves focus

On the Linux keyboard shortcuts, this command line shortcut toggles the tab key to move the focus.

Ctrl + M

7. File management

i.) To create a new file

It's easy to create a new file by holding down the shortcut key Ctrl+N.

Ctrl + N

ii.) Open the file

You can open the file by pressing the shortcut key Ctrl + O.

Ctrl + O

iii.) To save

When you hold down the shortcut key Ctrl + S, all your files and settings are saved.

Ctrl + S

iv.) To save as

You can access the save as option when you hold down the command line Linux shortcut key Ctrl + Shift + S.

Ctrl+Shift+S

v.) To close

A shortcut for erasing the preceding word is Ctrl+W. When the cursor is over a word, the whole word will be erased from the cursor position to the start.

Ctrl + W

vi.) To close all windows

When you hold down the shortcut key Ctrl+K and then Ctrl+W, you can close all your files.

Ctrl + K & Ctrl + W

vii.) To reopen the closed editor

The shortcut key Ctrl+Shift+T can be used to reopen any closed editor at any time.

Ctrl + Shift + T

viii.) Keep editor in preview mode

You can keep the preview mode editor open by simply pressing this Linux terminal shortcut key Ctrl+K Enter.

Ctrl + K & Enter

ix.) To open next

By holding down the Linux terminal shortcut key Ctrl+Tab, you can navigate to the next tab.

Ctrl + Tab

x.) Returns to the previous

By holding down the Linux shortcut key Ctrl+Shift+Tab, you can navigate to the previous tab.

Ctrl + Shift + Tab

xi.) Copy the active file's path

It is possible to copy the path of the active file by holding down this terminal hotkey in Linux.

Ctrl + K & P

xii.) Shows active files in Explorer

By holding down the shortcut key Ctrl+Shift+Tab, the active file in Explorer will be revealed.

Ctrl + K & R

xiii.) Display the active file in a new window/instance

You can open the current file in a new window/instance by holding down this shortcut key.

Ctrl + K O
File management
File management

8. Debug

i.) Switches breakpoints

A breakpoint can be enabled once, disabled once, and deleted once by simply pressing the Linux command line shortcut key F9 .

F9

ii.) To begin or continue

Using this keyboard shortcut in Linux, you can start or continue a debugging session.

F5

iii.) Step into or out of

You can step into or out of the breakpoint using this Linux command line shortcut. Breakpoints are either executed or terminated by this command.

F11 / Shift+F11

iv.) To step over

You can Step over a breakpoint with this BASH shortcut. The next breakpoint will not be run, nor will it exit the debug session.

F10

v.) To stop

Stopping the debugging session can be accomplished with this windows/Linux terminal shortcut.

Shift+F5

vi.) Display hover

A hover window will appear for the part of the code where the cursor is currently located. Whenever the cursor hovers over some part of the window, some additional information appears by applying this windows/Linux terminal shortcut.

Ctrl+K Ctrl+I

Shortcuts for the Linux Terminal

Shortcuts

Action

Ctrl+Shift+P

display command palette

Ctrl+Shift+N

create a new window/instance

Ctrl+W

exit the window or instance

Ctrl+,

settings for users

Ctrl+K Ctrl+S

shortcuts for the keyboard

Ctrl+X

cut the line (empty selection)

Ctrl+C

copy the line (empty selection)

Alt+ ↓ / ↑ 

to move the line up/down

Ctrl+Shift+K 

delete the line

Ctrl+Enter /Ctrl+Shift+Enter

insert the line below/ above

Ctrl+Shift+\ 

advance to the matching bracket

Ctrl+] / Ctrl+[

indent/outdent line

Home / End

toggles between beginning and ending

Ctrl+ Home / End

navigate to the file's the beginning/end

Ctrl+ ↑ / ↓

move up and down a line

Alt+ PgUp / PgDn

pan up/down on the page

Ctrl+Shift+ [ / ] 

fold or unfold the region

Ctrl+K Ctrl+ [ / ]

fold and unfold all subregions

Ctrl+K Ctrl+0 /Ctrl+K Ctrl+J

fold and unfold all regions

Ctrl+K Ctrl+C

include a line comment

Ctrl+K Ctrl+U

disable line comment

Ctrl+/

switch line comment

Ctrl+Shift+A

activate block comments

Alt+Z 

toggle word wrap

Alt+Click 

the cursor will be inserted

Shift+Alt+ ↑ / ↓ 

position the cursor above or below

Ctrl+U

revert the last cursor move

Shift+Alt+I

place cursor at end of selected lines

Ctrl+L

choose the current line

Ctrl+Shift+L

select all occurrences of the current selection

Ctrl+F2

select the current word in all instances

Shift+Alt + →

widen the selection

Shift+Alt + ←

constrict the selection

Shift+Alt + drag the mouse 

to select a column (box)

F11 

enable fullscreen

Shift+Alt+0

switch between horizontal and vertical editor layout

Ctrl+ = / -

change zoom levels

Ctrl+B

switch the display of the sidebar

Ctrl+Shift+E 

show explorer/toggle focus

Ctrl+F 

to find

Ctrl+H 

to replace

F3 / Shift+F3

navigate next/previous

Alt+Enter

invoke find match for all instances

Ctrl+D  

adding selection to a new find match

Ctrl+K Ctrl+D

toggle previous selection to new find match

Ctrl+T 

to view all symbols

Ctrl+G 

navigate to line...

Ctrl+P 

to take you to the file...

Ctrl+Shift+O

to go to symbol...

Ctrl+Shift+M  

will display the problems panel

F8  

to move to the next error or warning

Shift+F8

revert to the preceding error or warning

Ctrl+Shift+Tab

displays the editor group history

Ctrl+Alt+-   

to return

Ctrl+Shift+-

will take you forward

Ctrl+M

switches tab changes focus

Ctrl+N  

to create a new file

Ctrl+O  

will open the file...

Ctrl+S 

to save

Ctrl+Shift+S

to save as...

Ctrl+W      

to close

Ctrl+K Ctrl+W

to close all windows

Ctrl+Shift+T

reopens the editor after it has been closed

Ctrl+K Enter

keep editor in preview mode

Ctrl+Tab

to open next 

Ctrl+Shift+Tab     

returns to the previous 

Ctrl+K P

copy active file's path

Ctrl+K R

shows active files in explorer

Ctrl+K O 

display the active file in a new window/instance

F9  

switches breakpoints

F5  

to begin or continue

F11 / Shift+F11

step into or out of

F10

  to step over

Shift+F5

to stop

Ctrl+K Ctrl+I

display hover

Last Shot

It's easier to develop projects in VS Code with keyboard shortcuts, allowing you to build quality projects faster.

By implying shortcuts, we can be more streamlined and proficient when using any tool. Terminals are no exception. The Linux terminal has several shortcuts that should be familiarized with and known by all users.

The Bash shell keyboard shortcuts enhance work efficiency within an ever-changing organization by helping you make better use of your time.

Linux is a very adaptable operating system, and we can often acquire similar results using a variety of approaches. Many Linux users attribute a great deal of importance to the command line and terminal.

In addition to improving skills, shortcuts can save time as well. Keyboard shortcuts give quick access to specific commands and tasks using combinations of keys. Shortcut keys are used by almost everyone for convenience.

With these shortcut keys, we will be able to run and access previously run commands, change the text on the terminal, access the editor, control processes, move the cursor, and so on.


Monitor Your Entire Application with Atatus

Atatus is a Full Stack Observability Platform that lets you review problems as if they happened in your application. Instead of guessing why errors happen or asking users for screenshots and log dumps, Atatus lets you replay the session to quickly understand what went wrong.

We offer Application Performance Monitoring, Real User Monitoring, Server Monitoring, Logs Monitoring, Synthetic Monitoring, Uptime Monitoring and API Analytics. It works perfectly with any application, regardless of framework, and has plugins.

Atatus can be beneficial to your business, which provides a comprehensive view of your application, including how it works, where performance bottlenecks exist, which users are most impacted, and which errors break your code for your frontend, backend, and infrastructure.

If you are not yet a Atatus customer, you can sign up for a 14-day free trial .

Atatus

#1 Solution for Logs, Traces & Metrics

tick-logo APM

tick-logo Kubernetes

tick-logo Logs

tick-logo Synthetics

tick-logo RUM

tick-logo Serverless

tick-logo Security

tick-logo More

Aarthi

Aarthi

Content Writer at Atatus.
Chennai