小编sik*_*chu的帖子

是否有一个标志:Vim中的s [ubstitute]不能保存模式?

我正在尝试创建一个autocmd将在我退出插入模式时替换文件中的所有空格.然而,AFAIK会让Vim记住这个模式并删除已经存在的模式.

" Add function for remove tailing whitespaces
command! CleanupTrailingSpaces :%s/\s\+$//ge | :nohlsearch
autocmd InsertLeave * :CleanupTrailingSpaces
Run Code Online (Sandbox Code Playgroud)

是否有一个标志:s[ubstitute]会使它不能保存模式?

regex vim substitution

5
推荐指数
1
解决办法
102
查看次数

标签 统计

regex ×1

substitution ×1

vim ×1