3 Hotkeys That Will Make You a Faster Developer


These are my three favorite hotkeys while coding. They make me faster, more productive, and improve my code quality. On top of that, they reduce my cognitive load and make my code easier to read. I'm using VS Code as my example but you could use them in any IDE you'd like.

View and Edit Hotkeys

Before we get into it, here's a quick reminder of how to view and edit your hotkeys in VS Code.

Go to Code -> Settings -> Keyboard Shortcuts or type Cmd + k then Cmd + S.

1. Organize Imports

It's like having a clean closet

Shortcut: Shift + Option + O (Mac) | Shift + Alt + O (Windows)

The imports section of your files can easily become a mess with unused imports and the latest import at the bottom of the list — which isn't an organization strategy at all. You might (and you should!) have a lint rule setup to catch unused imports but this command lets you get rid of that error message quickly.

The "Organize Imports" command (sometimes called "Optimize Imports" in other editors) automatically:

  • Removes unused imports
  • Sorts all imports alphabetically
  • Eliminates duplicate imports
  • Improves overall code readability

Example

You might not even realize how messy these imports are but code without an organization strategy applied is simply unorganized and isn't doing your brain any favors.

Before using this shortcut, your imports might look like this mess:

import {
  CardHeader,
  CardTitle,
  CardContent,
  Card,
  CardDescription,
} from '@/components/ui/card' //out of order
import { Button } from '@/components/ui/button'
import { Card } from 'react-bootstrap' // duplicate
import { useState } from 'react'
import { Alert } from '@/components/ui/alert' // unused

After pressing Shift + Option + O, it becomes:

import { Button } from '@/components/ui/button'
import {
  Card,
  CardContent,
  CardDescription,
  CardHeader,
  CardTitle,
} from '@/components/ui/card'
import { useState } from 'react'

Clean, organized, and instantly more readable. I make it a habit to run this command anytime I've touched the imports. It's such a simple step that eliminates visual clutter and makes code reviews much smoother.

2. Sort Lines

Because Your Brain Loves Alphabetical Order

Custom Shortcut: Ctrl + Option + S (ascending) | Ctrl + Option + D (descending)

One of my core coding principles is simply: if you don't have a specific reason to sort something in a particular way, it should just be alphabetical. Our brains are wired for alphabetized things. When dealing with text, which code is, alphabetized lists are nearly always the way to go.

This one requires a bit of setup since it's not mapped by default, but it's absolutely worth it.

Setting It Up

  1. Open VS Code Shortcuts settings (Cmd + K, Cmd + S)
  2. Search for "sort"
  3. Find "Sort Lines Ascending" and "Sort Lines Descending"
  4. Add your custom keybindings (I use Ctrl + Option + S/D). I find the Control + Option pair is almost never already mapped and I like using it for my custom key mappings.

Example

Let's say you have a list of error messages:

const ERROR_MESSAGES = {
  'unknown_error': 'An unexpected error occurred. Please try again',
  'required': 'Please sign in to access this page',
  'invalid_credentials': 'The email or password you entered is incorrect',
  'too_many_requests': 'Too many attempts. Please try again later',
  'network_error': 'Network error. Please check your connection',
  'email_not_confirmed': 'Please confirm your email address before signing in',
} as const;

Instead of leaving them in random order, select the lines and press Ctrl + Option + S:

const ERROR_MESSAGES = {
  'email_not_confirmed': 'Please confirm your email address before signing in',
  'invalid_credentials': 'The email or password you entered is incorrect',
  'network_error': 'Network error. Please check your connection',
  'required': 'Please sign in to access this page',
  'too_many_requests': 'Too many attempts. Please try again later',
  'unknown_error': 'An unexpected error occurred. Please try again',
} as const;

Now when you're scanning through the list, your brain doesn't have to work as hard. Looking for "Unknown error"? It's always going to be at the bottom where "U" belongs. This small change reduces cognitive load and makes code scanning much faster.

3. Multiple Cursors

Edit Like a Pro

Shortcut: Option + Command + Up/Down (Mac) | Alt + Ctrl + Up/Down (Windows)

This shortcut lets you add cursors above or below your current position, enabling you to edit multiple lines simultaneously. It's a massive time-saver for repetitive edits.

Perfect Use Cases

Imagine you have a list of error messages and want to add a period to the end of each:

const errors = [
  'Database timeout occurred',
  'File not found',
  'Invalid user credentials',
  'Network connection failed',
  'Permission denied',
]

Instead of manually editing each line:

  1. Place your cursor at the end of the first line
  2. Hold Option + Command and press the down arrow to add cursors to subsequent lines
  3. Type the period once – it appears on all lines simultaneously

The result:

const errors = [
  'Database timeout occurred.',
  'File not found.',
  'Invalid user credentials.',
  'Network connection failed.',
  'Permission denied.',
]

Pro Tips for Multiple Cursors

  • You can add as many cursors as you need
  • Each cursor operates independently
  • Use Escape to return to a single cursor
  • This works for any repetitive editing task, not just adding characters

PS: You can also add cursors by using Option + Left Click (on your mouse)

Beyond the Shortcuts

While these three shortcuts are my go-to productivity boosters, they represent a larger principle: small, consistent improvements in your development workflow compound into significant gains in productivity and code quality.

The time you save isn't just about typing faster, it's about reducing the cognitive load of reading and maintaining code. When your imports are organized, your lists are sorted, and your repetitive edits are efficient, you can rest assured that you've been a good steward of the codebase. Your future self and teammates will thank you for it.

Your Turn

I reach for these shortcuts daily and feel like they give me a real boost. Give them a try.

I also encourage you to search for other shortcuts you can use to improve your daily workflow. Let me know what you find.