Text Editor

Select text in the editor below to create selections. Then paste text into those selections.

Current Selections

No selections yet. Select text in the editor above.

Selections: 0

Text to Paste

Result

Result will appear here

How does it work?

This tool allows you to paste text at multiple selection points simultaneously while preserving those selections. It's useful for inserting the same text at multiple locations in your document without having to do it manually for each location.

Steps to use this tool:

  1. Enter or paste your base text in the editor
  2. Select portions of text to create selections (non-overlapping)
  3. Enter the text you want to paste at those selections
  4. Choose a paste mode (replace, before, or after)
  5. Click "Paste at Selections" to apply

Paste Modes

  • Replace selections: Replaces each selected text with the paste text
  • Insert before selections: Inserts the paste text before each selection (preserving the selection)
  • Insert after selections: Inserts the paste text after each selection (preserving the selection)

Example Use Case

Original Code:

function calculateTotal(items) {
  let total = 0;
  
  // Loop through each item
  for (let i = 0; i < items.length; i++) {
    const item = items[i];
    total += item.price * item.quantity;
  }
  
  return total;
}

Text to Paste:

// Apply discount if available
if (item.discount) {
  total -= item.discount;
}

Result (after pasting before the return statement):

function calculateTotal(items) {
  let total = 0;
  
  // Loop through each item
  for (let i = 0; i < items.length; i++) {
    const item = items[i];
    total += item.price * item.quantity;
  }
  
// Apply discount if available
if (item.discount) {
  total -= item.discount;
}
  
  return total;
}

This tool is useful for:

  • Adding the same code snippet at multiple locations
  • Inserting logging statements throughout your code
  • Adding comments or annotations at specific points
  • Replacing placeholder text with actual content
  • Performing batch text operations at specific locations

Tip:

You can create a selection with zero width (just a cursor position) by clicking at a specific position without dragging. This is useful when you want to insert text at specific points without replacing anything.

Other tools

See other tools