vimrc 记录

set ts=4
set expandtab
set autoindent
set tabstop=4
set smartindent
set shiftwidth=4


inoremap ( ()i
inoremap [ []i
inoremap { {}O
autocmd Syntax html,vim inoremap < >i| inoremap > =ClosePair('>')
inoremap ) =ClosePair(')')
inoremap ] =ClosePair(']')
inoremap } =CloseBracket()
inoremap " =QuoteDelim('"')
inoremap ' =QuoteDelim("'")


function ClosePair(char)
    if getline('.')[col('.') - 1] == a:char
    return "\"
    else
    return a:char
    endif
    endf


function CloseBracket()
    if match(getline(line('.') + 1), '\s*}') < 0
    return "\}"
    else
    return "\j0f}a"
    endif
    endf


function QuoteDelim(char)
    let line = getline('.')
    let col = col('.')
    if line[col - 2] == "\\"
    return a:char
    elseif line[col - 1] == a:char
    return "\"
    else
    return a:char.a:char."\i"
    endif
    endf>>]])))>>>))))>)]))>)>>)>>)>>)>>)>>)>>>>>>}}>]]>))

你可能感兴趣的:(vim)