|
| 1 | +set nocompatible " be iMproved, required |
| 2 | +filetype off " required |
| 3 | + |
| 4 | +" set the runtime path to include Vundle and initialize |
| 5 | +set rtp+=$VIM/vimfiles/bundle/Vundle.vim |
| 6 | +call vundle#begin('$VIM/vimfiles/bundle/') |
| 7 | +" alternatively, pass a path where Vundle should install plugins |
| 8 | +"call vundle#begin('~/some/path/here') |
| 9 | + |
| 10 | +" let Vundle manage Vundle, required |
| 11 | +Plugin 'VundleVim/Vundle.vim' |
| 12 | + |
| 13 | +" The following are examples of different formats supported. |
| 14 | +" Keep Plugin commands between vundle#begin/end. |
| 15 | +" plugin on GitHub repo |
| 16 | +Plugin 'tpope/vim-fugitive' |
| 17 | +" plugin from http://vim-scripts.org/vim/scripts.html |
| 18 | +Plugin 'L9' |
| 19 | +" Git plugin not hosted on GitHub |
| 20 | +Plugin 'git://git.wincent.com/command-t.git' |
| 21 | +" The sparkup vim script is in a subdirectory of this repo called vim. |
| 22 | +" Pass the path to set the runtimepath properly. |
| 23 | +Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} |
| 24 | +" Install L9 and avoid a Naming conflict if you've already installed a |
| 25 | +" different version somewhere else. |
| 26 | +Plugin 'ascenator/L9', {'name': 'newL9'} |
| 27 | +"To keep foldmethod effective |
| 28 | +Plugin 'tmhedberg/SimpylFold' |
| 29 | +"Auto PEP8 |
| 30 | +Plugin 'vim-scripts/indentpython.vim' |
| 31 | +"Auto complete |
| 32 | +Bundle 'Valloric/YouCompleteMe' |
| 33 | +let g:ycm_autoclose_preview_window_after_completion=1 |
| 34 | +map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR> |
| 35 | +"syntastic highlight |
| 36 | +Plugin 'scrooloose/syntastic' |
| 37 | +Plugin 'nvie/vim-flake8' |
| 38 | +let python_hightlight_all=1 |
| 39 | +syntax on |
| 40 | +"text font colors |
| 41 | +Plugin 'jnurmine/Zenburn' |
| 42 | +Plugin 'altercation/vim-colors-solarized' |
| 43 | + |
| 44 | +"File oberview |
| 45 | +Plugin 'scrooloose/nerdtree' |
| 46 | +Plugin 'jistr/vim-nerdtree-tabs' |
| 47 | +let NERDTreeIgnore=['\pyc$','\~$'] "ignor files in NERDTree |
| 48 | +"super research |
| 49 | +Plugin 'kien/ctrlp.vim' |
| 50 | +"add git |
| 51 | +"Powerline |
| 52 | +Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'} |
| 53 | + |
| 54 | +au BufNewFile,BufRead *.py |
| 55 | + \ set tabstop=4 | |
| 56 | + \ set softtabstop=4 | |
| 57 | + \ set shiftwidth=4 | |
| 58 | + \ set textwidth=79 | |
| 59 | + \ set expandtab | |
| 60 | + \ set autoindent | |
| 61 | + \ set fileformat=unix | |
| 62 | + |
| 63 | +au BufNewFile,BufRead *.js,*.html,*.css |
| 64 | + \ set tabstop=2 | |
| 65 | + \ set softtabstop=2 | |
| 66 | + \ set shiftwidth=2 | |
| 67 | + |
| 68 | +"split the window and do more geek things |
| 69 | +set splitbelow |
| 70 | +set splitright |
| 71 | +"split navigations |
| 72 | +nnoremap <C-J> <C-W><C-J> |
| 73 | +nnoremap <C-K> <C-W><C-K> |
| 74 | +nnoremap <C-L> <C-W><C-L> |
| 75 | +nnoremap <C-H> <C-W><C-H> |
| 76 | +"Enable folding |
| 77 | +set foldmethod=indent |
| 78 | +set foldlevel=99 |
| 79 | +"Enable folding with the spacebar |
| 80 | +nnoremap <space> za |
| 81 | +let g:SimpylFold_docstring_preview=1 |
| 82 | +"observe the whitespace |
| 83 | +au BufRead,BufNewFile *.py,*.pyw,*.c,*.h, match BadWhitespace /\s\+$/ |
| 84 | +"support utf-8 |
| 85 | +set encoding=utf-8 |
| 86 | +set fileencodings=utf-8,chinese,latin-1 |
| 87 | +if has("win32") |
| 88 | +set fileencoding=chinese |
| 89 | +else |
| 90 | +set fileencoding=utf-8 |
| 91 | +endif |
| 92 | +"table encoding |
| 93 | +source $VIMRUNTIME/delmenu.vim |
| 94 | +source $VIMRUNTIME/menu.vim |
| 95 | +"consle output encoding |
| 96 | +language messages zh_CN.utf-8 |
| 97 | +set termencoding=utf-8 |
| 98 | +set fileencodings=utf-8,gbk,latin1 |
| 99 | + |
| 100 | +"python with virtualenv support |
| 101 | +py << EOF |
| 102 | +import os |
| 103 | +import sys |
| 104 | +if 'VIRTUAL_ENV' in os.environ: |
| 105 | + project_base_dir = os.environ['VIRTUAl_ENV'] |
| 106 | + activate_this = os.path.join(project_base_dir, 'bin/activate_this.py') |
| 107 | + execfile(activate_this, dict(_file___=activeate_this)) |
| 108 | +EOF |
| 109 | + |
| 110 | +" All of your Plugins must be added before the following line |
| 111 | +call vundle#end() " required |
| 112 | +filetype plugin indent on " required |
| 113 | +" All of your Plugins must be added before the following line |
| 114 | +filetype plugin indent on " required |
| 115 | +" All of your Plugins must be added before the following line |
| 116 | +filetype plugin indent on " required |
| 117 | +" All of your Plugins must be added before the following line |
| 118 | +filetype plugin indent on " required |
| 119 | +" To ignore plugin indent changes, instead use: |
| 120 | +"filetype plugin on |
| 121 | +" |
| 122 | +" Brief help |
| 123 | +" :PluginList - lists configured plugins |
| 124 | +" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate |
| 125 | +" :PluginSearch foo - searches for foo; append `!` to refresh local cache |
| 126 | +" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal |
| 127 | +" |
| 128 | +" see :h vundle for more details or wiki for FAQ |
| 129 | +" Put your non-Plugin stuff after this line |
| 130 | + |
| 131 | +source $VIMRUNTIME/vimrc_example.vim |
| 132 | +source $VIMRUNTIME/mswin.vim |
| 133 | +behave mswin |
| 134 | + |
| 135 | +set diffexpr=MyDiff() |
| 136 | +function MyDiff() |
| 137 | + let opt = '-a --binary ' |
| 138 | + if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif |
| 139 | + if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif |
| 140 | + let arg1 = v:fname_in |
| 141 | + if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif |
| 142 | + let arg2 = v:fname_new |
| 143 | + if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif |
| 144 | + let arg3 = v:fname_out |
| 145 | + if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif |
| 146 | + if $VIMRUNTIME =~ ' ' |
| 147 | + if &sh =~ '\<cmd' |
| 148 | + if empty(&shellxquote) |
| 149 | + let l:shxq_sav = '' |
| 150 | + set shellxquote& |
| 151 | + endif |
| 152 | + let cmd = '"' . $VIMRUNTIME . '\diff"' |
| 153 | + else |
| 154 | + let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"' |
| 155 | + endif |
| 156 | + else |
| 157 | + let cmd = $VIMRUNTIME . '\diff' |
| 158 | + endif |
| 159 | + silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 |
| 160 | + if exists('l:shxq_sav') |
| 161 | + let &shellxquote=l:shxq_sav |
| 162 | + endif |
| 163 | +endfunction |
| 164 | + |
| 165 | +syntax enable |
| 166 | +if has('gui_running') |
| 167 | + set background=dark |
| 168 | + colorscheme solarized |
| 169 | +else |
| 170 | + colorscheme Zenburn |
| 171 | +endif |
| 172 | +call togglebg#map("<F5>") |
| 173 | + |
| 174 | + |
0 commit comments