Vim tutor 初学

VIMTutor


Linux VIMvitutor

  1. 上下左右jkhl
  2. exit: :q,:wq,:q!
  3. edit: a(append), i(inset)
  4. delete:
    dw (aword) dd(cur line) d$(cursor to the end of current line) d2w(delete 2 words) d2e(delete 2 words ending) 0(start of current line)
    2dd delete two lines
    x (delete one character)
    w (move to the start of next word) e(move to the end of next word)
  5. undo: u(undo last time) U(undo in current line) ctrl+R(recover undo)
  6. p (put)
    7.r’x’(use ‘x’ to replace character original)
  7. ce(change from current character to the end of word) c$(change from current character to the end of line)
  8. CTRL+G (current location) gg(start of the file) G(end of the file) num G(jump to the line of num)
  9. / (search from up to bottom)
    ?(search from bottom to up) use n to next match; N to previous match
    % (jump to the match bracket.)
  10. 😒/old/new (replace old to new)
    😒/old/new/g( replace all old to new in current line)
    :num1,num2s/old/new/g (replece all old to new between row num1 and row num2)
    :%s/old/new/g (replece all old to new in whole file)
    :%s/old/new/gc (replece all old to new in whole file, need confirm)
    12 :!command (execute command. eg. :!ls)
    13 v (select and highlight)
    14 :w filename(write to filename)
    15 :r file (merging file content to current cursor)
    :r comand output(reads the output of the dir command and puts it below the cursor)
    :e file (edit file)
    16 o (open a new line below) O (open a new line above)
    a (append after cursor) A (append after current line)
    i (insert current cursor) I (insert at the beginning of current line)
    17 R (replace insert one character and delete one character at same time)
    18 v(select text)+y(copy)+p(put == paste)
    j$(jump to next line)
    19 :set ic(ignore case when search) :set noic(cancel ignore case set)
    :set hls is(highlight when search and show all searched)
    20 :help (help window; use ctrl+w to jump to another window)
    :help command/page
    21 :e ~/.vimrc(enable vim feature)
    (:help vimrc-intro)
    22 :set nocp (set completible) ctrl+d(show list) tab(complete command)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值