博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何在vim中全部替换_在Vim中,如何在视觉选择中进行搜索和替换?
阅读量:2517 次
发布时间:2019-05-11

本文共 708 字,大约阅读时间需要 2 分钟。

如何在vim中全部替换

Search and replace in the whole text in Vim can be done by :%s/from/to/gc. But how to search and replace in visual selection only?

在Vim中搜索和替换全文可以通过:%s/from/to/gc 。 但是,如何仅在视觉选择中进行搜索和替换?

The %V atom in Vim restricts a pattern so that it matches only inside the visual selection.

Vim中的%V原子限制了模式,因此它仅在视觉选择内匹配。

So, your for searching and replacing only in the visual selection can be

因此,仅在视觉选择中用于搜索和替换的可以是

:%s/%Vfrom/to/gc

In addition, you can use marks for the beginning and end of the visual selection as the ,end range for the :s command:

另外,可以将标记用于视觉选择的开始和结束,作为:s命令的 ,end范围:

'<  start line`<  start character'>  end line`>  end character
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自:

如何在vim中全部替换

转载地址:http://bqlwd.baihongyu.com/

你可能感兴趣的文章
mac中将jmeter源码导入idea
查看>>
bootstrap table 标题列重复
查看>>
Python shutil 模块
查看>>
ruby 字符串学习笔记1
查看>>
local mysql and postgresql
查看>>
浙大pat 1025题解
查看>>
Python列表的深浅复制
查看>>
XXE注入攻击与防御
查看>>
js获取当前域名
查看>>
bare linefeeds received in ASCII mode
查看>>
PAT1101:Quick Sort
查看>>
Objective-C 高级编程:iOS与OS X多线程和内存管理
查看>>
Lambda表达式及其优势 [转]
查看>>
nghttp2 和nginx的实践
查看>>
清除eclipse项目中没用的图片、js、css代码
查看>>
鼠标拖拽和吸附功能
查看>>
winform关闭窗口
查看>>
php自定义验证码图片大小且可点击图片刷新验证码
查看>>
(中等) POJ 1436 Horizontally Visible Segments , 线段树+区间更新。
查看>>
Android用AutoCompleteTextView实现搜索历史记录提示
查看>>