These shortcuts will change how you write code forever

As a Programmer
18 May 202406:07

Summary

TLDRThis video script urges viewers to master VS Code shortcuts to enhance productivity, emphasizing the importance of learning keyboard shortcuts over relying on the mouse. It provides a list of essential shortcuts for tasks like opening the terminal, renaming variables, selecting lines, and navigating files. The script also includes browser shortcuts for developers, such as opening dev tools and managing tabs. The call to action is to try these shortcuts for two weeks and observe the improvement in efficiency.

Takeaways

  • 😀 Learning VS Code shortcuts can significantly enhance productivity for programmers.
  • 🔍 Pressing Ctrl+J opens or toggles the terminal in VS Code, a fundamental shortcut for project management.
  • 🗑️ Ctrl+L clears the terminal screen, helping to declutter the workspace.
  • 🔄 Ctrl+D is used to select and rename variables across all occurrences, a powerful feature for code refactoring.
  • 🔑 Ctrl+Shift+L selects all occurrences of the current word, streamlining the editing process.
  • ⏏️ End and Home keys, or their Fn key combinations, are essential for navigating to the beginning or end of a line.
  • 🔄 Alt+Up/Down keys allow for moving lines up and down, simplifying code organization.
  • 📄 Ctrl+Backspace and Ctrl+Delete delete words instead of single characters, improving text editing efficiency.
  • 🗂️ Ctrl+Shift+K deletes the current line, a quick way to remove unwanted code.
  • 🔑 Ctrl+Alt+Up/Down and Alt+Click are methods for inserting cursors at different positions, useful for multi-cursor editing.
  • 🔍 Ctrl+P is a shortcut for searching and opening files quickly, saving time in large projects.
  • 🔄 Ctrl+Shift+F searches within a large file, aiding in navigation and finding specific code snippets.
  • 💾 Ctrl+S and Ctrl+K+S are for saving individual and all files, respectively, ensuring work is preserved.
  • 🚫 Ctrl+W and Ctrl+K+W close individual and all files, respectively, keeping the workspace tidy.
  • ↩️ Ctrl+Shift+T reopens the last closed file, a handy shortcut for recovering work.
  • 🛠️ The Command Palette (Ctrl+Shift+P) is a powerful tool for executing almost any command in VS Code.
  • 📚 Ctrl+B toggles the sidebar, providing quick access to different panels and views.
  • 📈 Ctrl+Shift+V previews Markdown files, enhancing the workflow for documentation and README files.
  • 🛠️ Browser shortcuts like Ctrl+Shift+J for DevTools and Ctrl+T for new tabs are crucial for web development and debugging.

Q & A

  • Why is it important for programmers to learn VS Code shortcuts?

    -Learning VS Code shortcuts can significantly increase productivity by reducing the time spent on repetitive tasks, allowing programmers to focus more on coding rather than navigating the interface.

  • What is the shortcut to open a new terminal in VS Code?

    -The shortcut to open a new terminal in VS Code is Ctrl+J, which allows for quick access to the terminal without using the mouse.

  • How can you clean up a messy terminal in VS Code?

    -You can clean up a messy terminal in VS Code by pressing Ctrl+L, which clears the terminal screen.

  • What is the shortcut to rename a variable and update all its occurrences in VS Code?

    -To rename a variable and update all its occurrences in VS Code, first select the variable, then press F2 to rename it. To update all occurrences, press Ctrl+D until all instances are selected.

  • How can you select all occurrences of a variable at once in VS Code?

    -To select all occurrences of a variable at once in VS Code, press Ctrl+Shift+L after selecting the first instance of the variable.

  • What is a faster way to select a line in VS Code instead of using the mouse?

    -Instead of using the mouse, you can select a line in VS Code by pressing Ctrl+L, which highlights the current line of code.

  • How can you move a line of code up or down in VS Code?

    -To move a line of code up in VS Code, select the line and press Alt+Up Arrow. To move it down, press Alt+Down Arrow.

  • What is the shortcut to delete a word at a time instead of a letter in VS Code?

    -To delete a word at a time in VS Code, press Ctrl+Backspace. To delete from the right, press Ctrl+Delete.

  • How can you quickly save a file or all files in VS Code?

    -To save a file in VS Code, press Ctrl+S. To save all open files at once, press Ctrl+K followed by S.

  • What is the shortcut to close a file or all files in VS Code?

    -To close a file in VS Code, press Ctrl+W. To close all open files, press Ctrl+K followed by W.

  • How can you reopen the last closed file in VS Code?

    -To reopen the last closed file in VS Code, press Ctrl+Shift+T, which functions like a stack with the last closed file being the first to reopen.

  • What is the shortcut to open the command palette in VS Code?

    -The shortcut to open the command palette in VS Code is Ctrl+P, which allows you to execute commands and actions within the editor.

  • How can you toggle the sidebar in VS Code?

    -To toggle the sidebar in VS Code, press Ctrl+B, which hides or shows the sidebar containing the file explorer and other panels.

  • What is the shortcut to preview a markdown file in VS Code?

    -To preview a markdown file in VS Code, press Ctrl+Shift+V, which opens the preview in a new tab. For side-by-side preview, press Ctrl+K followed by V.

