LoginSignup
1
2

More than 5 years have passed since last update.

vimで複数行に渡る同じ列の情報をサクッと置き換えるメモ

Posted at

複数行に渡る情報を一気に置き換える方法のメモです。

使用例

以下のクエリ内にある'testXX'を全て、'test start'のように変換させたい時に便利です。(%sでの置き換えが面倒な時なども)

insert into (id, value) into ('0001', 'test開始');
insert into (id, value) into ('0001', 'test終了');
insert into (id, value) into ('0001', 'test開始');
insert into (id, value) into ('0001', 'test終了');

<Ctrl-v>で短形選択し、開始終了にフォーカスがあるように選択

短形選択.jpg

cで挿入モード

cで挿入.jpg

’ start’を入力

入力.jpg

escで終了

escで終了.jpg

これで置き換え完了!
定形外の作業で1度きりのようなところで使う想定です。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2