vim实用功能备忘
2016-07-07 23:40
363 查看
Copyright 2016 by 蔡舒啸 保持署名-非商业性使用-相同方式共享 Creative Commons BY-NC-ND 3.0
目录
使用系统剪贴板
其他程序复制到 vim
vim 到其他程序复制
其他剪贴板
全选
快速移动键盘光标
多行缩进
多余的话
vim 乌干达儿童援助项目
vim-gnome 支持系统剪贴板
vim-gtk 支持系统剪贴板
结论:
1) 如果你是服务器运维, 常年在纯命令行模式下使用系统, 也就根本不存在”系统剪贴板”的需求
2) 如果你使用桌面版Linux 比如 Ubuntu , 请确保卸载了原版 vim 后, 再安装 vim-gnome, 或 vim-gtk
Ubuntu 16.04 64位系统下, 博主亲测可用:
按
按
按ESC进入浏览模式
shift+4 行首
shift+6 行尾
常见于javascript或java中调整代码缩进
渐渐地, 我发现vim不是一无是处,用 vim 时用键盘就能完成大多数命令,这点还是非常先进的。在命令行下,确实只有 vim 相对好用。
知乎上看到的一句话:折腾vim没有想死过3次的人不算会用vim。
深以为然。我在研究生一年级折腾过vim只想死了一次,还差得很远呢。否定之否定, 螺旋上升的认识.
很多现代编辑器 github atom 和 sublime 都有 vim 模式插件,这再一次证明了vim的价值。
About half of the children sponsored through ICCF are in higher education. They do not live and study in Kibaale but go to a boarding school, far away from home. And these studies are tough. Only the best students are accepted and even then they struggle to pass exams. Fortunately we have not had a drop-out in two years.
A good example is Kaweesi Emmanuel. He finished secondary school in Kibaale in 2007, with very good grades. He did A-levels in Masaka and again finished with very good scores, 23 out of 25 points. He then wanted to study law in Kampala. That is a five year study, a big commitment for the sponsor. Fortunately the sponsor agreed. Then there were problems applying for the study, but in September 2010 he could finally start his first year at Makerere university.
After five years of tough studies and the sponsor paying large yearly payments, Emmanuel graduated for the law degree in January 2015. But that’s not the end yet! Another year of Bar course at the Law Development Centre was required. Emmanual has finished this now and the final graduation was April 29th. He is the first lawyer to come out of our sponsorship program!
We are very proud of Emmanuel. He comes from a poor family, sleeping on the floor in a tiny house with no electricity, water or TV.
And now he is a lawyer!
He is an example for other children who sometimes need a bit of motivation for their studies.
目录
使用系统剪贴板
其他程序复制到 vim
vim 到其他程序复制
其他剪贴板
全选
快速移动键盘光标
多行缩进
多余的话
vim 乌干达儿童援助项目
使用系统剪贴板
vim 不支持系统剪贴板vim-gnome 支持系统剪贴板
vim-gtk 支持系统剪贴板
结论:
1) 如果你是服务器运维, 常年在纯命令行模式下使用系统, 也就根本不存在”系统剪贴板”的需求
2) 如果你使用桌面版Linux 比如 Ubuntu , 请确保卸载了原版 vim 后, 再安装 vim-gnome, 或 vim-gtk
Ubuntu 16.04 64位系统下, 博主亲测可用:
sudo apt purge vim sudo apt install vim-gnome vim
其他程序复制到 vim
在其他地方按ctrl C在 vim 中按
Esc再逐个按
",
+,
p三个一个都不能少, 就在键盘光标位置插入了复制的内容.
vim 到其他程序复制
按Esc再按
V, 按方向键移动键盘光标选中一些文字
按
",
+,
y三个一个都不能少, 把选中的内容复制到系统剪贴板. 然后在别的程序按
Ctrl V就能黏贴了.
其他剪贴板
查看 vim 全部剪贴板的内容: 在 vim 中按Esc再按
:reg回车, 可以看到除了
"+外还有名为
"1,
"2, … ,
"9,
"-,
".,
"%,
"/等剪贴板
按
Esc再按
"1y,
"2y, … ,
"9y,
"-y,
".y,
"%y,
"/y就能复制这些内容
全选
按Esc再依次按下
g,
g,
Shift V,
Shift G
快速移动键盘光标
vim打开文件按ESC进入浏览模式
shift+4 行首
shift+6 行尾
多行缩进
按ESC回到浏览模式, 按一次
V, 按方向键(
H,
L,
J,
K)移动光标选中要缩进的行,
Shift+句号向右缩进一个tab
常见于javascript或java中调整代码缩进
多余的话
用过Eclipse, IDEA, Sublime, Atom之后, 我一度偏激的认为, vim 是一个伟大但已经过时的软件.渐渐地, 我发现vim不是一无是处,用 vim 时用键盘就能完成大多数命令,这点还是非常先进的。在命令行下,确实只有 vim 相对好用。
知乎上看到的一句话:折腾vim没有想死过3次的人不算会用vim。
深以为然。我在研究生一年级折腾过vim只想死了一次,还差得很远呢。否定之否定, 螺旋上升的认识.
很多现代编辑器 github atom 和 sublime 都有 vim 模式插件,这再一次证明了vim的价值。
vim 乌干达儿童援助项目
软件应该让世界变得美好, 如果你写的软件做不到, 至少你还能通过助人为乐来帮助这个世界About half of the children sponsored through ICCF are in higher education. They do not live and study in Kibaale but go to a boarding school, far away from home. And these studies are tough. Only the best students are accepted and even then they struggle to pass exams. Fortunately we have not had a drop-out in two years.
A good example is Kaweesi Emmanuel. He finished secondary school in Kibaale in 2007, with very good grades. He did A-levels in Masaka and again finished with very good scores, 23 out of 25 points. He then wanted to study law in Kampala. That is a five year study, a big commitment for the sponsor. Fortunately the sponsor agreed. Then there were problems applying for the study, but in September 2010 he could finally start his first year at Makerere university.
After five years of tough studies and the sponsor paying large yearly payments, Emmanuel graduated for the law degree in January 2015. But that’s not the end yet! Another year of Bar course at the Law Development Centre was required. Emmanual has finished this now and the final graduation was April 29th. He is the first lawyer to come out of our sponsorship program!
We are very proud of Emmanuel. He comes from a poor family, sleeping on the floor in a tiny house with no electricity, water or TV.
And now he is a lawyer!
He is an example for other children who sometimes need a bit of motivation for their studies.
相关文章推荐
- Ubuntu 默认壁纸历代记
- Ubuntu Remix Cinnamon 20.04 评测:Ubuntu 与 Cinnamon 的完美融合
- 关于Ubuntu 11.10启动提示waiting for the network configuration的问题
- 在 Ubuntu 桌面中使用文件和文件夹
- VIM编译器显示TAB和TAB转换为空格
- ubuntu下chrome无法同步问题解决
- 菜鸟说给菜鸟听之VIM--入门篇(1)
- Ubuntu Linux使用体验
- 使用 GNOME 优化工具自定义 Linux 桌面的 10 种方法
- 以Ubuntu 9.04为例 将工作环境迁移到 Linux
- VirtualBox虚拟机XP与宿主机Ubuntu互访共享文件夹
- 从USB安装Ubuntu Server 10.04.3 图文详解
- Ubuntu 15.04 正式版发布下载
- Linux-Ubuntu 10.04安装Cadence-ic610 方法总结图解
- Ubuntu 12.04和Windows 7双系统安装图解
- Ubuntu /home下中文目录如何修改成英文?
- cygwin下vim方向键不好用的解决方案
- 开机出现:grub rescue的修复方法
- Ubuntu连接Android真机调试
- 你应该选择 Ubuntu 还是 Fedora?