Outlines

00:00

💻 Essential VS Code Shortcuts for Programmers

This paragraph introduces the importance of learning VS Code shortcuts to enhance productivity in coding. It provides a step-by-step guide to various shortcuts, starting from opening a terminal with 'Ctrl + J', to renaming variables using 'Ctrl + D', and selecting all occurrences with 'Ctrl + Shift + L'. The speaker emphasizes the transformational impact of these shortcuts on a programmer's workflow, encouraging the audience to adopt them for a more efficient coding experience. It also covers navigation shortcuts, line manipulation techniques, and file management commands, concluding with the powerful 'Ctrl + Shift + P' for accessing the command palette.

05:00

🔍 Browser Shortcuts for Enhanced Web Navigation

The second paragraph focuses on browser shortcuts that are crucial for programmers during web development and debugging. It starts with opening the developer tools using 'Ctrl + Shift + J' and includes shortcuts for managing tabs, such as opening a new tab with 'Ctrl + T' and closing the current tab with 'Ctrl + W'. The summary also covers navigation shortcuts like 'Alt + Left/Right' for browsing history, and 'Ctrl + L' for URL selection. Additionally, it mentions shortcuts for bookmarking, accessing history, and viewing downloads. The paragraph concludes with tips on page reloading, including cache management, and toggling the bookmark bar, all aimed at streamlining a programmer's web interaction.

Mindmap

Keywords

💡coding

Coding is the process of writing computer programs, which involves using a specific programming language to give instructions to a computer. In the video's context, coding is the primary activity of the target audience, junior programmers, who are passionate about it and plan to spend their careers in this field. The script emphasizes the importance of learning shortcuts to improve coding efficiency.

💡VS Code shortcuts

VS Code shortcuts refer to the keyboard combinations used in Visual Studio Code, a popular source-code editor, to perform various tasks more efficiently. The video's theme revolves around teaching these shortcuts to enhance productivity. Examples from the script include 'control J' to open a terminal and 'control D' for multi-cursor selection.

💡productivity

Productivity in this context refers to the efficiency and effectiveness with which programmers can perform their coding tasks. The video suggests that learning VS Code shortcuts can significantly boost a programmer's productivity by reducing reliance on the mouse and streamlining common coding operations.

💡terminal

A terminal is a command-line interface for accessing a computer's operating system. In the script, it is mentioned as an essential tool for starting coding projects, and the shortcut 'control J' is highlighted for quickly opening a new terminal within VS Code.

💡multi-cursor

Multi-cursor is a feature in VS Code that allows multiple cursors to be placed in the document simultaneously, enabling the simultaneous editing of multiple lines or sections of code. The script demonstrates 'control D' as a way to select and edit all occurrences of a variable, showcasing the power of multi-cursor.

💡variable renaming

Variable renaming is the process of changing the name of a variable in a program. The script mentions using 'control D' to select all occurrences of a variable for renaming, illustrating a common task made easier with keyboard shortcuts in VS Code.

💡command palette

The command palette in VS Code is a tool that provides access to a wide range of commands and features. The script mentions 'control P' and 'control shift P' as shortcuts to open the command palette and execute commands, such as folding all functions in a file.

💡file navigation

File navigation refers to the process of moving between files in a project. The script provides shortcuts like 'control P' for quick file search and 'control F' for searching within a large file, emphasizing the ease and speed of navigation in VS Code.

💡markdown

Markdown is a lightweight markup language used for creating formatted text. The video mentions 'control shift V' as a shortcut to preview markdown files directly in VS Code, which is especially useful for programmers working with documentation or README files.

💡browser shortcuts

Browser shortcuts are keyboard combinations used to perform tasks in web browsers more efficiently. The script extends the theme of efficiency to web browsing by sharing shortcuts like 'control shift J' to open developer tools and 'control T' to open a new tab, showing the broader application of keyboard shortcuts beyond coding.

💡developer tools

Developer tools are a set of utilities built into web browsers to help developers debug and analyze web pages. The script specifically mentions the shortcut 'control shift J' to open these tools, which is a crucial part of a programmer's workflow when working on web development.

Highlights

Encouragement to learn VS Code shortcuts for increased productivity in coding

Opening a terminal in VS Code with Ctrl+J for quick project start

Cleaning up the terminal with Ctrl+L

Renaming variables efficiently with Ctrl+D for multiple occurrences

Using Ctrl+Shift+L to select all occurrences of a variable at once

Selecting the current line with Ctrl+L for faster editing

Navigating to the end/start of a line with End/Home keys or Fn+Right/Left

Moving lines up and down with Alt+Up/Down Arrow keys

Duplicating lines with Alt+Shift+Up/Down Arrow keys

Deleting words efficiently with Ctrl+Backspace or Ctrl+Delete

Deleting an entire line with Ctrl+Shift+K

Inserting cursors above or below the current line with Ctrl+Alt+Up/Down Arrow keys

Quick file search in VS Code with Ctrl+P

Navigating within a file using Ctrl+F

Saving files with Ctrl+S and all files with Ctrl+K, S

Closing files with Ctrl+W and all files with Ctrl+K, W

Reopening the last closed file with Ctrl+Shift+T

Accessing the command palette and executing commands with Ctrl+Shift+P

Folding and unfolding code blocks in VS Code

Reloading the VS Code window for fixing autocomplete issues

Toggling the sidebar with Ctrl+B and opening various sidebar tabs with specific shortcuts

Previewing markdown files in VS Code with Ctrl+Shift+V

Sharing browser shortcuts for developers, including opening dev tools with Ctrl+Shift+J

Navigating tabs in the browser with Ctrl+Tab and Ctrl+Shift+Tab

Using browser shortcuts for history, downloads, and bookmarking pages

Reloading pages and clearing cache with browser shortcuts

Toggling the bookmark bar in the browser with Ctrl+B

Challenge to use these shortcuts for two weeks to improve efficiency

Transcripts

play00:00

Juniors be like dude I love coding and

play00:03

I'll be spending my next 25 years as a

play00:05

programmer but I'll not spend 15 minutes

play00:08

to learn vs code shortcuts that will

play00:09

make me productive hey don't be that guy

play00:12

listen to me for the next 5 minutes and

play00:14

you will let go with your mouse and feel

play00:16

like a tenic engineer for the rest of

play00:18

your life at first you might think I am

play00:21

happy with my mouse and don't need any

play00:23

shortcuts but once you learn these your

play00:25

life will change forever well that

play00:27

sounds too serious but that's really the

play00:29

case and I want to prove that to you so

play00:31

let's open up a vs code and go through

play00:33

the list one by one the very first thing

play00:36

you would need is to open up a terminal

play00:38

to start your project and instead of

play00:40

going all the way up clicking to the

play00:42

terminal and new terminal simply just

play00:44

press contrl J and you can toggle it as

play00:47

well then let's say your terminal got a

play00:49

bit messy you can clean it with crl L

play00:52

when you decide to rename a variable

play00:54

you'll want to update all occurrences

play00:56

you can either update all of them one by

play00:58

one which is kind of boring or you can

play01:00

select the first one and press contrl D

play01:03

until all selected and with this now you

play01:05

have a multic cursor and it feels like

play01:08

magic and there is even a grandfather of

play01:10

contrl D which is contrl shift L which

play01:13

selects all occurrences at once

play01:16

selecting a line with mouse feels

play01:18

terrible and slow instead you can press

play01:20

contrl L to select the current line and

play01:23

here is a bonus tip once you select a

play01:25

line you can press shift down to keep

play01:28

selecting downwards or shift up to keep

play01:30

selecting upwards you can go to the end

play01:33

of the line by pressing End Key and you

play01:35

can go to the start of the line with

play01:37

home key but if you don't have the end

play01:39

or home keys on your keyboard you can

play01:42

press FN right and FN left and as you

play01:45

can imagine FN up and FN down will take

play01:48

you to the start of the file and the end

play01:50

of the file and sometimes you'll need to

play01:52

move a line upwards or downwards press

play01:55

alt and up key to move upwards and ALT

play01:58

and down to downwards but wait how do

