Advanced .vimrc config

1, using vundle to manage vim plugins

A detailed introduction from github: https://github.com/VundleVim/Vundle.vim

2, the .vimrc configuration

(PS I’d like to use macvim in mac os. A detailed introduction from github: https://github.com/b4winckler/macvim)

set nocompatible              " be iMproved, required
filetype off                  " required
let mapleader = ','

" 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 'gmarik/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'Lokaltog/vim-easymotion'
" Plugin 'wookiehangover/jshint.vim'
Plugin 'Shutnik/jshint2.vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'pangloss/vim-javascript'
Plugin 'dkprice/vim-easygrep'
Plugin 'jeroenbourgois/vim-actionscript'
Plugin 'tpope/vim-fugitive'
Plugin 'PProvost/vim-ps1'

call vundle#end()
filetype plugin indent on

au Bufread,BufNewFile *.as set filetype=actionscript
nmap <D-F> :Ggrep<Space>
imap <D-F> <ESC>:Ggrep<Space>
nmap <D-V> <ESC>:Voltron<CR>
nmap <D-D> <ESC>:Dashjs<CR>

set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
set number
set cindent
syntax on
set ffs=unix,dos
set hls
set colorcolumn=80
set cursorline

nmap j gj
nmap k gk
nmap <c-j> :cnext<CR>
nmap <c-k> :cprev<CR>


let g:ctrlp_map = ''
let g:ctrlp_cmd = ''
map <c-p> :CtrlP /Users/jiejun.zhang/dev<CR>
map <c-o> <esc>:CtrlPClearAllCaches<CR>

augroup myvimrc
    " Automatically reloads vimrc
    au!
    au BufWritePost .vimrc,_vimrc,vimrc,.gvimrc,_gvimrc,gvimrc so $MYVIMRC |
    if (has('gui_running') && $MYGVIMRC != "") | so $MYGVIMRC | endif
augroup END

function! InitVoltronEnv(...)
    map <c-p> :CtrlP /Users/jiejun.zhang/dev/voltron<CR>
    let g:ctrlp_custom_ignore = '.swf$\|HuluDesktop'
    cd /Users/jiejun.zhang/dev/voltron
    set tabstop=4
    set softtabstop=4
    set expandtab
    set shiftwidth=4
    colo murphy
endfunction

function! InitDashjsEnv(...)
    set ts=2
    set sts=2
    set sw=2
    colo vividchalk
    set background=dark
    map <c-p> :CtrlP /Users/jiejun.zhang/dev/dashjs<CR>
    let g:ctrlp_custom_ignore = '(chromekey_player.js|external.js|core.js|mobile_dp_player.js|mobile_player.js|site_player.js.erb)'
    cd /Users/jiejun.zhang/dev/dashjs
endfunction

function! InitDashLiveEnv(...)
    set ts=2
    set sts=2
    set sw=2
    colo vividchalk
    set background=dark
    map <c-p> :CtrlP /Users/jiejun.zhang/dev/live_player<CR>
    let g:ctrlp_custom_ignore = 'node_modules$\|bower_components$\|build/js\|doc'
    cd /Users/jiejun.zhang/dev/live_player
endfunction

function! InitDeejayEnv(...)
    map <c-p> :CtrlP /Users/jiejun.zhang/dev/deejay<CR>
    let g:ctrlp_custom_ignore = '.pyc$'
    cd /Users/jiejun.zhang/dev/deejay
    colo torte
endfunction

function! InitBanyaEnv(...)
    map <c-p> :CtrlP /Users/jiejun.zhang/dev/theR-banya<CR>
    let g:ctrlp_custom_ignore = '.pyc$'
    cd /Users/jiejun.zhang/dev/deejay
    colo torte
endfunction

command! Voltron call InitVoltronEnv() 
command! Dashjs call InitDashjsEnv() 
command! Live call InitDashLiveEnv() 
command! Deejay call InitDeejayEnv() 
command! Banya call InitBanyaEnv() 
command! JSProp call JSProp()

command! Font1 set guifont=Menlo:h12 | set antialias
command! Font2 set guifont=Consolas:h15 | set antialias
command! Font3 set guifont=Monaco:h14 | set antialias
command! Font4 set guifont=Inconsolata:h16 | set antialias
command! Font5 set guifont=Fixedsys_Excelsior_3.01:h16 | set noantialias
command! Font6 set guifont=Dina-medium:h16 | set noantialias

Font1
set statusline=%{fugitive#statusline()}
set laststatus=2

3, vundle install

lanch vim and run :PluginInstall

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值