Skip to content

Instantly share code, notes, and snippets.

@jordanyaker
Created January 11, 2012 02:11
Show Gist options
  • Save jordanyaker/1592534 to your computer and use it in GitHub Desktop.
Save jordanyaker/1592534 to your computer and use it in GitHub Desktop.
My Current .vimrc File
" -----------------------------------------------------------------------
" Vundle Configurations
" -----------------------------------------------------------------------
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'tpope/vim-rails'
Bundle 'FuzzyFinder'
Bundle 'scrooloose/nerdtree'
Bundle 'scrooloose/nerdcommenter'
Bundle 'kchmck/vim-coffee-script'
Bundle 'briancollins/vim-jst'
Bundle 'taglist.vim'
Bundle 'surround.vim'
Bundle 'L9'
Bundle 'othree/xml.vim'
Bundle 'othree/html5.vim'
" -----------------------------------------------------------------------
" Settings Configurations
" -----------------------------------------------------------------------
set history=100 " keep 50 lines of command line history
syntax on " syntax highlighting
set hlsearch " highlighting the last used search pattern.
set autoindent " always set autoindenting on
set autowrite " Writes on make/shell commands
set expandtab " Convert tabs to spaces
set smarttab
set ic sc " Ignore Case/SmartCase When Searching
set t_Co=256 " 256bit color
set tabstop=2 shiftwidth=2 softtabstop=2
set ruler
set hidden " hide buffers when abandoned
set wildmode=list:longest
set nowrap
set nu
set go+=b " Enable horizonal scrollbar.
let mapleader = ","
let g:NERDTreeDirArrows=0
set guifont=Anonymous\ Pro:h13
set switchbuf=useopen
filetype on " enable file-type detection
filetype indent on " enable file-type specific indentation
filetype plugin on " enable file-type specific plug-ins
highlight clear Search
highlight Search term=reverse cterm=bold ctermbg=4 guifg=white guibg=hotpink1
" -----------------------------------------------------------------------
" Folding Configurations
" -----------------------------------------------------------------------
hi Folded guibg=red guifg=Red cterm=bold ctermbg=DarkGrey ctermfg=lightblue
hi FoldColumn guibg=grey78 gui=Bold guifg=DarkBlue
set foldclose=
set foldmethod=syntax
set foldnestmax=10
set foldlevel=9999
set fillchars=vert:\|,fold:\
set foldminlines=1
noremap <space> :call ToggleFold()<CR> " Map the folding function
fu! ToggleFold()
if foldlevel('.') == 0
normal! l
else
if foldclosed('.') < 0
. foldclose
else
. foldopen
endif
endif
echo
endf
" -----------------------------------------------------------------------
" Key Mapping Configurations
" -----------------------------------------------------------------------
" Don't use Ex mode, use Q for formatting
map Q gq
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
map // <Esc>:noh<CR>
map <F2> <Esc>:NERDTreeToggle<CR>
map <C-F2> <Esc>:NERDTreeFind<CR>
map <F2><F2> <Esc>:NERDTree
map <C-t>n <Esc>:tabnew<CR>
map <C-t>c <Esc>:tabclose<CR>
map <C-t><C-l> <Esc>:TlistToggle<CR>
imap <D-/> <C-x><C-n>
map <C-W><C-V> <Esc>:vnew<CR>
nnoremap <F4> :buffers<CR>:buffer<space>
imap ,/ </<C-X><C-O>
nnoremap ' `
nnoremap ` '
" PHP Folding
map <F6> <Esc>:DisablePHPFolds<Cr>
map <F7> <Esc>:EnableFastPHPFolds<Cr>
map <S-F7> <Esc>:EnablePHPFolds<Cr>
" FuzzyFile mappings
map <C-f><C-f> :FufFile<CR>
map <C-f><C-d> :FufDir<CR>
map <C-f><C-t> :FufTag<CR>
map <C-f><C-b> :FufBuffer<CR>
map <C-f><C-l> :FufLine<CR>
" F5 Toggle spell check
map <F5> <Esc>:setlocal spell spelllang=en_us<CR>
map <S-F5> <Esc>:setlocal nospell<CR>
" -----------------------------------------------------------------------
" Buffer Configurations
" -----------------------------------------------------------------------
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
" -----------------------------------------------------------------------
" Ruby Configurations
" -----------------------------------------------------------------------
au BufRead,BufNewFile *.rabl setf ruby " Add RABL (ruby gem) syntax support (maps to ruby)" Folding stuff
" -----------------------------------------------------------------------
" Color Scheme Configuration
" -----------------------------------------------------------------------
colorscheme zenburn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment