Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
/テキストファイル内のすべての文字列「abc」をviで置き換えるには、どの置換コマンドを使用すればよいですか?
/
:1,$ s/?/abc
?上記のスニペットのの代わりに何を使用すればよいですか?
?
慣例による置換区切り文字を別の/ものに変更すると、スラッシュをまったくエスケープする必要がなくなります-
:%s;/;abc;g :%s~/~abc~g :%s!/!abc!g :1,$s?/?abc?g :%s/\//abc/g :1,$sub;/;abc;g
これらはすべて、すべての行で/withの同じ置換を行いabcます。
abc
答えは:%s/\//abc/g私が思う。
:%s/\//abc/g