Issue #21  (Lines of Code Shortcuts)09/14/22

Advertisement
Get a weekly dose of tools, articles, and other resources covering remote work, productivity, career well-being, and lots more.

There are a few interesting keyboard shortcuts for dealing with lines of code that I haven't use much at all and often forget that they exist. These shortcuts aren't necessarily specific to VS Code, but I thought you might find them useful.

DELETE A LINE
First of all, if you're going to delete an entire line, it's common to select the entire line and then hit delete. But a quick way to delete a line is:
 
  • Put your cursor anywhere in the line you want to delete
  • CTRL/CMD+SHIFT+K

COPY A LINE UP OR DOWN
Here's one that's probably more useful: To duplicate, or copy, a line:
 
  • Put your cursor anywhere in the line you want to duplicate
  • ALT/OPT+SHIFT+Down Arrow (to duplicate below the line) or ALT/OPT+SHIFT+Up Arrow (to duplicate above the line)

CUT, COPY, PASTE WITH NO SELECTION
Another potentially useful one is when cutting, copying, and pasting lines of code. Normally when you want to cut/copy and paste an entire line, you would select it first, then use the usual keyboard shortcuts for copy and paste. But you don't have to do that. You can cut, copy and paste any line of code with the cursor anywhere in the line.

In the process of pasting lines in this way, it's also useful to know that you don't have to be at the start or end of a line. You can have your cursor anywhere inside the line of code and the paste operation will paste above the current line. Of course, it's different if you selected and copied some arbitrary text. In that case, paste would work as expected, and you'd paste right where the cursor is.

MOVE A LINE UP OR DOWN
Finally another one that you might find useful is moving the current line either up or down a line. You can do this using ALT/OPT-Up Arrow or ALT/OPT-Down Arrow. This will move the entire line in the chosen direction and essentially swap it with the one either above or below.
 
Now on to this week's hand-picked links!
 
 

VS Code Tools

VSCode Working Memory — VS Code extension that allows you to open a single text or markdown file without leaving VS Code, to quickly capture notes, ideas, snippets, etc.

AWS Toolkit — A popular VS Code extension that makes it easier to develop, debug locally, and deploy serverless applications that use Amazon Web Services (AWS).

Image Preview — A VS Code extension that adds an image preview that appears in the gutter on hover, for image URLs found in your code.

XML Tools — This VS Code extension hasn't been updated in a few years, but it's extremely popular (almost 4 million installs). It provides XML Formatting, XQuery, and XPath Tools for VS Code.

VS Code Articles

VS Code 1.71 (August 2022) — The most recent updates to VS Code include merge editor improvements, file renaming options, terminal updates, and lots more.

Visual Studio Code is Designed to Fracture — Geoffrey Huntley attempts to explain why using anything other than the official distribution of VS Code makes it easy to expose yourself or your company to legal risks.

Relational Database Course – How to Learn SQL in VSCode Using Docker and freeCodeCamp — From last year, a lengthy course from freeCodeCamp that uses Docker to teach relational database concepts and SQL right inside VS Code.

Get Smarter Every Day — Every day Refind picks 7 links from around the web that make you smarter, tailored to your interests. Loved by 50k+ curious minds. Subscribe for free today.   Sponsor 

Best of the Rest

Vale.sh — An open-source CLI tool that provides code-like linting for your code documentation.

Helix-Vim — A Vim-like configuration for Helix, the Rust-based text editor for Windows, Mac, and Linux.

JetBrains Releases 2022.2 Wave of Updates to IntelliJ IDEA Family of Tools — If you're a JetBrains product user, this is a summary of recent updates to some of their tools.


Suggestions?

If you have any link suggestions, including a tool, article, or other resources related to VS Code or another IDE, send it via DM on X: @LouisLazaris or just hit reply on this email.

That's it for this issue.

Happy VS Coding!
Louis
VSCode.Email
@LouisLazaris
Copyright © VSCode.Email. All rights reserved.

Not affiliated with Microsoft, Visual Studio Code, or any of its trademarks.