VIM学习笔记

USING VIM

2003-02-15
==========================================

Tips in Programing
    Quickly Find The Object
        /
        *
        %
        [{
        gb
        m    using mark
        using tag files

    Automatic Completion
        ^N
    Automatic Indent
        :set cindent
        :set autoindent


Compiling Program
    About Compilition:
        make {arguments}
        cfile
        clist
        clist!

        cc
        cc nr
        cnext
        cprevious
        cfirst
        clast
        crewind
       
    About Indent:
        set autoindent
        Ctrl+D
        Ctrl+T
        >>
        <<
        set shiftwidth
        set tabstop
        set list
        set cindent    indent for c language

    Special Search:
        %    search the match (,[,{,<
        :set showmatch

Edit Mutipile Files
    edit    open a file.
    write [>>]    append to a exist file.
    file    rename the current file.
    saveas
   
    args    list the opened file names; change the list of opened file names.

    next
    previous
    first
    last
    wnext
    wprevious
   
EX Commands
    read    r    [eg] 180r /home/tim/data
    write    w    [eg] 1,10w newfile
                340,$w >> newfile
    copy    co
    delete    d
    move    m    [eg] 226,$m.-2
    edit    e
   
    q
    x

    g    [eg] 60,124g/pattern/p
    s    [eg] s/oldstr/newstr

    args
    set number
    set nonumber
    set autoindent

Custom VI
    Format
        :set option
        :set nooption
    About File:
        .exrc

    Usefull Options
        :set autoindent
        :set showmatch
        :set tabstop
        :set shiftwidth
        :set number
        :set list

        :set autowrite
        :set all

        :set wrapmargin = 10

        :set incsearch

Using Mutipile Window
    sp[lit]        split current window
    new        create a new window
    clo[se]        close current window
    res[ize]    resize current window

    ^w^w        shift from one window to another
    qa
    wqa
    wa
    xa

Completion Commands
    Commands in Command Line
        ^D
        Tab
        ^N
        ^P

    Commands in Insert Mode
        ^N
        ^P
       
Visual Mode
    v
    V    line selection
    ^v    region selection

Include Files Search
    [i
    [I
    [^i
    ^wi

Invoke Unix Commands
    :!{command}
    :sh
    Ctrl+d

    :r !date

    Using filer, you can use Unix commands to operate current text
content.
        :{range}![!]{filter}
        !{motion}{filter}
            [eg]    :23,34!sort
                :4!!sort
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值