Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active September 10, 2018 12:22
Show Gist options
  • Save YumaInaura/34a1383d4ad5a2c9455efce28297969a to your computer and use it in GitHub Desktop.
Save YumaInaura/34a1383d4ad5a2c9455efce28297969a to your computer and use it in GitHub Desktop.
Vim — Visual mode word replacement ( selected text only )

Vim — Visual mode word replacement ( selected text only )

Key strokes

  • v
  • Move cursor
  • :
  • s/Bod/David/ ( Replacement statement )
  • Enter

Text example


Alice
Bob
Carol

Alice
Bob
Carol

Alice
Bob
Carol

When cursor is on second Alice

image

v to Start Visual mode

image

Move cursor and select area

image

: colon

image

:'<,'> syntax inputted by automatic.

Input replace statement s/Bod/David

image

Enter to replace

image

Viersions

  • VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug 7 2018 21:58:18)

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment