Grimoire-
Command
.es

GNU+Linux command memo

vim : vertical selections (and substitutions)

Faire une sélection verticale dans du texte avec vim, et remplacer d’un coup cette portion de texte sur chaque ligne concernée.

To toggle the vertical selection mode, press: CTRL+V

➞ ➞ ➞ (1)
↓↓ (2)
s (3)
<your new text>
1 Use the right arrow to select some characters on the current line
2 Use the down arrow to continue your selection downward (expending the selection to letters of a second line)
3 s triggers the substitution feature which first deletes the selection on each lines, and then allows you to type a new text, ending by an Esc strike which propagates the new text to the other (previously) selected lines.

To finish the substitution, press Esc