首先都是通過vundle管理插件的
后附vimrc
window
下載安裝gvim
在vimrc中添加如下
set rtp+=$VIM/vimfiles/bundle/vundle/
call vundle#rc('$VIM/vimfiles/bundle/')
Bundle 'gmarik/vundle'
如果要實(shí)現(xiàn)函數(shù)的跳轉(zhuǎn),記得去下載ctags 并將 ctags.exe
一個(gè)文件 放到vim74目錄下即可
https://sourceforge.net/projects/ctags/files/ctags/5.8/ctags58.zip/download?nowrap
如果要實(shí)現(xiàn)透明請(qǐng)下載vimtweak.dll*
Linux
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
vimrc配置
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
"最大化
autocmd GUIEnter * simalt ~x
"窗口化
"winpos 535 22
"set lines=35 columns=108
"colo peachpuff
"set autoindent
set nu! "設(shè)置行號(hào)
set background=dark
colorscheme molokai "設(shè)置配色方案
syntax on "文件類型偵測(cè)
syntax enable "語法高麗
set nobackup "不生成備份文件
set showmatch "設(shè)置匹配模式
set smartindent "設(shè)置智能對(duì)齊
set ai! "設(shè)置自動(dòng)縮進(jìn)
set fileencodings=utf-8,gbk
set ambiwidth=double "設(shè)置中文支持
set guifont=consolas:h11 "設(shè)置字體及大小
"set guifont=Ubuntu\ Mono:h12
set mouse=a "啟用鼠標(biāo)
"按y鍵復(fù)制克饶,然后點(diǎn)擊要粘貼的地方使用鼠標(biāo)中鍵粘貼
> 'mouse' 選項(xiàng)的字符決定 Vim 在什么場(chǎng)合下會(huì)使用鼠標(biāo):
n 普通模式
v 可視模式
i 插入模式
c 命令行模式
h 在幫助文件里,以上所有的模式
a 以上所有的模式
r 跳過 |hit-enter| 提示
A 在可視模式下自動(dòng)選擇
set softtabstop=4 "一次tab前進(jìn)4個(gè)字符
set expandtab "空格代替tab
set formatoptions+=mM
set hidden "允許為保存時(shí)切換到緩沖區(qū)
set history=1024 "歷史記錄
set helplang=cn "中文幫助\
set wrap "自動(dòng)換行
set linebreak "整詞換行
"set guioptions-=T "隱藏工具欄
set go= "界面無邊框
" 開啟折疊
set foldmethod=indent
set foldlevel=99
nnoremap <space> za "Normal下 空格即可對(duì)代碼進(jìn)行折疊
autocmd FileType php setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120
autocmd FileType ruby setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120
autocmd FileType php setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=120
autocmd FileType coffee,javascript setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=120
autocmd FileType python setlocal tabstop=4 shiftwidth=4 softtabstop=4 textwidth=120
autocmd FileType html,htmldjango,xhtml,haml setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=0
autocmd FileType sass,scss,css setlocal tabstop=2 shiftwidth=2 softtabstop=2 textwidth=12
"補(bǔ)全
filetype plugin on
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType c setlocal omnifunc=ccomplete#Complete
"vundle插件管理
set rtp+=$VIM/vimfiles/bundle/vundle/
call vundle#rc('$VIM/vimfiles/bundle/')
Bundle 'gmarik/vundle'
"ctags set
let Tlist_Show_Menu = 1
set tags=tags;
set autochdir
"tagbar類似taglist 對(duì)面向?qū)ο蟾押?Bundle 'majutsushi/tagbar'
nmap <F8> :TagbarToggle<CR>
"快速搜索
"Bundle 'kien/ctrlp.vim'
"對(duì)齊線 "色塊
Bundle 'nathanaelkane/vim-indent-guides'
"let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_auto_colors = 0
let g:indent_guides_guide_size = 1
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd guibg=#333333 ctermbg=3
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven guibg=#444444 ctermbg=4
map <F3> :IndentGuidesToggle<CR>
"文件夾列表
Bundle 'scrooloose/nerdtree'
let NERDTreeWinPos='left'
let NERDTreeWinSize=30
map <F2> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") &&b:NERDTreeType == "primary") | q | endif
"vim 下方彩色狀態(tài)欄
Bundle 'bling/vim-airline'
set laststatus=2
"php
Bundle 'php.vim'
"透明 針對(duì)window 需要下vimtweak.dll
"Alpha Window
nmap <M-r> :call libcallnr("vimtweak.dll","SetAlpha",215)<cr>
nmap <M-e> :call libcallnr("vimtweak.dll","SetAlpha",255)<cr>
"Maximized Window
map <leader>mw :call libcallnr("vimtweak.dll","EnableMaximize",1)<cr>
map <leader>mW :call libcallnr("vimtweak.dll","EnableMaximize",0)<cr>
"TopMost Window
map <leader>et :call libcallnr("vimtweak.dll","EnableTopMost",1)<cr>
map <leader>eT :call libcallnr("vimtweak.dll","EnableTopMost",0)<cr>
nnoremap ; :
:command W w
:command WQ wq
:command Wq wq
:command Q q
:command Qa qa
:command QA q