vimtricks.wiki Concise Vim tricks, one at a time.

How do I jump to the start or end of the text I last yanked or changed?

Answer

`[ and `]

Explanation

The `[ and `] marks automatically track the boundaries of the last changed or yanked text. This is useful for returning to recently modified regions.

How it works

  • `[ jumps to the first character of the last changed or yanked text
  • `] jumps to the last character
  • These update after any change (c, d, y, p, etc.)

Example

After yanking a block of 5 lines with 5yy, `[ jumps to the first line and `] jumps to the last line of the yanked range.

Tips

  • Useful for reselecting recently pasted text: `[v`] selects it
  • After a paste, these mark the boundaries of the pasted text
  • '[ and '] jump to the lines instead of exact positions
  • Works with any operation that modifies the buffer

Next

How do you yank a single word into a named register?