VIM Commands

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值