/tips
Tips
2026-04-02
vimDebug Macros by Pasting Them
When a macro misbehaves, paste its contents with "qp (for register q). You'll see the raw keystrokes including ^[ for Escape and ^M for Enter. Edit the text directly, then reload with :let @q = 'fixed-content'. No more re-recording broken macros.
2026-04-01
devopsUse .dockerignore to Accelerate Multi-Stage Builds
Your .dockerignore file is critical for multi-stage build performance. Even though your final stage won't include excluded files, Docker still sends them to the build context, slowing down every COPY . . instruction.
# .dockerignore
node_modules/
*.log
.git/
README.md
Dockerfile*
.dockerignore
A properly configured .dockerignore can reduce build context from hundreds of MB to just a few MB, dramatically speeding up builds—especially in CI/CD pipelines where network latency matters.
2026-03-31
devopsUse Artifacts for API Response Mocking
Generate realistic JSON API responses in Claude Artifacts by describing your data structure. "Create a mock REST API response for user profiles with nested address data" gives you properly formatted JSON with realistic field names and values. Perfect for frontend development before the backend is ready, or for testing edge cases with varied data structures.
2026-03-27
cliCtrl+X Ctrl+E Opens Your $EDITOR from Any Command Line
Typing a long command and wish you were in your editor? Press Ctrl+X Ctrl+E in bash (or Ctrl+X e in zsh) and your current command line opens in $EDITOR. Save and quit to execute. Set export EDITOR=vim in your shell profile if you haven't already.
2026-03-26
gitgit stash push -m Gives Your Stashes Names
Stop losing track of your stashes. Instead of git stash, use:
git stash push -m "WIP: auth token refresh logic"
Now git stash list shows meaningful labels instead of cryptic auto-generated messages. When you have 5+ stashes, this is the difference between finding your work and guessing.
2026-03-25
vimUse ci( to Change Inside Parentheses
In Vim, ci( deletes everything inside the nearest parentheses and drops you into insert mode. Works from anywhere inside the parens — your cursor doesn't need to be on the opening paren.
The same pattern works for all paired delimiters: ci[, ci{, ci", ci', ci<, and even ci` for backticks.
Use ca( instead to include the parentheses in the change. The a stands for "around."