博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
VIM Commands
阅读量:6236 次
发布时间:2019-06-22

本文共 2171 字,大约阅读时间需要 7 分钟。

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

转载于:https://www.cnblogs.com/computing-n-design/p/7907248.html

你可能感兴趣的文章
TP 3.2.3 接入PHPMailer
查看>>
gcc降版本方法 - [学习]
查看>>
使用正则表达式,取得点击次数,函数抽离
查看>>
TensorFlow学习---入门(一)-----MNIST机器学习
查看>>
[LeetCode] Reverse Words in a String II
查看>>
[LeetCode] Find Peak Element
查看>>
appium ios环境搭建——iOS开发环境搭建
查看>>
20155222卢梓杰 课堂测试ch06补做
查看>>
20155222卢梓杰 实验五 MSF基础应用
查看>>
android分析之Thread类
查看>>
【总结整理】WebGIS基础
查看>>
linux(一)export的生命周期
查看>>
[转载].NET开发常用的10条实用代码
查看>>
用邻接表实现DFS和BFS
查看>>
PHP实现自己活了多少岁
查看>>
安装 Ruby, Rails 运行环境 常见的错误
查看>>
eclipse 自动提示不出来
查看>>
Java 开发 2.0: 现实世界中的 Redis
查看>>
并查集——新手学习记录
查看>>
杭电Acm-1010,1016,1240解题心得
查看>>