粘贴文本

    粘贴文本自动缩进

    文本操作命令

    文本插入命令

    文本插入相关命令(以 i 开头):

    Key binding Description
    SPC i l l insert lorem-ipsum list
    SPC i l p insert lorem-ipsum paragraph
    SPC i l s insert lorem-ipsum sentence
    SPC i p 1 insert simple password
    SPC i p 2 insert stronger password
    SPC i p 3 insert password for paranoids
    SPC i p p insert a phonetically easy password
    SPC i p n insert a numerical password
    SPC i u Search for Unicode characters and insert them into the active buffer.
    SPC i U 1 insert UUIDv1 (use universal argument to insert with CID format)
    SPC i U 4 insert UUIDv4 (use universal argument to insert with CID format)
    SPC i U U insert UUIDv4 (use universal argument to insert with CID format)

    Increase/Decrease numbers

    In transient state:

    Key Binding Description
    + increase the number under point by one
    - decrease the number under point by one
    Any other key leave the transient state

    Tips: you can increase or decrease a value by more that once by using a prefix argument (i.e. 10 SPC n + will add 10 to the number under point).

    Replace text with iedit

    Two new modes: iedit-Normal/iedit-Insert

    The default color for iedit is red/green which is based on the current colorscheme.

    iedit states key bindings

    State transitions:

    iedit-Normal mode inherits from Normal mode, the following key bindings are specific to iedit-Normal mode.

    Key Binding Description
    Esc go back to mode
    i switch to iedit-Insert mode, same as i
    a switch to iedit-Insert mode, same as a
    I go to the beginning of the current occurrence and switch to iedit-Insert mode
    A go to the end of the current occurrence and switch to iedit-Insert mode
    <Left>/h Move cursor to left
    <Right>/l Move cursor to right
    0/<Home> go to the beginning of the current occurrence
    $/<End> go to the end of the current occurrence
    D delete the occurrences
    S delete the occurrences and switch to iedit-Insert mode
    gg go to first occurrence
    G go to last occurrence
    n go to next occurrence
    N go to previous occurrence
    p replace occurrences with last yanked (copied) text
    <Tab> toggle current occurrence

    In iedit-Insert mode:

    Examples

    注释(Commentings)

    注释(comment)通过下面的工具来处理 nerdcommenter, 它用下面的按键来界定范围.

    Key Binding Description
    SPC ; comment operator
    SPC c h hide/show comments
    SPC c l comment lines
    SPC c L invert comment lines
    SPC c p comment paragraphs
    SPC c P invert comment paragraphs
    SPC c t comment to line
    SPC c T invert comment to line
    SPC c y comment and yank
    SPC c Y invert comment and yank

    多方式编码

    SpaceVim 默认使用 utf-8 码进行编码. 下面是 utf-8 编码的四个设置:

    • fileencodings (fencs): ucs-bom,utf-8,default,latin1
    • fileencoding (fenc): utf-8
    • encoding (enc): utf-8
    • termencoding (tenc): utf-8 (only supported in vim)
      修复混乱的显示: SPC e a 是自动选择文件编码的按键映射. 在选择好文件编码方式后, 你可以运行下面的代码来修复编码: