微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

VIM可以做这个Sublime技巧吗?

我想编辑此文本:

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次

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