I'm comfortable doing search/replace in vim, but how do I delete all lines in a file (or between certain lines) if they match a condition? Currently I shell out and run a sed command, for example:
sed -i '/^CRITICAL/d' hosts
Run Code Online (Sandbox Code Playgroud)
(delete all the lines that start with CRITICAL from the hosts file).
How would I do this in vim?
| 归档时间: |
|
| 查看次数: |
152 次 |
| 最近记录: |