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.
我有一个以“empty_space\n”结尾的文本文件
...{empty_space} ...{empty_space}
我想删除最后的空格可以这么说。
... ...
我怎样才能做到这一点?
尝试这个:
:%s/\v\s+$//
:
%
s
/
\v
\s
+
$
:%s/ $//应该管用。
:%s/ $//
让我分解一下
:<- 命令模式
%s找到每个出现
%s
然后是要匹配和替换的正则表达式。