Vim Commands

Commands in NORMAL modes

Motions

small granular: move by direction

k
h l
j

mid granular: move by word

  • e move onto the end of the current word
  • b move onto the head of the current word
  • w move onto the head of the next word

    large granular: move by line

  • $ move onto the head char of the line
  • 0 move onto the tail char of the line

    huge granular: move by paragraph

  • { move onto the last blank line
  • ( move onto the begnning of this paragraph
  • } & ) move onto the next blank line

    extreme granular: move by file

  • [line number]G move to the specific line
  • gg move to the first line of the file
  • G move to the last line of the file

Operators

Operators make effects on the corpus when assigned to some range (defined by cursor movement or the object). Operator could be doubled to work on the current line
{Operator} + {Motions} OR {Object} = Operation

  • d delete
  • daw aw for a word(defined by space)
  • dap ap for a whole paragraph(defined by blank line)
  • y yank into register
  • c change
  • g~ swap case
  • gu make lowercase
  • gU Make uppercase
  • > shift right
  • < shift right
  • = auto indent
  • ! filter {Motion} lines through an external program

Undo Tasks

  • u undo one certain operation
    (one editing command in normal mode, all editing in insert mode last time)
  • Ctrl-r for redo one task

Special Command g

Begin Editing

into INSERT mode

  • i begin inserting at current position
  • a begin inserting at the next position
  • A begin inserting at the end of the line
  • o begin inserting at the beginning of the new line below
  • O begin inserting at the beginning of the new line above
  • s delete the current char & begin inserting
  • S delete the current line & begin inserting at the head of current line
  • C delete the rest of current line & begin editing

    local modification

  • r character replacement (quit insert mode after one char modification)
  • D delete the rest of the line
  • J combine this line and the next

Copy and Paste

  1. 删除的文本将储存在寄存器中
  2. p 将寄存器的内容放在光标下方的行

f{char} find the next occurence of {char}
; repeat the last search operation

Command in INSERT modes

Delete in insert mode

  • Ctrl-h Backspace
  • Ctrl-w delect back one word
  • Ctrl-u delect back to start of line

VIM Commands的更多相关文章

  1. 130+ essential vim commands

    Basics :e filename Open filename for edition :w Save file :q Exit Vim :q! Quit without saving :x Wri ...

  2. Rare But Powerful Vim Commands.

    @1: We all know about :wq, but we usually ignore :x. :x和:wq都是保存当前文件并退出. 这两个命令实际上并不完全等价,当文件被修改时两个命令时相 ...

  3. 跟我一起学习VIM

    跟我一起学习VIM - The Life Changing Editor   前两天同事让我在小组内部分享一下VIM,于是我花了一点时间写了个简短的教程.虽然准备有限,但分享过程中大家大多带着一种惊叹 ...

  4. 跟我一起学习VIM - The Life Changing Editor

    前两天同事让我在小组内部分享一下VIM,于是我花了一点时间写了个简短的教程.虽然准备有限,但分享过程中大家大多带着一种惊叹的表情,原来编辑器可以这样强大,这算是对我多年来使用VIM的最大鼓舞吧.所以分 ...

  5. Vim插件之Command-T使用问题

    最近在使用vim插件CommandT时出现问题其实就是vim没有支持ruby,不过google之后找到了解决方法,老外的态度还是很让人敬佩的,度娘搜索的结果太让人呕心了.. 贴下,以后再次遇到解决. ...

  6. 【转载】跟我一起学习VIM - vim插件

    目录 写在前面:Life Changing Editor 什么是VIM 为什么选VIM 为什么选其它 为什么犹豫选择它们 VIM >= SUM(现代编辑器) 如何学习VIM 一秒钟变记事本 VI ...

  7. (转载)跟我一起学习VIM - The Life Changing Editor

    原文: http://ju.outofmemory.cn/entry/79671 前两天同事让我在小组内部分享一下VIM,于是我花了一点时间写了个简短的教程.虽然准备有限,但分享过程中大家大多带着一种 ...

  8. (转) 共享个很棒的vim配置

    发现了一个很棒的vim配置方法,现在共享给大家. https://github.com/kepbod/ivim   ivim - The Vim Distribution of Xiao-Ou Zha ...

  9. 跟我一起学习VIM - vim插件合集

    2016-06-14 15:04 13333人阅读 评论(0) 收藏 举报 分类: Linux(104)  目录(?)[+]  前两天同事让我在小组内部分享一下VIM,于是我花了一点时间写了个简短的教 ...

随机推荐

  1. [徐培成系列实战课程]docker篇

    [徐培成系列实战课程]docker篇 如何利用docker快速构建Spark独立模式的集群 1.介绍 利用docker容器技术快速构建跨节点的独立模型的Spark大数据集群.Spark是时下非常热门的 ...

  2. Hadoop学习---Ubuntu中hadoop完全分布式安装教程

    软件版本 Hadoop版本号:hadoop-2.6.0-cdh5.7.0: VMWare版本号:VMware 9或10 Linux系统:CentOS 6.4-6.5 或Ubuntu版本号:ubuntu ...

  3. 二叉树的二叉链表存储结构及C++实现

    前言:存储二叉树的关键是如何表示结点之间的逻辑关系,也就是双亲和孩子之间的关系.在具体应用中,可能要求从任一结点能直接访问到它的孩子. 一.二叉链表 二叉树一般多采用二叉链表(binary linke ...

  4. 学习Road map Part 03 编程和算法

    方法: 优先重复已学过的内容 写学习笔记

  5. LambdaToSql(轻量级ORM) 入门篇 开源项目

    为什么开发(背景) 最开始使用的是 sqlDbHelper,有微软的,有自己写的. 后来开始使用比较成熟的框架开发,使用过一段时间的Hibernate,后期主要使用 Entity FrameWork. ...

  6. ERROR Review:Unsupported major.minor version 52.0

    最近将AS从2.1.2升级至2.2版本后,项目编译报出了如下错误: java.lang.UnsupportedClassVersionError: com/android/build/gradle/L ...

  7. 入门学习webpack笔记

    注意事项: 1.预热知识:前端模块化.commonJS最好提前了解.commonJS语法最好熟悉. 2.commonJS中,module表示当前模块,module.exports(或者exports) ...

  8. 关于PHP数组你应该知道的事情

    (1).PHP数组的遍历顺序 先举个栗子: <?php $arr['a'] = '123'; $arr['b'] = '456'; $arr['c'] = '789'; foreach($a a ...

  9. c#用链表来存储并读取写好的配置文件

    别用arraylist,效果没有list好(因为要装箱拆箱,所以会影响性能) 使用list,那我们就来先声明一个List 1) 声明 List<元素类型> myList = new Lis ...

  10. 使用@SuppressWarnings("unchecked")消除非受检警告

    使用泛型编程时,会遇到许多编译器警告,如:非受检强制转化警告,非受检方法调用警告,非受检普通数组创建警告,费受精转换警告.这次的内容就是遇到这些警告的时候你该怎么办 PS:非受检警告就是代码上黄色的感 ...