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.
最後の行の後にvi(m)のファイルのすべての行を2倍にするにはどうすればよいですか?
例:
foo bar hello world
結果:
foo bar hello world foo bar hello world
コピー/貼り付けコマンドを試しましたが、結果はありません。
エスケープモードでは、次のことができます。
1G yG G p
あなたはこれを試すことができます
gg :s/\_.*/&&
次のコマンドでうまくいくはずです
:%s/\(.*\)/\1\1/
1GyGP
最初の行の最初の文字に移動し、ファイル全体をヤンクして上に挿入します。