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. Python学习---线程基础学习

    线程基础 什么是线程(thread) 线程是CPU调度能够进行运算调度的最小单位.它被包含在进程之中,是进程中的实际运作单位.一条线程指的是进程中一个单一顺序的控制流[换言之,线程就是一堆指令集合], ...

  2. Redhat5.9安装qt5.5.1出错error while loading shared libraries:libX11-cxb.so.1 标签: qt5 2017-06-02 11

    出错原因是缺少了共享库libX11-cxb.so.1,是由于系统版本过低所致:重新安装红帽6.5即可解决该问题.

  3. 如果把PNG、JPG、BMP和GIF文件批量转换为ICO文件?

    有时候需要将大量的图片文件(比如PNG.JPG.BMP和GIF文件)批量转换为ICO图标文件,如果一个一个操作,非常费时间.本文将介绍如何用Dr. Folder软件快速批量转换图片文件为ICO图标文件 ...

  4. [原]零基础学习视频解码之安装ffmpeg

    写在文章前面:ffmpeg是一个开源的编解码框架,拥有很强大的功能.但是对于如果使用其来做开发呈现着严重两极分化,大神们讨论着高深的问题,大多数像我这样的小白连门都进不去.最近无意间领会了如何入门,现 ...

  5. (一)自定义ViewGroup绘制出菜单

    从网上学习了hyman大神的卫星菜单实现,自己特意亲自又写了一编代码,对自定义ViewGroup的理解又深入了一点.我坚信只有自己写出来的知识才会有更加好的的掌握.因此也在自己的博客中将这个卫星菜单的 ...

  6. UVa 1658 - Admiral(最小费用最大流 + 拆点)

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  7. sql注入二

    大家早上好!今天由我给大家带来<web安全之SQL注入篇>系列晨讲,首先对课程进行简单介绍,SQL注入篇一共分为三讲:        第一讲:“纸上谈兵:我们需要在本地架设注入环境,构造注 ...

  8. sublime text 插件及快捷键的使用

    安装插件准备步骤: 1.先安装管理插件,插件必备:package control 1.按ctrl+` 调出console 2.在底部代码行粘贴以下代码并回车: import urllib2,os;pf ...

  9. ajax简单做html查询删除(鲜花)

    下载视频+项目链接:https://pan.baidu.com/s/1jUld3-Nqm3fUAzFSX8kjlQ

  10. HDU 1078 FatMouse and Cheese ( DP, DFS)

    HDU 1078 FatMouse and Cheese ( DP, DFS) 题目大意 给定一个 n * n 的矩阵, 矩阵的每个格子里都有一个值. 每次水平或垂直可以走 [1, k] 步, 从 ( ...