- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2019-04-19T09:01:46+09:00","default:ryuichi","ryuichi")
#author("2019-04-19T09:23:58+09:00","default:ryuichi","ryuichi")
* argsコマンドで複数ファイルを一括置換 [#c9264c84]
** argsコマンドで複数ファイルを一括置換 [#wbc833e5]
:args **/*.txt
:args **/*.txt (1) 階層下のすべての.txtファイルをarglistに追加
:args (2) arglistを確認
:argdo %s/foo/bar/g | update (3) arglistのファイルに対して置換と保存コマンド(%s/foo/bar/g | update)を実行
** arglistのファイルの変更を保存 [#heefc295]
:args **/*.txt (1) 階層下のすべての.txtファイルをarglistに追加
:argdo %s/foo/bar/g (2) arglistのファイルに対して置換コマンドを実行(保存はしない)
:argdo update (3) 2の置換の変更を保存する
** arglistのファイルの変更をundoする [#ud949c00]
:args **/*.txt (1) 階層下のすべての.txtファイルをarglistに追加
:argdo %s/foo/bar/g (2) arglistのファイルに対して置換コマンドを実行
:argdo undo (3) 2の置換の変更をundoする
** arglistを確認 [#odac9746]
:args
:argdo %s/foo/bar/g | update
** arglistにファイルを追加 [#s537d256]
:argadd 1.txt
** arglistからファイルを削除 [#d067e828]
:argdelete 2.txt
*** arglistからすべてのファイルを削除 [#kc048f1d]
:argdelete *
** 参考 [#wd8a36bb]
- https://vim-jp.org/vimdoc-ja/usr_26.html
- https://vimcasts.org/episodes/using-argdo-to-change-multiple-files/