Vundle - 配置好你的Vim(前端开发)

Vundle

Vundle 是一个 Vim 的插件管理工具,类似于 Bundle 的功能。它可以让你通过配置 .vimrc 文件来安装多个 Vim 插件。

安装 Vundle

Vundle 代码 直接下载到你的 ~/.vim/bundle/ 目录下,通过脚本就是:

$ mkdir -p ~/.vim/bundle
$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

配置 Vundle

其实也是配置你的 Vim 如何起用 Vundle 以及安装哪些 Vim 插件。可以参考 Read Me 文档:https://github.com/VundleVim/Vundle.vim

我的配置文件(前端开发)

重要的东西都在 Plugin 'xxxx/xxxx' 这样的依赖上,只要配置好这些依赖,再重新打开 ~/.vimrc 文件,执行 :PluginInstall 命令,就可以安装 Vim 依赖了,待完成后会有 Done! 字样显示在 Vim 状态栏内。

这是我的 ~/.vimrc 文件全集:

set nocompatible              " be iMproved, required filetype off " required

" set the runtime path to include Vundle and initialize set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() " alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here') " let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" Plugins Plugin 'scrooloose/nerdtree' Plugin 'fholgado/minibufexpl.vim' Plugin 'Shutnik/jshint2.vim' Plugin 'leshill/vim-json' Plugin 'kchmck/vim-coffee-script' Plugin 'mislav/vimfiles' Plugin 'leafgarland/typescript-vim' Plugin 'tpope/vim-markdown' Plugin 'tpope/vim-surround' Plugin 'tpope/vim-fugitive' Plugin 'marijnh/tern_for_vim' Plugin 'Xuyuanp/nerdtree-git-plugin' " All of your Plugins must be added before the following line
call vundle#end()            " required filetype plugin indent on " required
" To ignore plugin indent changes, instead use: "filetype plugin on
" " Brief help
" :PluginList - lists configured plugins " :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache " :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
" " see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line " ------------------------------------------------------------
" Common " ------------------------------------------------------------
syntax on

" ------------------------------------------------------------ " NERDTree
" ------------------------------------------------------------ "NERDTree: autoload when startup vim
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif

"NERDTree: C-n to open NERDTree map <C-n> :NERDTreeToggle<CR> " NERDTree: File highlighting
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
 exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
 exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction

call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515')

" ------------------------------------------------------------ " NERDTree
" ------------------------------------------------------------ 

你可能感兴趣的:(vim,插件)