我想编辑此文本:
Aenean vel sem bibendum,eleifend odio a,dictum nibh. The third word in the above line is Morbi eget est vitae quam ultricies porta vitae quis nunc. The third word in the above line is Praesent accumsan ex a laoreet cursus. The third word in the above line is Quisque efficitur lectus at dolor mollis,sit amet tristique libero lobortis. The third word in the above line is
到本文:
Aenean vel sem bibendum,dictum nibh. The third word in the above line is sem Morbi eget est vitae quam ultricies porta vitae quis nunc. The third word in the above line is est Praesent accumsan ex a laoreet cursus. The third word in the above line is ex Quisque efficitur lectus at dolor mollis,sit amet tristique libero lobortis. The third word in the above line is lectus
用Sublime做到这一点
Select repeated part ALT+F3 UpArrow HOME 3 x CTRL+RightArrow CTRL+Shift+LeftArrow CTRL+C DownArrow END CTRL+V
在许多情况下,这个技巧非常有用.
VIM能做到吗?
解决方法
它应该可以轻松地与宏.如果您将光标放在第一行的第一个字符上,那么:
qq:开始录制名为q的宏
2w:提前两个字
yw:猛的(复制)字
j $:跳到下一行并转到行尾
p:粘贴你猛拉的东西
:开始下一行
问:停止录制宏.
3 @ q:执行宏命名为q 3次