を検索と置換:Vimの:私は、次のファイル持っている長い文字列
[Unit]
Description=Gunicorn server for superlists-staging.ottg.eu
[Service]
Restart=on-failure
User=elspeth
WorkingDirectory=/home/elspeth/sites/superlists-staging.ottg.eu/source
ExecStart=/home/elspeth/sites/superlists-staging.ottg.eu/virtualenv /bin/gunicorn \
--bind unix:/tmp/superlists-staging.ottg.eu.socket \
superlists.wsgi:application
[Install]
WantedBy=multi-user.target
を、私はすぐに文字列全体を入力せずに「mysite.com」と「superlists-staging.ottg.eu」を交換したいです」 superlists-staging.ottg.eu "(次回に200文字の文字列があるとします)。私は知っている:
:%s/foo/bar/g
しかし、それは完全な文字列を入力する必要があります。これは可能ですか?
あなたの提案は驚きをもたらす可能性が.. – Kent
'。*'を意味しますか?まあ、それは正規表現なので、人々はそれらについて知る必要があります.....ほとんどの場合、書くほうが速いです。 ...大丈夫、私はそれを変更します。 – steffen
貪欲な '。*'だけでなく、マクロも。 Opの例では、すべての「スーパーリスト...」を置き換える必要はありません。あなたのマクロは期待以上のものを取り除くかもしれません。とにかく、私はあなたが具体的なコードではなく、その方法を示していたと信じています。だから大丈夫です。 – Kent