25 VS Code Productivity Tips and Speed Hacks

Fireship
14 Jun 202111:35

Summary

TLDRThe video script offers an in-depth guide to mastering Visual Studio Code (VS Code), highlighting its powerful features beyond a simple text editor. It emphasizes the importance of keyboard shortcuts and commands over mouse usage for increased productivity. The tutorial covers various techniques, including using the command palette for file navigation, symbol search, and code execution, as well as extensions for rapid prototyping and version control. It also introduces advanced features like multi-cursor editing, code commenting, and terminal management, concluding with tips on customizing VS Code for personal productivity and project efficiency.

Takeaways

  • 🔥 **VS Code's True Potential**: VS Code is more than a basic text editor; it's a powerful tool with numerous features that can boost productivity when used correctly by professionals.
  • 🎯 **Efficiency with Keyboard Shortcuts**: Relying less on the mouse and learning keyboard shortcuts can significantly improve efficiency in VS Code.
  • 📂 **Quick File Navigation**: Use the VS Code CLI with the 'code' command to quickly open directories or files from the terminal.
  • 🛠 **Command Palette Power**: The Command Palette (Ctrl+P) offers a keyboard-centric way to access all VS Code features and commands without memorizing key bindings.
  • 🔎 **Symbol Navigation**: Quickly find and navigate to symbols in your code using the '@' symbol from the Command Palette or Ctrl+Shift+Period in the file.
  • ⚙️ **Enhanced Editing**: Use Ctrl+G to jump to specific lines, Ctrl+D for multi-line editing, and Alt+Up/Down Arrows for moving lines.
  • 📝 **Auto Rename Tag**: Install the Auto Rename Tag extension to automatically update paired tags like HTML or XML when editing one part.
  • 📋 **Commenting Shortcuts**: Use Ctrl+L to highlight lines and Ctrl+/ to toggle comments, making it easier to manage code comments.
  • 📱 **Terminal Productivity**: Open terminal sessions within VS Code and use Ctrl+Backtick to access the current working directory. Customize terminal sessions with different names and colors.
  • 🔄 **Version Control Simplicity**: VS Code's Source Control tab simplifies Git operations, and extensions like GitLens provide additional visualization and accountability for code changes.
  • 🔗 **Remote Development**: Extensions like Remote Repositories, Remote SSH, and Remote Containers allow for streamlined development environments without complex Git commands.
  • 📚 **Code Snippets and Extensions**: Utilize custom snippets and extensions to reduce boilerplate code and enhance productivity, with tools like 'as code' for JSON to TypeScript type inference.

