115 lines
2.4 KiB
VimL
115 lines
2.4 KiB
VimL
set nocompatible " 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 'gmarik/Vundle.vim'
|
|
Plugin 'tmhedberg/SimpylFold'
|
|
Plugin 'vim-scripts/indentpython.vim'
|
|
Plugin 'Valloric/YouCompleteMe'
|
|
Plugin 'vim-syntastic/syntastic'
|
|
Plugin 'nvie/vim-flake8'
|
|
Plugin 'jnurmine/Zenburn'
|
|
Plugin 'altercation/vim-colors-solarized'
|
|
Plugin 'kien/ctrlp.vim'
|
|
Plugin 'tpope/vim-fugitive'
|
|
Plugin 'itchyny/lightline.vim'
|
|
" add all your plugins here (note older versions of Vundle
|
|
" used Bundle instead of Plugin)
|
|
|
|
" ...
|
|
|
|
" All of your Plugins must be added before the following line
|
|
call vundle#end() " required
|
|
filetype plugin indent on " required
|
|
|
|
" Split zones
|
|
set splitbelow
|
|
set splitright
|
|
|
|
"split navigations
|
|
nnoremap <C-J> <C-W><C-J>
|
|
nnoremap <C-K> <C-W><C-K>
|
|
nnoremap <C-L> <C-W><C-L>
|
|
nnoremap <C-H> <C-W><C-H>
|
|
|
|
" Enable folding
|
|
set foldmethod=indent
|
|
set foldlevel=99
|
|
|
|
" Enable folding with the spacebar
|
|
nnoremap <space> za
|
|
|
|
" See the docstrings when folded
|
|
let g:SimpylFold_docstring_preview=1
|
|
|
|
" PEP8 indentation
|
|
au BufNewFile,BufRead *.py
|
|
\ set tabstop=4
|
|
\ set softtabstop=4
|
|
\ set shiftwidth=4
|
|
\ set textwidth=79
|
|
\ set expandtab
|
|
\ set autoindent
|
|
\ set fileformat=unix
|
|
|
|
" Flag whitespaces
|
|
au BufRead,BufNewFile *.py,*.c,*.h match BadWhitespace /\s\+$/
|
|
|
|
" UTF-8 support
|
|
set encoding=utf-8
|
|
|
|
" YCM customizations
|
|
let g:ycm_autoclose_preview_window_after_completion=1
|
|
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
|
|
|
|
" virtualenv support for YCM
|
|
" py << EOF
|
|
" import os
|
|
" import sys
|
|
" if 'VIRTUAL_ENV' in os.environ:
|
|
" project_base_dir = os.environ['VIRTUAL_ENV']
|
|
" activate_this = os.path.join(project_base_dir, 'bin/activate_this.py')
|
|
" execfile(activate_this, dict(__file__=activate_this))
|
|
"EOF
|
|
"
|
|
|
|
" Python syntax highlighting
|
|
let python_highlight_all=1
|
|
syntax on
|
|
|
|
" Color themes
|
|
if has('gui_running')
|
|
set background=dark
|
|
colorscheme solarized
|
|
else
|
|
colorscheme zenburn
|
|
endif
|
|
|
|
" Toggle between dark and light theme
|
|
call togglebg#map("<F5>")
|
|
|
|
" Line numbers
|
|
set nu
|
|
|
|
" Needed for lightline
|
|
set laststatus=2
|
|
|
|
" Draw a margin in the 81th column
|
|
set colorcolumn=81
|
|
|
|
" Use vim settings rather than vi settings
|
|
set nocompatible
|
|
|
|
" Persistent undo
|
|
set undodir=~/.vimundo
|
|
set undofile
|
|
|
|
|