DEV Community

Cover image for Don’t Touch That Mouse! Smart Developers Use Keyboard Shortcuts
Liam Stojanovic for Pieces.app

Posted on

Don’t Touch That Mouse! Smart Developers Use Keyboard Shortcuts

TL;DR

Mouses are slow. Keyboards are fast. If you’re a developer, use keyboard shortcuts to drastically increase your productivity in web browsers, IDEs and code snippet tools like Pieces.

How it feels using keyboard shortcuts in the Pieces app

The Case for Keyboard Shortcuts

According to Brainscape…

If your job requires you to be working on a computer throughout each standard 8-hour workday, then using keyboard shortcuts can save you 8 entire workdays every year.

Image description

A single keystroke may only shave you “0.4 seconds” but think about the hundreds of times you reach for your mouse daily. We’re talking hours per week, days per month, weeks per year.

More importantly, keyboard shortcuts keep you in your flow and let you work at the speed of thought.

With some practice, you’ll be able to quickly perform key tasks and navigate menus in your browser, IDE and code snippet tools like Pieces without ever touching that dreaded mouse.

The Browser

Let’s start with the good ol’ browser, where you’re probably doing a lot of your development research (and checking crypto prices, flicking through YouTubes and I don’t want to know what else).

Vimium

Vimium — often referred to as the “hacker’s browser” — is a popular Chrome extension (with a port to Firefox) that allows you to navigate the web using just your keyboard! Shortcuts are based on the Vim text editor.

Some power shortcuts in the GIF below include:

  • Follow a hyperlink in a new tab (F)
  • Scroll up and down (j, k)
  • Switch between tabs (J, K)

Vimium features mouse-less scrolling and web page navigation

Code Snippet Tools Like Pieces

Code snippets are an incredibly helpful way to save time by not re-writing the same code or re-searching for solved solutions.

But it’s always been a hassle to save and work with code snippets.

Pieces is a popular new tool that enables you to save code snippets in less than a second from your code editor or any web page in Chrome and Edge.

And as you can guess, keyboard shortcuts are the heart of this beautifully intuitive app.

Saving a Snippet from IntelliJ

Just highlight your snippet and click + + P (Mac) or Ctrl + Alt + P (Windows).

Saving snippets in IntelliJ with keyboard shortcuts

Saving a Snippet from Chrome

The Pieces Chrome extension makes saving code from the internet a breeze.

Highlight the desired code and hit + Shift + P (Mac) or Alt + Shift + P twice (Windows).

Even easier, while this isn’t technically a keyboard shortcut, Pieces pops up a “Save” button when it detects code on a webpage. A single click will save that snippet.

Saving to Pieces with Google Chrome

Finding and Re-Using Snippets in Pieces
To find a snippet in Pieces, just hit / and start searching.

What’s even more helpful is that the Pieces Chrome extension automatically adds the source URL to the snippet as a Related Link. This is one of my favorite features and I no longer have endlessly cluttered Stack Overflow bookmarks with no context.

You can view and manage your related links by hitting + K (Mac) or Ctrl + K (Windows).

Related links in Pieces

So Many Shortcuts

There are loads of other great keyboard shortcuts throughout Pieces. Hover over almost any action and you’ll see a shortcut option.

Some of my favorites include:

  • Rename your snippet: + R / Ctrl + R
  • Edit the description: + N / Ctrl + N
  • Reclassify the snippet language: + Y / Ctrl + Y
  • Open the Quick Menu actions: + O / Ctrl + O

Quickly add a description. Descriptions are searchable, and can span multiple lines.

Code Editors

When it’s time to get down to coding, the mouse is your enemy. Let’s look at some critical shortcuts for two popular editors:

VSCode

VSCode is one of the most popular free code editors, with extensions for all kinds of programming languages and projects.

IntelliJ
IntelliJ comes jammed with built-in shortcuts and has a robust library of plugins to boost your productivity.

Resources

Guake Project

A simple and easy way to use the terminal without leaving your current application.

Guake is triggered by a hotkey that drops down a terminal over your desktop, and retreats when that same hotkey is pressed again.

Only available for Linux machines running Gnome as their desktop environments.

Guake terminal

AceJump for IntelliJ

AceJump enables single character search, select and jump inside IntelliJ.

Image description

KeyCombiner

Not to get too meta on you, but KeyCombiner is a cool app designed to help practice keyboard shortcuts. Collections are available for many popular apps, including IDEs and web applications.

Image description


Wrapping Up

Keyboard shortcuts liberate you from the burden of mouse wiggles and right-clicks. Simple time-saving measures compound into days of your life back! Take the red pill, learn keyboard shortcuts, and relish in your regained time.

I know Kung Fu

Thank you for reading! If you enjoyed this article, check out our app, follow us on Twitter, and give our Medium publication a follow!

Top comments (1)

Collapse
 
lestrae profile image
Alex

True. I'm not ready to switch to VIM, but when I learned keybinds in my Sublime I start working much faster. Not only faster, but also with better concentration.
This is where gaming in childhood helped me - in World of Warcraft I used a lot of keybinds 😁