Q & A

  • What is the main message conveyed in the video about Visual Studio Code (VS Code)?

    -The video emphasizes that VS Code is more than a simple text editor; it is a powerful tool with numerous productivity-boosting features that can significantly enhance coding efficiency. It contrasts amateur techniques with professional ones, highlighting how professionals leverage these features to write and analyze code faster.

  • How can one quickly open a directory or edit a file in VS Code from the command line?

    -You can quickly open a directory or edit a file in VS Code from the command line by using the 'code' command. However, for Mac or Linux users, the binary must be added to the path first.

  • What is the significance of the 'Control P' keyboard shortcut in VS Code?

    -The 'Control P' keyboard shortcut brings up the Command Palette in VS Code, which provides access to all the editor's features and commands from the keyboard without needing to memorize multiple key bindings.

  • How does the video suggest improving productivity when working with large files in VS Code?

    -The video suggests using the '@' symbol from the Command Palette to list every symbol in the code, allowing for quick navigation to any function or interface needed within the file.

  • What is the benefit of using 'Control Shift Period' in VS Code?

    -Using 'Control Shift Period' allows you to find a symbol throughout the entire project, including all dependencies like 'node_modules', which can be very useful for locating specific interfaces or functions across your codebase.

  • How can one edit multiple instances of the same characters across a file in VS Code?

    -After highlighting the characters with 'Control D', you can repeatedly press 'Ctrl D' to edit all instances of the highlighted characters simultaneously, effectively allowing you to edit three lines of code at the same time.

  • What is the purpose of the 'Auto Rename Tag' extension in VS Code?

    -The 'Auto Rename Tag' extension automatically renames the closing tag when you edit the opening tag, making it easier and faster to work with HTML or other languages that use tag-based syntax.

  • How can the 'Better Comments' extension enhance code commenting in VS Code?

    -The 'Better Comments' extension provides automatic highlighting in comment text, making it easier to differentiate between comments based on their content, such as highlighting TODOs in orange and lines starting with a '!' in red.

  • What is the advantage of using the 'Remote Repositories' extension in VS Code?

    -The 'Remote Repositories' extension allows you to work with a Git repository on GitHub directly from VS Code without needing to clone it locally. You can create branches, edit code, and submit pull requests, all within the editor, simplifying the development process.

  • How can custom snippets be created and utilized in VS Code to improve productivity?

    -Custom snippets can be created through the 'Configure User Snippets' command in the Command Palette. These snippets can be global or scoped to a specific workspace, allowing you to quickly insert frequently used code patterns into your projects.

  • What does the 'JSON as Code' extension do in VS Code?

    -The 'JSON as Code' extension infers TypeScript types from a JSON object, using a tool called 'Quick Type'. This can save significant time when working with JSON data by automatically generating types for the JSON schema.

  • How can one efficiently rename symbols or variables across a project in VS Code?

    -To rename symbols or variables, first find the instance you want to rename, then use the 'Find All References' feature to locate all occurrences. After that, use the 'Rename Symbol' option to change the name safely across all files.

Outlines

00:00

🚀 Maximizing VS Code Productivity

This paragraph discusses the true potential of Visual Studio Code (VS Code) beyond its appearance as a simple text editor. It highlights the importance of using keyboard shortcuts and commands to boost productivity, rather than relying on the mouse. The video introduces various techniques used by professionals to efficiently write and analyze code, emphasizing the value of time. It also covers the use of the Command Palette and extensions like Quoca for executing code directly in the editor and navigating through large files with ease.

05:01

🎯 Enhancing Code Editing with Shortcuts

The focus of this paragraph is on specific keyboard shortcuts and features within VS Code that can significantly improve code editing speed. It explains how to use the Command Palette for quick file access and symbol navigation, the efficiency of using keyboard shortcuts over the mouse, and the power of multi-cursor editing. Additionally, it touches on the Auto Rename Tag extension for easier HTML tag management and the use of VS Code tasks to simplify repetitive terminal commands.

10:02

📁 Navigating Code and Terminal Efficiency

This paragraph delves into the intricacies of code navigation and terminal usage within VS Code. It covers the use of the 'Find' feature for efficient code searching, the benefits of the Better Comment extension for enhancing comment readability, and the use of Git commands and extensions like GitLens for better source control management. The paragraph also introduces the Remote Repositories extension for streamlined GitHub interaction and the convenience of extensions like Remote SSH and Remote Containers for development environments.

Mindmap

Keywords

💡Visual Studio Code (VS Code)

VS Code is a popular, open-source code editor developed by Microsoft. It is highly customizable and supports a wide range of programming languages, making it a versatile tool for developers. In the video, VS Code is compared to a knife, highlighting that its effectiveness depends on the skill of the user. The video aims to transition viewers from basic usage to more advanced techniques to boost productivity.

💡Productivity Boosting Features

These refer to the various tools and shortcuts within VS Code that can significantly improve a developer's efficiency and speed when writing and analyzing code. The video aims to introduce viewers to these features, which they might not be using yet, to help them work more effectively.

💡Keyboard Shortcuts

Keyboard shortcuts are quick key combinations that allow users to perform common actions without using a mouse, thus increasing speed and efficiency. In the context of the video, learning and using keyboard shortcuts in VS Code is emphasized as a key to becoming a more proficient user.

💡Command Palette

The Command Palette in VS Code is a powerful tool that provides access to all the editor's commands through the keyboard. It allows users to execute commands, search for files, and access extension-specific features without needing to memorize key bindings.

💡Extensions

Extensions in VS Code are add-ons that enhance the editor's functionality by providing new features, languages, or themes. The video emphasizes the importance of extensions in customizing VS Code to suit specific development needs.

💡Multi-Cursor Editing

Multi-cursor editing is a feature in VS Code that allows users to have multiple cursors or points of editing in the same or different files simultaneously. This大幅提升编码效率,特别是在需要在多个地方进行相同更改时.

💡Terminal

The Terminal in VS Code is an integrated command-line interface that allows developers to run shell commands directly within the editor. It is a crucial tool for executing scripts, managing packages, and performing version control tasks.

💡Version Control

Version control is a system that tracks changes to code over time, allowing developers to collaborate, revert changes, and manage different versions of their projects. Git is a widely used version control system, and the video discusses how VS Code's interface simplifies Git operations.

💡Git Lens

Git Lens is an extension for VS Code that enhances the built-in Git capabilities by providing a detailed visualization of code history, authorship, and changes. It helps developers understand the evolution of their codebase and who made specific changes.

💡Remote Development

Remote development refers to the ability to work on code repositories hosted on platforms like GitHub directly from within VS Code, without the need to clone the repository to a local system. This streamlines the development process and allows for real-time collaboration.

💡Snippets

Snippets are small, reusable pieces of code that can be quickly inserted into a file to save time and reduce redundancy. In VS Code, users can create custom snippets or use pre-built snippets available in the extensions marketplace.

💡Code Navigation

Code navigation refers to the strategies and tools used to efficiently move through and understand large codebases. This includes finding and jumping to symbols, searching for specific functions or classes, and understanding the structure of the code.

Highlights

Visual Studio Code (VS Code) is a powerful tool that can significantly boost productivity, but its full potential is unlocked with efficient usage.

VS Code is often mistaken for a simple text editor, but it contains numerous features that can enhance coding speed and analysis.

Using the VS Code CLI (code command) from the terminal to open directories or files is faster than using the file explorer.

For Mac or Linux users, the VS Code binary needs to be added to the path to use the code command effectively.

Reducing mouse reliance in VS Code increases productivity, as most actions can be performed quicker with keyboard shortcuts.

The Command Palette (Control+Papa) offers the full power of VS Code from the keyboard without memorizing numerous key bindings.

The Command Palette can also execute JavaScript directly in the file and manage extensions like Quoca.

Navigating to symbols within a file or across the entire project can be done efficiently using the Command Palette or Ctrl+Shift+Period.

Editing code is faster with keyboard shortcuts like Control+Golf for jumping to specific lines and Ctrl+D for multi-cursor editing.

Multi-line editing can be improved with the Auto Rename Tag extension, which automatically updates closing tags when editing opening tags.

Moving or copying lines without the mouse can be achieved using Alt+Up/Down Arrows and Alt+Shift+Up/Down Arrows.

Commenting out code is simplified with Ctrl+Forward Slash and the Better Comments extension for enhanced readability.

Terminal usage in VS Code can be enhanced with multiple sessions, different shells, and command history navigation using keyboard shortcuts.

VS Code tasks allow for running repetitive commands without manually typing them in the terminal.

Git commands can be executed and managed more safely and easily with the Source Control tab and the Git Lens extension.

Remote Repositories, Remote SSH, and Remote Containers extensions transform VS Code into a full-fledged integrated development environment.

Custom snippets can be created to avoid writing boilerplate code repeatedly, and pre-built snippets may already exist for popular frameworks.

The Pace JSON as Code extension can save time by automatically inferring TypeScript types from JSON objects.

Renaming symbols in code is safer using the Find All References or Implementations feature followed by the Rename Symbol option.

Transcripts

play00:00

visual studio code is like a knife it's

play00:02

only as good as the hands that wield it

play00:04

but unfortunately it has more knobs than

play00:06

a fighter jet and requires the steady

play00:07

hand of a surgeon to the untrained eye

play00:09

vs code is just a simple text editor

play00:11

like microsoft word with code

play00:13

highlighting

play00:13

but in reality it contains a ton of

play00:15

productivity boosting features that

play00:17

you're probably not using yet

play00:18

in today's video we'll compare amateur

play00:20

vs code techniques to the ones used by

play00:22

professionals allowing you to write and

play00:24

analyze your code faster

play00:25

because the most valuable thing you own

play00:26

in this world is your time if you're new

play00:28

here like and subscribe then leave your

play00:30

best vs code pro tip in the comments

play00:32

i'll choose one of them to win this free

play00:33

t-shirt next week and now let's jump

play00:35

right into things by installing vs code

play00:37

once installed you'll want to open up a

play00:39

directory with some files in it maybe

play00:40

you just generated a new astro project

play00:42

from the command line

play00:43

then to open it in your editor you pull

play00:45

up the file explorer and click

play00:47

open with vs code that works but it

play00:49

would have been much quicker had you

play00:50

done it from the command line if you're

play00:51

in the terminal and want to open a

play00:53

directory or edit a file you can do that

play00:55

quickly with the vs code cli

play00:57

using the code command but keep in mind

play00:59

if you're on mac or linux you need to

play01:01

first add the binary to your path

play01:03

now that we have the editor opened it's

play01:05

tempting to go around two different

play01:06

windows with the mouse and click on

play01:08

buttons to run commands just like we

play01:09

would with any other software

play01:11

but here's a little productivity secret

play01:13

the less you rely on the mouse the

play01:15

better

play01:15

vs code allows you to use the mouse for

play01:17

everything making the tool approachable

play01:19

but that's really the most efficient way

play01:20

to get things done you don't have to go

play01:22

crazy and learn something like vim or

play01:23

emax

play01:24

but it's important to understand that

play01:25

anything you do with your mouse can

play01:27

likely be done quicker with the keyboard

play01:29

virtually every command you see in the

play01:30

vs code window can be done with a

play01:32

keyboard shortcut you don't need to

play01:33

memorize them all but knowing about 10

play01:35

to 20 will literally change your life

play01:37

letting go of the mouse may not feel

play01:38

natural at first but mastering the

play01:40

keyboard is a lot like learning to play

play01:42

an instrument

play01:42

it takes a lot of practice but

play01:43

eventually it becomes second nature the

play01:45

first shortcut you'll want to memorize

play01:47

is control papa

play01:48

which brings up the command palette the

play01:50

beauty of the command palette is that it

play01:51

gives you all the power of vs code from

play01:53

the keyboard without having to memorize

play01:55

a bunch of key bindings

play01:56

by default it will give you a list of

play01:58

recently opened files

play01:59

in addition you can start typing a file

play02:01

name to find it in your project and

play02:03

that's obviously much quicker than

play02:04

trying to find a file by clicking

play02:05

through a bunch of directories in the

play02:07

file explorer

play02:08

but the command palette can do a lot

play02:09

more if you type a right angle bracket

play02:11

it will give you access to virtually any

play02:13

command that you can run in vs code

play02:15

along with the commands for the

play02:16

extensions that you use

play02:18

for example you may want to toggle the

play02:19

minimap or one thing that you'll notice

play02:21

in some of my videos is that i execute

play02:23

javascript directly in the file itself

play02:25

and that's made possible by an extension

play02:27

called quoca which is a tool that i can

play02:29

start and stop in any file via the

play02:31

command palette the extension itself is

play02:33

really cool

play02:34

it automatically runs your javascript

play02:35

code in the background then appends the

play02:37

output directly in your editor which can

play02:39

facilitate rapid prototyping when your

play02:41

goal is to just write some plain

play02:42

javascript code

play02:43

now another really awesome thing we can

play02:45

do here is find pieces of code or

play02:47

symbols throughout our project when

play02:49

working in a really big file it's easy

play02:51

to get lost

play02:52

the worst thing you can do is scroll

play02:53

around the page looking for the function

play02:55

or

play02:55

interface that you need you could do

play02:57

control foxtrot to find that text on the

play02:59

page

play02:59

but an even better approach is to use

play03:01

the at symbol from the command palette

play03:03

that'll list out every symbol in the

play03:05

code so you can quickly navigate to it

play03:06

and if you want you can bypass the

play03:08

command palette altogether by entering

play03:10

ctrl shift period to do the same thing

play03:12

directly in the file itself now in other

play03:14

cases you may want to find a symbol

play03:16

throughout the entire project

play03:17

including all of your dependencies like

play03:19

node modules use a hashtag

play03:21

followed by the name of the symbol

play03:22

you're looking for to find that

play03:24

interface in your own code or your

play03:25

dependencies code

play03:26

another really awesome bonus tip here is

play03:28

that if you have a really long class

play03:29

name you don't even have to type the

play03:31

whole thing out

play03:32

just the first character in each camel

play03:33

cased word and it will work just as well

play03:35

the command palette is awesome but it

play03:37

doesn't really help you write your code

play03:39

faster when you see a line of code that

play03:40

you want to edit

play03:41

the natural approach is to take the

play03:42

mouse and then highlight that line

play03:44

a developer might do this hundreds if

play03:46

not thousands of times per day

play03:48

a faster way to get to where you need to

play03:49

go is to hit control golf

play03:51

followed by the line number that you

play03:52

want to focus on from there use the

play03:54

arrow keys to go character by character

play03:56

and hold down the shift key if you want

play03:58

to highlight something or use ctrl arrow

play04:00

to move word by word

play04:01

when your cursor lands on a word that

play04:03

you want to edit hit ctrl

play04:04

delta to highlight it so you can then

play04:06

delete it or replace it

play04:08

but here's where things get really mind

play04:09

blowing if those characters appear

play04:11

multiple times in the code and you want

play04:12

to edit them all at the same

play04:14

time just hit ctrl d again and again and

play04:16

you're now a 3x developer editing three

play04:18

lines of code at the same time

play04:20

in some cases you may want to use the

play04:21

mouse for multi-line editing

play04:23

holding down alt while you click on

play04:25

different parts of the editor will set

play04:26

up cursors in multiple

play04:28

places that can be really useful for

play04:29

writing repetitive css properties

play04:31

one place you might use this often is

play04:33

with opening and closing html tags

play04:36

but you can actually make your life even

play04:37

easier by installing the auto rename tag

play04:40

extension

play04:41

this will automatically rename the

play04:42

closing tag when you edit the opening

play04:44

tag and it can work in other languages

play04:46

beyond just html

play04:47

now in other cases you may just want to

play04:49

delete or move a line

play04:50

the amateur approach is to highlight

play04:52

that line do a right click with the

play04:54

mouse and find cut then do another right

play04:56

click with the mouse and find paste

play04:57

here's the faster approach if your

play04:59

cursor is already on a line all you have

play05:01

to do is hit ctrl x to cut it no

play05:03

highlighting is necessary

play05:04

but if your goal is to move the line

play05:06

somewhere else then there's an even

play05:07

better approach

play05:08

use alt followed by the up or down

play05:10

arrows to move the line somewhere else

play05:11

quickly

play05:12

and if you want to copy that line as you

play05:14

move it use alt shift followed by the

play05:16

arrows

play05:16

now one other thing that you likely

play05:18

often do in your code is comment it out

play05:20

to disable it the worst possible thing

play05:21

you can do

play05:22

is go line by line adding the comment

play05:24

syntax to each line

play05:25

if this is how you currently do comments

play05:27

you'll want to pay attention to this

play05:28

next shortcut

play05:29

first highlight the code using your

play05:31

mouse or by using the control

play05:32

l command to highlight line by line once

play05:35

highlighted use ctrl forward slash to

play05:37

toggle comments on that code now when

play05:39

speaking of code comments

play05:40

it's often important to format them

play05:42

properly in javascript that typically

play05:44

means following the js docs standard

play05:46

and there's an extension called add

play05:47

js.com once installed

play05:49

it allows us to highlight a function

play05:51

then use the command palette to add a

play05:53

comment to it automatically

play05:55

bonus tip in your js dot comments you

play05:57

can use the link tag to link to other

play05:59

symbols in your source code when you

play06:00

hover over that symbol it will give you

play06:02

the comment that if you click the link

play06:04

it will take you to that part of the

play06:05

code automatically that makes writing

play06:07

comments much easier but what if we

play06:09

could also make them easier to read

play06:10

by also installing the better comment

play06:12

extension we'll get automatic

play06:14

highlighting in our comment text

play06:15

any line that starts with a bang is now

play06:17

red and all of our to-do's are

play06:19

highlighted orange

play06:20

but now let's switch gears into a very

play06:22

important topic the terminal you can

play06:24

open a new terminal session directly in

play06:25

vs code in your current working

play06:27

directory

play06:28

using control backtick when you start a

play06:29

new terminal it uses your default shell

play06:31

which in my case is bash

play06:33

if you click the caret you can use a

play06:34

different shell if needed like

play06:36

powershell or wsl

play06:37

what often happens though is you need

play06:39

multiple terminal sessions running

play06:41

at the same time like one for your test

play06:42

runner one for your dev server

play06:44

and so on to keep things organized click

play06:46

on the icon

play06:47

then change the name or the color of

play06:49

that session and now you don't have to

play06:50

fumble between different terminals to

play06:52

figure out what each one is doing

play06:54

now when you type out an actual command

play06:56

in the terminal and you screw it up you

play06:58

can use ctrl arrows to quickly navigate

play07:00

to a different part of the actual

play07:02

text because your mouse won't even work

play07:03

here but if you already hit enter and

play07:05

got an error message

play07:06

you can use ctrl k to clear out the

play07:08

terminal then use the up arrow to go to

play07:10

the last command in your history

play07:12

and just rerun it instantly but what if

play07:14

there is a way where you didn't have to

play07:15

write the same terminal command over and

play07:17

over again

play07:17

like how many times have you written npm

play07:19

run build or npm run test

play07:22

to simplify things you can create a vs

play07:24

code task

play07:25

which is just a json configuration that

play07:27

contains a command that you want to run

play07:29

in the terminal

play07:30

now instead of pulling up the terminal

play07:31

and writing out a command you can just

play07:33

use the command palette to run it

play07:34

automatically and it will show the name

play07:36

of that task in the terminal sidebar

play07:38

here

play07:38

speaking of the terminal one of the most

play07:40

common things you'll do here is execute

play07:42

commands for version control using

play07:44

get not only are git commands hard to

play07:46

remember but it can be very dangerous

play07:47

and painful when you mess them up the

play07:49

standard procedure for get ups is

play07:51

to go to stack overflow and look at the

play07:53

top questions there because they're

play07:54

almost all related to get

play07:55

the funny thing though is that i think

play07:57

this is an area where it actually makes

play07:58

more sense to use your mouse as opposed

play08:00

to the keyboard in the source control

play08:02

tab in vs code we get a breakdown of all

play08:04

the changes in our current working

play08:06

directory

play08:06

we can just point and click at files

play08:08

that we want to stage and also notice

play08:10

the icon next to each file which will

play08:11

tell us if that file has been modified

play08:13

added or removed now from the drop down

play08:15

menu we get a list of all the possible

play08:17

git commands

play08:18

most often we're just committing files

play08:20

but vs code will give us a breakdown of

play08:22

all the possible commands without having

play08:23

to look them up in the documentation

play08:25

if you're working on a big complex

play08:27

project with other developers i'd highly

play08:29

recommend installing the git lens

play08:30

extension it provides a bunch of extra

play08:32

ways to visualize and explore your code

play08:34

and most importantly it will tell you

play08:36

exactly who to blame when your code

play08:37

stops working

play08:38

it's a really great extension but now

play08:40

we're going to look at another extension

play08:41

that's brand new and even crazier

play08:43

normally when you want to work with a

play08:45

git repo on github you need to clone it

play08:47

to your local system but now

play08:49

thanks to the monopoly that microsoft

play08:50

has on the developer ecosystem

play08:52

this process can now be streamlined with

play08:54

remote repositories

play08:55

install the extension then click on this

play08:57

icon in the bottom left corner

play08:59

to open up a remote repository it'll

play09:01

have you log in with your github account

play09:03

then you can start contributing to any

play09:04

repo on github without needing to worry

play09:07

about complex git commands you can

play09:08

create a new branch

play09:09

edit some code and then submit a pull

play09:11

request without ever having to leave bs

play09:13

code in addition to remote repositories

play09:15

you should also know about remote ssh to

play09:17

connect to a remote server

play09:19

and also remote containers to use a

play09:21

docker container as your development

play09:23

environment

play09:23

instead of your local system these

play09:25

extensions are managed by microsoft and

play09:27

can turn your basic text editor into a

play09:29

full-blown integrated development

play09:30

environment

play09:31

but let's get back to our actual code in

play09:33

many projects you may find yourself

play09:35

writing the same boilerplate code over

play09:37

and over again

play09:38

if you find yourself doing that an easy

play09:39

way to improve your productivity

play09:41

is to create a custom snippet from the

play09:43

command palette run the configure user

play09:45

snippets command

play09:46

you can create global snippets to use

play09:48

across all of your projects or scope

play09:50

them to an individual workspace

play09:52

basically you just modify this json file

play09:54

with the code that you want to insert

play09:56

then when you go back to your main

play09:57

project you can use the insert snippet

play09:59

command

play10:00

to quickly add your own custom

play10:01

boilerplate but if you work with a

play10:03

popular framework

play10:04

there's a good chance that somebody

play10:05

already did this work for you before you

play10:07

go building your own

play10:08

check out the extensions panel to see if

play10:09

there are any pre-built snippets out

play10:11

there that already meet your needs

play10:12

oh and here's a cool random thing if you

play10:14

need to create a new file in the file

play10:16

explorer

play10:16

but it lives in a directory that doesn't

play10:18

exist yet you can create that file

play10:20

along with any nested directories on top

play10:22

of it automatically

play10:23

by just putting a slash in front of the

play10:25

file name and vs code will automatically

play10:27

create those directories

play10:29

now yet another awesome tool that i want

play10:31

to mention is the pace json as code

play10:33

extension

play10:34

if you work with typescript one

play10:35

extremely tedious thing you might have

play10:36

to do

play10:37

is take a json object and convert it to

play10:39

a bunch of types to represent some kind

play10:41

of schema this extension will take your

play10:43

json and automatically infer types using

play10:46

a tool called

play10:46

quick type and in some cases that can

play10:48

save you hours of work

play10:50

but the final thing i want to leave you

play10:51

with is a quote you've probably heard

play10:52

before

play10:53

there are only two hard things in

play10:55

computer science cash invalidation

play10:57

and naming things naming your code is

play10:59

hard which means that you'll often be

play11:00

renaming things

play11:02

when you name something poorly your

play11:03

first idea might be to do a find and

play11:05

replace

play11:06

across your whole project but that can

play11:08

be kind of dangerous a better idea is to

play11:10

find the thing you want to rename

play11:11

then if you right click it you can find

play11:13

all of its references or

play11:14

implementations then from there you can

play11:16

use the rename symbol option

play11:18

to safely rename it across all of your

play11:20

files i'm going to go ahead and wrap

play11:21

things up there but make sure to share

play11:23

your own vsco pro tips in the comments

play11:25

and if you want to support my work

play11:26

consider sponsoring me on github or

play11:28

becoming a pro member at fireship io

play11:31

thanks for watching and i will see you

play11:32

in the next one

Rate This

5.0 / 5 (0 votes)

Étiquettes Connexes
VSCode ProductivityCoding EfficiencyKeyboard ShortcutsExtensionsDeveloper ToolsProgramming TechniquesIDE MasteryCode NavigationGit IntegrationRemote Development
Besoin d'un résumé en anglais ?