Search code examples
vimvisual-studio-codevscodevim

VSCodeVim delete all occurrences containing a pattern


I would like to delete some prefix from all words in document using VSCodeVim plugin. For example:

var someVarOne, someVarTwo, someVarThree;

delete prefix 'some' and get:

var VarOne, VarTwo, VarThree;

Thanks in advance!


Solution

  • Since the substitution methods have already been mentioned, you could try this simple method:

    1. Visually select the word to be replaced (here it's "some") using the v key.
    2. Place multiple cursors at all places where the word "some" has occurred by Ctrl+Shift+L or Cmd+Shift+L keys.
    3. Delete the visually selected parts using d key which stands for delete