play02:01

you duplicate the current line down um I

play02:03

guess with alt shift and down and to

play02:06

duplicate upwards alt shift and up and

play02:09

when it comes to deleting with only

play02:11

backspace you can delete a letter at a

play02:14

time but if you press control in

play02:16

backspace you will delete word by word

play02:18

and if you want to delete from the right

play02:20

then you can use the delete key but

play02:23

again it'll delete a letter at a time so

play02:25

you can press control and delete to

play02:28

delete word by word and when you want to

play02:30

delete a line completely you can select

play02:32

it with contrl L and press backspace or

play02:35

simply just press control shift and K

play02:38

and it'll delete the current line you

play02:40

can insert the cursor below the next

play02:42

line by pressing control alt and down

play02:46

and you can insert the cursor to the

play02:47

previous line by pressing contrl alt and

play02:51

up and as an alternative you can use alt

play02:54

and click and insert as much cursor as

play02:57

you want in a large project it can take

play02:59

a long time to find a file from the

play03:01

sitebar so instead you can press contrl

play03:04

p and search for a file and in a large

play03:07

file it can be hard to navigate so you

play03:09

can press crlf and search for anything

play03:12

when you want to save a file you can use

play03:14

crl S and if you want to save all files

play03:17

at once then you press contrl K and S

play03:21

and you might want to close a file so go

play03:23

ahead with contrl and W or you can press

play03:26

crl K and W to close all of the them at

play03:30

once but how do you reopen the last

play03:32

closed file um I guess by pressing

play03:35

control shift and T which works like a

play03:38

stack the last in first out we learned

play03:41

that if we press contrl P we will see

play03:43

the command pallet and if we press

play03:45

control shift p it'll put a right angle

play03:48

bracket into it which allows us to do

play03:50

almost anything that we can imagine

play03:52

let's say in this file you want to fold

play03:54

all the functions you can simply type it

play03:57

and execute it and you can unfold them

play04:00

as well another really useful command is

play04:02

to reload the window sometimes vs code

play04:05

doesn't give you Auto completes for some

play04:07

reason and to fix it you would reload

play04:09

the window from the command pallet and

play04:11

then the auto completes should work now

play04:14

and when it comes to the sidebar

play04:15

shortcuts you can toggle it with contrl

play04:18

b and you can open up the extensions tab

play04:21

with contrl shift and x file explorer

play04:23

tab with control shift and E and Source

play04:26

control tab with control shift and G and

play04:30

when you are working with markdown files

play04:32

you can preview them directly in vs code

play04:35

by pressing control shift and V and if

play04:38

you want to preview them on the side

play04:40

then you can press crl K and V which

play04:43

wraps up the VS code shortcuts and if

play04:46

you have made it up until here then

play04:48

congratulations and now to even make you

play04:50

faster I'll share some browser shortcuts

play04:53

as a programmer the very first thing you

play04:55

would do is to open up the dev tools

play04:57

which can be done by control shift and J

play05:00

to open up a new tab use contrl T and to

play05:03

close the current tab use contrl W just

play05:06

like vs code you can reopen the last

play05:09

Clos tab with control shift and T with

play05:12

contrl tab you can go to the next Tab

play05:14

and with control shift tab you can go to

play05:16

the previous one alt left will help you

play05:19

go back in time and ALT right will help

play05:21

you go forward in time use crln for a

play05:25

fresh window and contrl shift n for an

play05:28

incognito window control L will select

play05:30

the URL contrl D will bookmark the

play05:33

current page contrl H will take you to

play05:36

the history and contrl J will show you

play05:38

the downloads if you want to reload the

play05:41

page you can do contrl R but if you want

play05:43

to reload without using the cache then

play05:45

you can use control shift R and the very

play05:48

last shortcut is to toggle The Bookmark

play05:50

tab with contrl B so that's going to be

play05:53

the ultimate shortcuts that you need as

play05:55

a programmer give it a try for the next

play05:57

two weeks and let me know if you feel

play05:59

any better I'm sure you do and if you

play06:01

want to see more content like this give

play06:03

me a sub and thumbs up thanks for

play06:05

watching and I'll see you in the next

play06:06

one

Rate This

5.0 / 5 (0 votes)

Etiquetas Relacionadas
VS CodeProductivityShortcutsCoding TipsDeveloper ToolsKeyboard TricksEfficiency HacksBrowser TipsProgrammer GuideWorkflow Optimization
¿Necesitas un resumen en inglés?