Skip to content

Instantly share code, notes, and snippets.

@AnthonyWC
Created July 16, 2016 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnthonyWC/791d454d0831648068d3174e9cff2ead to your computer and use it in GitHub Desktop.
Save AnthonyWC/791d454d0831648068d3174e9cff2ead to your computer and use it in GitHub Desktop.
" Turn off jedi-vim
" let g:jedi#auto_initialization = 0
autocmd ColorScheme * highlight UnwanttedTab ctermbg=red guibg=darkred
autocmd ColorScheme * highlight TrailSpace guibg=red ctermbg=darkred
autocmd ColorScheme * highlight ExtraWhiteSpace guibg=red ctermbg=red
autocmd BufRead,BufNewFile ~/etc/ansible/* set syntax=ansible
" autocmd FileType python set omnifunc=pythoncomplete#Complete
highlight UnwanttedTab ctermbg=red guibg=darkred
highlight TrailSpace guibg=red ctermbg=darkred
highlight ExtraWhiteSpace guibg=red ctermbg=red
match UnwanttedTab /\t/
match TrailSpace / \+$/
au BufNewFile,BufRead [vV]agrantfile set filetype=ruby
" PEP8
au BufRead,BufNewFile *.py,*.yml,*.yaml
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
\ set textwidth=79 |
\ set expandtab |
\ set autoindent |
\ set fileformat=unix
augroup vimrc_autocmds
autocmd!
" highlight characters past column 120
autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black
autocmd FileType python match Excess /\%80v.*/
autocmd FileType python set nowrap
augroup END
" Remove white spaces
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match ExtraWhiteSpace /\s\+$/
au BufRead,BufNewFile *.js,*.html,*.css
\ set softtabstop=2 |
\ set expandtab |
\ set shiftwidth=2
" Hold shift to copy
set mouse=a
set splitbelow
let python_highlight_all=1
syntax on
set foldmethod=indent
set foldlevel=99
" Enable folding with the spacebar
nnoremap <space> za
let g:SimpylFold_docstring_preview=1
"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
" Toggle paste mode
set encoding=utf-8
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternative path where Vundle should install plugins
" call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Bundle 'klen/python-mode'
Plugin 'VundleVim/Vundle.vim'
Plugin 'fatih/vim-go'
Plugin 'hynek/vim-python-pep8-indent'
Plugin 'vim-scripts/indentpython.vim'
" Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'pearofducks/ansible-vim'
Plugin 'tmhedberg/SimpylFold'
" pip install powerline-status
" Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'}
" Plugin 'Valloric/YouCompleteMe'
Plugin 'davidhalter/jedi-vim'
Plugin 'L9'
" Keep Plugin commands between vundle#begin/end.
" " 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 install diff version
" Plugin 'ascenator/L9', {'name': 'newL9'}
" 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
" :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
set nobackup
set softtabstop=2 shiftwidth=2 expandtab
" Allow for retab
nnoremap <esc> :noh<return><esc>
nnoremap <esc>^[ <esc>^[
" Press Space to turn off highlight & clear displayed message.
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
inoremap <Nul> <C-x><C-o>
"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>
" let g:NERDTreeWinSize = 20
" Powerline setup
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 9
set laststatus=2
set pastetoggle=<F2>
if &diff
" diff mode
set diffopt+=iwhite
set diffexpr=""
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment