Skip to content

Instantly share code, notes, and snippets.

Created Oct 26, 2017
What would you like to do?
set nocompatible " be iMproved, 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 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://'
" git repos on your local machine (i.e. when working on your own plugin)
" Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
Plugin 'ascenator/L9', {'name': 'newL9'}
Plugin 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
call pathogen#infect()
syntax on
filetype plugin indent on
" set textwidth=79
set foldmethod=indent
set foldlevel=99
set nocompatible
set backspace=indent,eol,start
set nobackup
set history=150
set showcmd
set incsearch
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set autoindent
set number
set smarttab
set encoding=utf-8
set list
set listchars=tab:>·,trail:·,extends:…,precedes:…,nbsp:&
set shiftround
set t_Co=256
" set background=dark
colorscheme molokai2
au FileType python set omnifunc=pythoncomplete#Complete
let g:SuperTabDefaultCompletionType = "context"
set completeopt=menuone,longest,preview
set ruler
map Q gq
inoremap <C-U> <C-G>u<C-U>
set hlsearch
source ~/dot_files/.pep8
map <buffer> <S-e> :w<CR>:!/usr/bin/env python % <CR>
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>
nnoremap <F3> :set listchars=<CR>
nnoremap <silent> <up> g<up>
nnoremap <silent> <down> g<down>
" LaTeX
au Filetype tex set spell
au Filetype tex set makeprg=pdflatex\ \-file\-line\-error\ \-interaction=nonstopmode\ $*\\\|\ grep\ \-P\ ':\\d{1,5}:\ '
au Filetype tex set errorformat=%f:%l:\ %m
" Force myself to use hjkl rather than arrow keys
nnoremap <expr> <Up> ((bufname("%") is "[Command Line]")?("\<Up>"):(""))
nnoremap <expr> <Down> ((bufname("%") is "[Command Line]")?("\<Down>"):(""))
nnoremap <expr> <Left> ((bufname("%") is "[Command Line]")?("\<Left>"):(""))
nnoremap <expr> <Right> ((bufname("%") is "[Command Line]")?("\<Right>"):(""))
inoremap <expr> <Up> ((bufname("%") is "[Command Line]")?("\<Up>"):(""))
inoremap <expr> <Down> ((bufname("%") is "[Command Line]")?("\<Down>"):(""))
inoremap <expr> <Left> ((bufname("%") is "[Command Line]")?("\<Left>"):(""))
inoremap <expr> <Right> ((bufname("%") is "[Command Line]")?("\<Right>"):(""))
command! W w
command! Q q
command! Wq wq
command! WQ wq
highlight BadWhitespace ctermbg=red guibg=red
au BufRead,BufNewFile *.* match BadWhitespace /^\t\+/
au BufRead,BufNewFile *.* match BadWhitespace /\s\+$/
"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 1
" nnoremap <F6> :YcmForceCompileAndDiagnostics<CR>
" Override go-to.definition key shortcut to Ctrl-]
"let g:pymode_rope_goto_definition_bind = "<C-]>"
" Override run current python file key shortcut to Ctrl-Shift-e
"let g:pymode_run_bind = "<C-S-e>"
" Override view python doc key shortcut to Ctrl-Shift-d
"let g:pymode_doc_bind = "<C-S-d>"
augroup vimrc_autocmds
" highlight characters past column 80
autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black
autocmd FileType python match Excess /\%80v.*/
autocmd FileType python set nowrap
augroup END
Bundle 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9
set laststatus=2
Bundle 'klen/python-mode'
" Python-mode
" Activate rope
" Keys:
" K Show python docs
" <Ctrl-Space> Rope autocomplete
" <Ctrl-c>g Rope goto definition
" <Ctrl-c>d Rope show documentation
" <Ctrl-c>f Rope find occurrences
" <Leader>b Set, unset breakpoint (g:pymode_breakpoint enabled)
" [[ Jump on previous class or function (normal, visual, operator modes)
" ]] Jump on next class or function (normal, visual, operator modes)
" [M Jump on previous class or method (normal, visual, operator modes)
" ]M Jump on next class or method (normal, visual, operator modes)
let g:pymode_rope = 1
" Documentation
let g:pymode_doc = 1
let g:pymode_doc_key = 'K'
let g:pymode_lint = 0
let g:pymode_lint_checker = "pyflakes,pep8"
" Auto check on save
let g:pymode_lint_write = 1
" Support virtualenv
let g:pymode_virtualenv = 1
" Enable breakpoints plugin
let g:pymode_breakpoint = 1
let g:pymode_breakpoint_bind = '<leader>b'
" syntax highlighting
let g:pymode_syntax = 1
let g:pymode_syntax_all = 1
let g:pymode_syntax_indent_errors = g:pymode_syntax_all
let g:pymode_syntax_space_errors = g:pymode_syntax_all
" Don't autofold code
let g:pymode_folding = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment