After a long day, have you ever passed out as soon as your head hit the pillow due to copy and paste exhaustion. Pressing Control + C and Control + P multiple times an hours is akin to running a marathon!

To save yourself from this physically demanding side-effect of development, within this article I thought I would provide simplify your copy and paste game! Carry on reading as within 5 minutes I will share three tips that will make copy and paste within Visual Studio Code simpler and more powerful 🔥🔥🔥

Copy On Select

If you prefer the mouse to the keyboard, have you ever wished that when you highlighted some code you wanted to copy, instead of having to press Control + C, that code was automatically copied to the clipboard instead?

You can install Copy On Select from the marketplace here.

Highlight on Copy

This next extension is super simple, however, you might wonder why you cant do this out the box! Have you ever thought you copied somethign to the clipboard, however, when you paste you hadn't? When you copy within VS-Code there is no visual feedback that anything has happened. Within other IDEs like NeoVim, when you copy the selection will quickly flash. This feedback gives you some visual feedback the action you expected to happen, did actual occur. Surprising, you can not do this out-the-box within VS-Code

One day a developer called Marc Güell Segarra who uses made a stand about this lack of like-for-like functionality with NeoVim and decided to create a VS-Code extension that mimics this behaviour by creating Highlight on Copy! You can install Highlight on Copy from the marketplace here. Once installed, Highlight on Copy works out of the box

Clipboard Manager

Now that we have an easier way to copy things, the next potential challenge is managing the stuff we add to the clipboard!

Have you ever accidently removed some code from within your project and the only fix is to press the undo button about 30 times. After you find the deleted code, you copied it and then pressed the redo button 30 times to jump back to the code you were working on. Just before you paste the saved code, you need to copy something else, switch tasks, or, you accidently copy something else and loose that copied code? When this happens, you then have to painfully repeat the process all over again?

In these scenarios wouldn't it be easier to simply look within a searchable clipboard history inside of VS-Code instead? This is where Clipboard Manager comes into play.

After you install this extension, within your VS-Code side bar you will get access to a clipboard manager. From here its really easy to browse your complete VS-Code clipboard history. When you need to paste an older clipboard entry into your code, double click on it and job is a good one!

Clipboard Manager is definitely my preferred clipboard history extension for VS-Code , however, one feature it lacks is a search. Personally, I don't normally need a clipboard history search, however, if you do I recommend you try this extension instead.

Paste JSON as Code

Have you ever wasted a day trying to manually map an API response to code? Have you ever wasted 30 minutes debugging an error that was caused due to you accidently adding a [ instead of a {? Has your code ever blown up because the object you worked with had a level of nesting you didn't correctly parse for? Have you ever needed to convert the response from an API into Typescript props?

My guess is that everyone reading this will need to perform one of those tasks fairly regularly. Instead of wasting a bunch of time trying to figure stuff out yourself, why don't you get VS-Code to do the hard work for you?

This is where Paste JSON as Code comes in handy. Downloaded over 2 million times, Paste JSON as Code will take any JSON and then convert it into either C#, C++, Crystal, Dart, Elm, Flow, Go, Haskell, JSON Schema, Java, JavaScript, JavaScript PropTypes, Kotlin, Objective-C, PHP, Pike, Python, Ruby, Rust, Scala3, Smithy, Swift, TypeScript, TypeScript Effect Schema and TypeScript Zod!!!!

The converter will take JON and then generate the code to serialize and deserialize the JSON to an object of your choosing. Using this generated code you can generate code you can pop ait into your app. This definitely gives your paste a level-up as you will no longer need to perform manual faffing!!!

You can learn more about this extension from here.


Happy Coding 🤘