我比较喜欢这个脚本,chmod +x name就可以了,然后vim就变成了我想要的了。
#!/bin/bash
#
# Configure vim...
#
rm -f ~/.vimrc
echo "\
\"
\" Just copy this text document to ~/.vimrc for setting vim
\"
set nu
set cursorline
set tabstop=4
set shiftwidth=4
set autoindent
set cindent
set hlsearch
set incsearch
set bg=dark
set history=1024
set wrap
\"set nowrap
set laststatus=2
set showcmd
set smartcase
set gcr=a:blinkon0
filetype plugin indent on
\"set statusline=%<%F%h%m%r%h%w%y\ %=\ line:%l\,%L\ %P
set statusline=%<%F%h%m%r%h%w%y\ %{&ff}\ %{strftime(\\\"%d/%m/%y\ -\ %H:%M\\\")}%=\ ascii:%b\ lin:%l\,%L\ %P\
:inoremap ( ()<ESC>i
:inoremap ) <c-r>=ClosePair(')')<CR>
:inoremap { {}<ESC>i
:inoremap } <c-r>=ClosePair('}')<CR>
:inoremap [ []<ESC>i
:inoremap ] <c-r>=ClosePair(']')<CR>
:inoremap < <><ESC>i
:inoremap > <c-r>=ClosePair('>')<CR>
function ClosePair(char)
if getline('.')[col('.') - 1] == a:char
return \"\<Right>\"
else
return a:char
endif
endf
" >> ~/.vimrc
echo ">>> Configure vim successful. <<<"