Back to tips

Copy and Trim Indentation

Copy selected text with leading whitespace automatically trimmed

productivity beginner January 20, 2026 · JosephTLyons
#editing #clipboard
Copy and Trim Indentation

When copying code snippets from nested blocks, you often don’t want the extra indentation. The Copy and Trim feature in Zed’s editor context menu automatically removes leading whitespace when copying selected text.

Instead of copying text like this:

            "diagnostics": {
                "inline": {
                    "enabled": true
                }
            },

Copy and Trim gives you clean, unindented text ready to paste:

"diagnostics": {
    "inline": {
        "enabled": true
    }
},

Right-click on any selection in the editor and choose Copy and Trim from the context menu to use this feature.