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

rus*_*ush 6 vim

我有一个带有字符串的文件:

 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
Run Code Online (Sandbox Code Playgroud)

我只需要在第 9,11,13,15 行编辑地址。我只是好奇,vim 中是否有任何简单的技巧(例如仅选择此行并在选定范围内替换)来做到这一点?或者我应该记录一个宏并将其应用于我需要的字符串。

Ida*_*rye 1

有一个插件可以让您拥有“多个光标”。我自己没有尝试过,但你应该检查一下它是否解决了你的问题:

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