vim common usage

1, replacing

1.1 basis

The format is::[range]s/pattern/string/[c,e,g,i]

can range values:

  • n, $ - n-th row to the last row
  • ., $ - the current line to the last line
  • % - each row

option possible values:

  • c confirm, Ask before each replacement.
  • e is not displayed error.
  • g globe, without asking, replace a line.
  • i ignore not case-sensitive.

2, multi-window editing

  • Divided up and down the window - :split [文件]

  • About dividing window - :vsplit [文件]

  • Window switch:

    1. ctrl + wj moved downwardly
    2. ctrl + wk moved upwardly
    3. ctrl + wh leftward
    4. ctrl + wl move right
    5. ctrl + wt moved to the top of
    6. ctrl + wb mobile terminal in the end
    7. Ctrl + w + r: right or downward exchange window, and Ctrl + w + R and the direction opposite to it.
    8. Ctrl + w + x: exchange positions with counterparts column or window. vim with its default next window position switching current window, if no window below, and then try to exchange a position on a window. Before this command can also add the number, location and windows exchange developed.

Reproduced in: https: //www.jianshu.com/p/7ab3e74ea0dd

Guess you like

Origin blog.csdn.net/weixin_34192732/article/details/91107851