加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

vim一次选择/编辑多个非连续行

发布时间:2020-12-15 21:06:42 所属栏目:安全 来源:网络整理
导读:我有一个包含字符串的文件: 8 deb http://ftp.de.debian.org/debian/ stable main contrib non-free 9 deb http://ftp.de.debian.org/debian/ stable main contrib non-free10 deb http://ftp.de.debian.org/debian/ testing main contrib non-free11 deb h
我有一个包含字符串的文件:

8 deb http://ftp.de.debian.org/debian/ stable main contrib non-free
 9 deb http://ftp.de.debian.org/debian/ stable main contrib non-free
10 deb http://ftp.de.debian.org/debian/ testing main contrib non-free
11 deb http://ftp.de.debian.org/debian/ testing main contrib non-free
12 deb http://ftp.de.debian.org/debian/ sid main contrib non-free
13 deb http://ftp.de.debian.org/debian/ sid main contrib non-free
14 deb http://ftp.de.debian.org/debian/ experimental main contrib non-free
15 deb http://ftp.de.debian.org/debian/ experimental main contrib non-free

我只需要在第9,11,13,15行编辑地址.
我只是好奇,在vim中有没有任何简单的黑客(比如只选择这一行并在所选范围内替换)?
或者我应该录制宏并将其应用于我需要的字符串.

解决方法

有一个插件,允许您拥有“多个游标”.我自己没试过,但是你应该看看它是否能解决你的问题:

http://www.vim.org/scripts/script.php?script_id=4523

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读