Skip to content

Instantly share code, notes, and snippets.

@rafaduran
Last active December 16, 2015 20:49
Show Gist options
  • Save rafaduran/5495503 to your computer and use it in GitHub Desktop.
Save rafaduran/5495503 to your computer and use it in GitHub Desktop.
My .vimrc
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
"
Bundle 'tpope/vim-rails'
Bundle 'Valloric/MatchTagAlways'
Bundle 'mattn/zencoding-vim'
Bundle 'scrooloose/nerdtree'
" remap nerd tree
map \e :NERDTreeToggle<CR>
" exit if latest bufer is nerdtree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
Bundle 'scrooloose/syntastic'
Bundle 'Lokaltog/powerline'
set rtp+=~/.vim/bundle/powerline/powerline/bindings/vim
set laststatus=2 " Always display the statusline in all windows
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)
" Change status line faster
if ! has('gui_running')
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
endif
" force 256 bit colors on gnome-terminal
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
Bundle 'rodjek/vim-puppet'
Bundle 'bronson/vim-trailing-whitespace'
Bundle 'flazz/vim-colorschemes'
Bundle 'kien/ctrlp.vim'
nmap ; :CtrlPBuffer<CR>
let g:ctrlp_map = '<Leader>t'
let g:ctrlp_match_window_bottom = 0
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_custom_ignore = '\v\~$|\.(o|swp|pyc|wav|mp3|ogg|blend)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])|__init__\.py'
let g:ctrlp_working_path_mode = 0
let g:ctrlp_dotfiles = 0
let g:ctrlp_switch_buffer = 0
Bundle 'jmcantrell/vim-virtualenv'
Bundle 'cwood/vim-django'
let g:django_projects = expand('~/workspace') "Sets all projects under project
" let g:django_project_container = 'source' "Inside of these folders look for source
" let g:django_activate_virtualenv = 1 "Try to activate the associated virtualenv
let g:django_activate_nerdtree = 1 "Try to open nerdtree at the project root.
Bundle 'tpope/vim-fugitive'
Bundle 'hynek/vim-python-pep8-indent'
Bundle "lepture/vim-jinja"
Bundle 'DAddYE/soda.vim'
" requires: pip install jedi
Bundle 'davidhalter/jedi-vim'
Bundle 'ervandew/supertab'
filetype plugin indent on " required!
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
nmap \l :setlocal number!<CR>
nmap \o :set paste!<CR>
nmap j gj
nmap k gk
" buffer quick switch
nmap <C-e> :e#<CR>
nmap <C-n> :bnext<CR>
nmap <C-p> :bprev<CR>
" indentation
"set textwidth=79
set tabstop=8
set softtabstop=4
set shiftwidth=4
set expandtab
au BufRead,BufNewFile *.pp set filetype=puppet
au BufRead,BufNewFile Vagrantfile set filetype=ruby
au BufNewFile,BufRead *.json set ft=javascript
au filetype ruby set ts=2 bs=2 shiftwidth=2 softtabstop=2
au filetype puppet set ts=2 bs=2 shiftwidth=2 softtabstop=2
au filetype yaml set ts=2 bs=2 shiftwidth=2 softtabstop=2
au filetype javascript set softtabstop=2 shiftwidth=2
au filetype rst set softtabstop=3 shiftwidth=3
au filetype html set softtabstop=2 shiftwidth=2
au BufNewFile,BufRead *.jinja set ft=jinja
"ruby
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
" improve autocomplete menu color
highlight Pmenu ctermbg=238 gui=bold
" search options
set hlsearch " hightligt search
set incsearch " incremental search
" show numbers
set number
" customize statement color
hi Statement term=bold ctermfg=148 gui=none guifg=gold3
" splitted windows quick movement
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
map <C-H> <C-W>h<C-W>_
map <C-L> <C-W>l<C-W>_
" only show name
set wmh=0
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%79v.*/
" TagList
" http://vim.sourceforge.net/scripts/script.php?script_id=273
" require package exuberant-ctags
map P :TlistToggle<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment