Efficiency
Speed up your workflow with keyboard shortcuts, alias commands, and AI prompts
All the tips and tricks I’ve learned over the years to speed up my workflow and build features or fix bugs at lightning speed.
Editor Efficiency
We’re using Cursor for all our code editing. It’s a powerful AI-powered editor that can help you write code faster and more efficiently.
Check out this Masterclass to quickly get familiar with all the most important features.
Essential Keyboard Shortcuts for Cursor
If you’re not already using Cursor, you should be. Check out the Pre-Requisites guide
The fastest way to get my keyboard shortcuts setup:
- Make sure you have Cursor installed and open
- Install my Complete Profile
- It will automatically ask to open in Cursor. Click “Create”
This will give you my exact profile including all shortcuts, extensions, and settings.
Some of my most-used shortcuts (Mac-specific):
Cmd + P
: Quick Open (search for files)Cmd + Shift + P
: Command Palette (access all commands)Cmd + Shift + F
: Global search across the codebaseCtrl + backtick
: Toggle terminalOption + Up/Down Arrow
: Expand text selectionCmd + Option + Left/Right Arrow
: To easily navigate back and forth between cursor positionsCmd + /
: Comment/Uncomment codeCmd + B
: Open left sidebar file treeCmd + L
: Open Cursor AI Chat interface to chat with files or the entire codebase (using either@codebase
orCmd+Enter
when asking a question to let it use the entire codebase context)Cmd + I
: To open Cursor AI Composer interface when you want Cursor to help you implement a new feature, fix a bug, refactor code, etc. autonomously (Most Powerful Cursor Feature!)Cmd + K
: 2 uses:- When inside a file -> Lets you generate new code where the pointer is currently (with an AI prompt), or edit the selected code (with an AI prompt)
- When in the terminal -> Lets you ask the AI to generate a command to run in the terminal
Prompt Engineering
Crafting effective prompts is an art. AI modals can hallucinate if they aren’t given enough context, my best tips:
- Be Specific: Clearly state what you want the AI to do in your own words.
- Provide Context: Tag the right files/folders to give the AI enough information to understand roughly where to make changes (preventing hallucinations).
Using Cursor Composer, you can use the following prompts to:
Fix a bug
Start a new Composer session and paste the following prompt:
Add a new feature
Start a new Composer session and paste the following prompt:
Refactor codebase
Our codebase should remain maintainable at every stage.
Try to:
- Keep individual files under 400 lines of code. Longer files:
- Make AI tools more likely to hallucinate when analyzing your code
- Are harder to understand and debug
- Often indicate too many responsibilities in one file
- Keep functions as small and focused as possible
- Keep components as small and focused as possible
Doing so makes the codebase more maintainable and easier to understand/debug (especially for Cursor Composer).
If any of these heuristics are violated, then it’s a clear sign that an area of the codebase needs refactoring.
Start a new Composer session and paste the following prompt:
Learning a new Concept
When learning a new concept, use Cursor Composer to create an isolated environment to experiment:
Example: Learning async/await in JavaScript
This approach helps you:
- Focus on one concept at a time without distractions
- Get hands-on practice immediately
- Build a reference implementation you can come back to later
- Understand best practices and common patterns through examples
Alias Commands
Speed up your workflow with alias commands.
Never think about commit messages again
-
Follow quick installation guide for aicommits
-
Set alias:
- Now you can just run
gagc
to add all files to git and generate a commit message based on the file changes