" Leader let mapleader = " " set nocompatible " Use Vim settings, rather then Vi settings set nobackup set nowritebackup set noswapfile " http://robots.thoughtbot.com/post/18739402579/global-gitignore#comment-458413287 set history=50 set ruler " show the cursor position all the time set showcmd " display incomplete commands set incsearch " do incremental searching set laststatus=2 " Always display the status line " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on") syntax on endif " Declare bundles are handled via Vundle set rtp+=~/.vim/bundle/vundle/ call vundle#rc() " Let Vundle manage Vundle Bundle 'gmarik/vundle' " Define bundles via Github repos Bundle 'croaky/vim-colors-github' Bundle 'danro/rename.vim' Bundle 'kchmck/vim-coffee-script' Bundle 'kien/ctrlp.vim' Bundle 'nanki/treetop.vim' Bundle 'thoughtbot/vim-rspec' Bundle 'timcharper/textile.vim' Bundle 'tpope/vim-cucumber' Bundle 'tpope/vim-endwise' Bundle 'tpope/vim-fugitive' Bundle 'tpope/vim-haml' Bundle 'tpope/vim-markdown' Bundle 'tpope/vim-rails' Bundle 'tpope/vim-surround' Bundle 'tsaleh/vim-matchit' Bundle 'vim-scripts/ctags.vim' Bundle 'vim-scripts/greplace.vim' Bundle 'vim-scripts/tComment' Bundle 'xenoterracide/html.vim' filetype plugin indent on augroup vimrcEx au! " For all text files set 'textwidth' to 78 characters. autocmd FileType text setlocal textwidth=78 " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif augroup END " Softtabs, 2 spaces set tabstop=2 set shiftwidth=2 set expandtab " Display extra whitespace set list listchars=tab:»·,trail:· " Local config if filereadable(".vimrc.local") source .vimrc.local endif " Use Ag (https://github.com/ggreer/the_silver_searcher) instead of Grep when " available if executable("ag") set grepprg=ag\ --noheading\ --nogroup\ --nocolor endif " Color scheme colorscheme github highlight NonText guibg=#060606 highlight Folded guibg=#0A0A0A guifg=#9090D0 " Numbers set number set numberwidth=5 " Snippets are activated by Shift+Tab let g:snippetsEmu_key = "" " Tab completion " will insert tab at beginning of line, " will use completion if not at beginning set wildmode=list:longest,list:full set complete=.,w,t function! InsertTabWrapper() let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\" else return "\" endif endfunction inoremap =InsertTabWrapper() " Exclude Javascript files in :Rtags via rails.vim due to warnings when parsing let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'" " Index ctags from any project, including those outside Rails map ct :!ctags -R . " Cucumber navigation commands autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes " Switch between the last two files nnoremap " Get off my lawn nnoremap :echoe "Use h" nnoremap :echoe "Use l" nnoremap :echoe "Use k" nnoremap :echoe "Use j" " Treat
  • and

    tags like the block tags they are let g:html_indent_tags = 'li\|p' " Markdown files end in .md au BufRead,BufNewFile *.md set filetype=markdown " Enable spellchecking for Markdown au BufRead,BufNewFile *.md setlocal spell " Automatically wrap at 80 characters for Markdown au BufRead,BufNewFile *.md setlocal textwidth=80