Skip to content

Instantly share code, notes, and snippets.

@beverlyguillermo
Created June 9, 2013 01:27
Show Gist options
  • Select an option

  • Save beverlyguillermo/5737234 to your computer and use it in GitHub Desktop.

Select an option

Save beverlyguillermo/5737234 to your computer and use it in GitHub Desktop.
vimrc with vundle, syntastic, and tomorrow theme
" Autoreload .vimrc
autocmd! bufwritepost .vimrc source %
" Settings required to set up Vundle, these two lines at the top
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" Your Bundles
Bundle 'scrooloose/syntastic'
Bundle 'ryan-cf/netrw'
Bundle 'chriskempson/tomorrow-theme', {'rtp': 'vim/'}
syntax on
" Always put status line at the 2nd to last line
set laststatus=2
" Modifying status line look
set statusline=%-(%F%m%r%h%w%)\ %{&ff}/%Y/%{&encoding}\ %=%(@\%03.3b\ %Ll\ %l,%v\ (%p%%)%)
" show how many lines are highlighted in visual mode
set showcmd
" show the line and column number of the cursor position
set ruler
" Err, backup files locations
"set backup
"set backupdir=/tmp
"set directory=/tmp
" show the line numbers
set number
" tabs
set tabstop=4
" backspace for converted tab
set softtabstop=4
" amount of block indenting
set shiftwidth=4
" convert tabs into spaces
set expandtab
" uses the shiftwidth instead of tabstop
set smarttab
" auto indenting when starting a new line
set smartindent
" copy indent from current line to new line
set autoindent
" line height
set linespace=2
" When the page starts to scroll, keep the cursor # lines from the top and #
" lines from the bottom
set scrolloff=4
" wrap scans
"set wrapscan
" ignore case in search
"set ignorecase
" only applies to search patterns that you type; it does not apply to * or # or gd
"set smartcase
" allow the cursor to be where there isn't an actual character
set virtualedit=all
" folder methods
set foldenable
set foldclose=all
set foldmethod=marker
" gives the number of lines checked for set commands
set nomodeline
" don't wrap lines in the buffer window
set nowrap
" keep buffers the same size when buffers are closed
set noea
"set equalalways " i.e. make buffers equal all the time
set ff=unix
"set timeoutlen=500
"set textwidth=79
"set formatoptions=qrn1
" Autocompletion for commands
set wildmenu
set wildmode=list:longest,full
set lazyredraw
set backspace=2
" Show trailing white space
set list
" set listchars=tab:\xbb\xb7,trail:\xb7
" set listchars=tab:>-,trail:-
set list listchars=tab:»·,trail:·
set cursorline cursorcolumn
"set the gui options the way I like
"set guioptions=ac
if has('gui_running')
set cursorcolumn!
set guioptions-=T " hide toolbar in gui mode
set guifont=menlo:h12
" Set up the gui cursor to look nice
set guicursor=n-v-c:block-Cursor-blinkon0
set guicursor+=ve:ver35-Cursor
set guicursor+=o:hor50-Cursor
set guicursor+=i-ci:ver25-Cursor
set guicursor+=r-cr:hor20-Cursor
set guicursor+=sm:block-Cursor-blinkwait175-blinkoff150-blinkon175
colorscheme Tomorrow-Night
endif
" These things start comment lines
set comments=sl:/*,mb:\ *,ex:\ */,O://,b:#,:%,:XCOMM,n:>,fb:-
filetype plugin indent on " required!
"autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType python set omnifunc=pythoncomplete#Complete
"autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
"autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
"autocmd FileType css set omnifunc=csscomplete#CompleteCSS
"autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
"autocmd FileType php set omnifunc=phpcomplete#CompletePHP
"autocmd FileType c set omnifunc=ccomplete#Complete
" Cleaner IDE functionality
" http://vim.wikia.com/wiki/Make_Vim_completion_popup_menu_work_just_like_in_an_IDE
set completeopt=longest,menuone " improve completion
" inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" inoremap <expr> <C-n> pumvisible() ? '<C-n>' : \ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
" inoremap <expr> <M-,> pumvisible() ? '<C-n>' : \ '<C-x><C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
" Remove trailing white space
autocmd BufRead * silent! %s/[\r \t]\+$//
autocmd BufEnter *.php :%s/[ \t\r]\+$//e
" Pressing Shift-< or Shift-> will let you indent/unident selected lines,
" allow it to occur multiple times in visual mode
vnoremap < <gv
vnoremap > >gv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment