Skip to content

Instantly share code, notes, and snippets.

@janzhen
Last active June 29, 2017 02:16
Show Gist options
  • Select an option

  • Save janzhen/733829ef91e751b09d02ba6ec663ad52 to your computer and use it in GitHub Desktop.

Select an option

Save janzhen/733829ef91e751b09d02ba6ec663ad52 to your computer and use it in GitHub Desktop.
vimrc
" make sure vim-plug is installed, https://github.com/junegunn/vim-plug
call plug#begin()
Plug 'tpope/vim-sensible'
Plug 'morhetz/gruvbox'
Plug 'bling/vim-airline'
Plug 'w0rp/ale'
Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'majutsushi/tagbar'
Plug 'mileszs/ack.vim'
Plug 'airblade/vim-gitgutter'
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
Plug 'hynek/vim-python-pep8-indent'
Plug 'vim-python/python-syntax'
Plug 'tmhedberg/simpylfold'
Plug 'luochen1990/rainbow'
Plug 'scrooloose/nerdcommenter'
Plug 'terryma/vim-multiple-cursors'
Plug 'yggdroot/indentline'
call plug#end()
set background=dark
let g:gruvbox_contrast_dark = "soft"
colorscheme gruvbox
set guifont=Source\ Code\ Pro:h13
set hidden
set hlsearch
set fileencodings=utf8,gbk
let mapleader = ","
set showcmd
set nu
"set cursorline
set list
set listchars=tab:›\ ,trail:•,extends:#,nbsp:.
set ignorecase
set smartcase
set clipboard=unnamed
set guioptions-=rL " hide scroll bars
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set viewdir=~/.vim/view//
set undodir=~/.vim/undo//
set undofile
set wildignore+=*.swp,*.pyc
set ts=4 sts=4 sw=4
set mouse=a
if has('gui_running') && has("gui_macvim")
set transparency=3
endif
augroup python
autocmd!
autocmd FileType python setlocal cc=80
augroup END
" plugin settings
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
let g:tagbar_sort = 0
let g:tagbar_type_python = {
\ 'kinds' : [
\ 'c:classes',
\ 'f:functions',
\ 'm:members',
\ 'v:variables:0:0',
\ ],
\ }
let g:ale_sign_column_always = 1
let g:ale_sign_error = 'E'
let g:ale_sign_warning = 'W'
let g:ale_linters = {
\ 'python': ['flake8'],
\}
let g:NERDTreeIgnore = ['\~$', '\.pyc$[[file]]']
let g:python_highlight_operators = 0
let g:python_highlight_all = 1
let g:rainbow_active = 1
let g:ycm_autoclose_preview_window_after_insertion = 1
" key mapping
nnoremap <silent> <leader>/ :nohlsearch<CR>
nnoremap <silent> <leader>e :NERDTreeToggle<CR>
nnoremap <silent> <leader>t :TagbarOpen fc<CR>
nnoremap <silent> <leader>b :CtrlPBuffer<CR>
nnoremap <silent> <leader>gs :Gstatus<CR>
" vim: ts=4 sts=4 sw=4 et
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment