vimrc 配置参考

syntax on
filetype off

" format and user interface
set nocompatible
set number
set softtabstop=4 tabstop=4 shiftwidth=4
set expandtab
set autoindent
set hlsearch
set mouse=a 
set cursorline
set cursorcolumn
set laststatus=2
set backspace=2

" initialize vundle
if !isdirectory(expand("~/.vim/bundle/vundle/.git"))
    !git clone https://github.com/gmarik/vundle ~/.vim/bundle/vundle
endif
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" feature bundles
Bundle 'gmarik/vundle'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/nerdcommenter'
Bundle 'jistr/vim-nerdtree-tabs'
Bundle 'kien/ctrlp.vim'
Bundle 'majutsushi/tagbar'
Bundle 'ervandew/supertab'
Bundle 'tpope/vim-fugitive'
Bundle 'tpope/vim-surround'
Bundle 'scrooloose/syntastic'
Bundle 'bling/vim-airline'
Bundle 'editorconfig/editorconfig-vim'
Bundle 'mattn/emmet-vim'
" file type bundles
Bundle 'kchmck/vim-coffee-script'
Bundle 'derekwyatt/vim-scala'
Bundle 'Glench/Vim-Jinja2-Syntax'
Bundle 'sophacles/vim-bundle-mako'
Bundle 'othree/html5.vim'
Bundle 'sprsquish/thrift.vim'
Bundle 'tonyseek/rust.vim'
Bundle 'cakebaker/scss-syntax.vim'
Bundle 'wavded/vim-stylus'
Bundle 'jansenm/vim-cmake'
Bundle 'vim-ruby/vim-ruby'
Bundle 'tfnico/vim-gradle'
Bundle 'cespare/vim-toml'
Bundle 'evanmiller/nginx-vim-syntax'
" theme bundles
Bundle 'tomasr/molokai'

" key mapping
let mapleader=","
imap jk <ESC>
imap Jk <ESC>
imap JK <ESC>
imap jK <ESC>
nmap 1 ^
nmap 0 $
nmap <Leader>tb :TagbarToggle<CR>
nmap <Leader>tt :NERDTreeToggle<CR>
nmap <Leader>nt :tabnew<CR>
nmap <TAB> :tabn<CR>
nmap <C-J> <C-W>j<C-W>_
nmap <C-K> <C-W>k<C-W>_
nmap <C-L> <C-W>l<C-W>_
nmap <C-H> <C-W>h<C-W>_
nmap ;ntr :NERDTree<CR>

" custom commands
com! FormatJSON %!python -m json.tool

" configurations of plugins
let g:nerdtree_tabs_open_on_console_startup = 0
let g:nerdtree_tabs_open_on_gui_startup = 0
let g:airline_powerline_fonts = 1
let g:airline_theme = 'jellybeans'
let NERDTreeIgnore = ['\.py[oc]$', '__pycache__', '\.egg-info']
let g:ctrlp_custom_ignore = 'node_modules\|pyc\|git\|__pycache__'
let g:tagbar_ctags_bin='/usr/bin/ctags'
let g:ctrlp_use_caching = 1
let g:ctrlp_working_path_mode = 0
let g:syntastic_cpp_compiler_options = ' -std=c++11'
let g:syntastic_java_javac_config_file_enabled = 1
let g:loaded_syntastic_rst_rst2pseudoxml_checker = 1
let g:jinja_syntax_html = 1
if filereadable('/usr/local/bin/ctags')
    let g:tagbar_ctags_bin = '/usr/local/bin/ctags'
endif
function! FiletypeHook(config)
    if has_key(a:config, 'language')
        let &filetype = a:config['language']
    endif
    return 0   " Return 0 to show no error happened
endfunction
call editorconfig#AddNewHook(function('FiletypeHook'))

" display style
if exists('+colorcolumn')
    set colorcolumn=80
endif
if &term == 'linux' || &term == 'ansi'
    set t_Co=8
else
    set t_Co=256
endif
let base16colorspace=256
set background=dark
colorscheme molokai

" indent
autocmd Filetype ruby setlocal ts=2 sts=2 sw=2
autocmd Filetype coffee setlocal ts=2 sts=2 sw=2
autocmd Filetype stylus setlocal ts=2 sts=2 sw=2

filetype plugin on
filetype indent on
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值