Skip to content

Instantly share code, notes, and snippets.

@ChrisPortman
Created January 6, 2020 18:11
Show Gist options
  • Save ChrisPortman/c41b102584a84dfea308e44591f60f3c to your computer and use it in GitHub Desktop.
Save ChrisPortman/c41b102584a84dfea308e44591f60f3c to your computer and use it in GitHub Desktop.
Vim Config
set nu
set clipboard=unnamed
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"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 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Enable folding
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
set encoding=utf-8
au BufNewFile,BufRead *.py
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
" \ set textwidth=79 |
au BufNewFile,BufRead *.js, *.html, *.css
\ set tabstop=2 |
\ set softtabstop=2 |
\ set shiftwidth=2
"Flagging Unnecessary Whitespace
highlight BadWhitespace ctermbg=red guibg=darkred
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
"Automatically remove trailing whitespace on save
autocmd FileType python autocmd BufWritePre <buffer> %s/\s\+$//e
let g:ycm_autoclose_preview_window_after_completion=1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
"python with virtualenv support
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
let python_highlight_all=1
syntax on
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endi
call togglebg#map("<F5>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment