mac下安裝vim
brew install vim
我的一些vim配置信息
" 顯示行號(hào)
set number
" 啟用鼠標(biāo)
set mouse=a
" 顯示標(biāo)尺
set ruler
" 歷史紀(jì)錄
set history=1000
" 輸入的命令顯示出來(lái),看的清楚些
set showcmd
" 狀態(tài)行顯示的內(nèi)容
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
" 啟動(dòng)顯示狀態(tài)行1,總是顯示狀態(tài)行2
set laststatus=2
" 語(yǔ)法高亮顯示
syntax on
set fileencodings=utf-8,gb2312,gbk,cp936,latin-1
set fileencoding=utf-8
set termencoding=utf-8
set fileformat=unix
set encoding=utf-8
" 配色方案
colorscheme desert
" 指定配色方案是256色
set t_Co=256
set wildmenu
" 去掉有關(guān)vi一致性模式,避免以前版本的一些bug和局限,解決backspace不能使用的問(wèn)題
set nocompatible
set backspace=indent,eol,start
set backspace=2
" 啟用自動(dòng)對(duì)齊功能,把上一行的對(duì)齊格式應(yīng)用到下一行
set autoindent
" 依據(jù)上面的格式,智能的選擇對(duì)齊方式,對(duì)于類似C語(yǔ)言編寫很有用處
set smartindent
" vim禁用自動(dòng)備份
set nobackup
set nowritebackup
set noswapfile
" 用空格代替tab
set expandtab
" 設(shè)置顯示制表符的空格字符個(gè)數(shù),改進(jìn)tab縮進(jìn)值,默認(rèn)為8,現(xiàn)改為4
set tabstop=4
" 統(tǒng)一縮進(jìn)為4,方便在開(kāi)啟了et后使用退格(backspace)鍵,每次退格將刪除X個(gè)空格
set softtabstop=4
" 設(shè)定自動(dòng)縮進(jìn)為4個(gè)字符,程序中自動(dòng)縮進(jìn)所使用的空白長(zhǎng)度
set shiftwidth=4
" 設(shè)置幫助文件為中文(需要安裝vimcdoc文檔set helplang=cn
" 顯示匹配的括號(hào)
set showmatch
" 文件縮進(jìn)及tab個(gè)數(shù)
au FileType html,python,vim,javascript setl shiftwidth=4
au FileType html,python,vim,javascript setl tabstop=4
au FileType java,php setl shiftwidth=4
au FileType java,php setl tabstop=4
" 高亮搜索的字符串
set hlsearch
" 檢測(cè)文件的類型
filetype on
filetype plugin on
filetype indent on
" C風(fēng)格縮進(jìn)
set cindent
set completeopt=longest,menu
" 功能設(shè)置
" 去掉輸入錯(cuò)誤提示聲音
set noeb
" 自動(dòng)保存
set autowrite
" 突出顯示當(dāng)前行
set cursorline
" 突出顯示當(dāng)前列
set cursorcolumn
"設(shè)置光標(biāo)樣式為豎線vertical bar
" Change cursor shape between insert and normal mode in iTerm2.app
"if $TERM_PROGRAM =~ "iTerm"
let &t_SI = "\<Esc>]50;CursorShape=1\x7" " Vertical bar in insert mode
let &t_EI = "\<Esc>]50;CursorShape=0\x7" " Block in normal mode
"endif
" 共享剪貼板
set clipboard+=unnamed
" 文件被改動(dòng)時(shí)自動(dòng)載入
set autoread
" 頂部底部保持3行距離
set scrolloff=3
" .vimrc 中添加配置使管家生效:
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
call vundle#end()
filetype plugin indent on
" 使用vundle安裝插件:
" let Vundle manage Vundle, required
" Plugin 'VundleVim/Vundle.vim'
" Plugin 'tpope/vim-surround'
" Plugin 'scrooloose/nerdtree'
Plugin 'Lokaltog/vim-powerline'
Plugin 'valloric/youcompleteme'
Plugin 'yggdroot/indentline'
Plugin 'jiangmiao/auto-pairs'
"""""""""""plugin configuration"""""""""""""""""""
"NERDTree
"F2開(kāi)啟和關(guān)閉樹(shù)"
map <F2> :NERDTreeToggle<CR>
let NERDTreeChDirMode=1
""顯示書(shū)簽"
let NERDTreeShowBookmarks=1
"設(shè)置忽略文件類型"
let NERDTreeIgnore=['\~$', '\.pyc$', '\.swp$']
""窗口大小"
let NERDTreeWinSize=25
"indentLine
"縮進(jìn)指示線"
let g:indentLine_char='|'
let g:indentLine_enabled=1
移除安裝
cd ~ && rm -rf .vim .vimrc .vimrc.bundles && cd -