Skip to content

Instantly share code, notes, and snippets.

@pgericson
Created May 19, 2010 07:53
Show Gist options
  • Save pgericson/406077 to your computer and use it in GitHub Desktop.
Save pgericson/406077 to your computer and use it in GitHub Desktop.
.vimrc
set nocompatible " We're running Vim, not Vi!
set ic " Disable case sensitivity
nmap <F7> :NERDTreeToggle<CR>
if has("gui_running")
set guioptions-=T
set background=dark
colorscheme koehler
endif
" http://weblog.jamisbuck.org/2008/11/17/vim-follow-up
" itâ�s easier to reach than the backspace character
let mapleader = ","
set number
set hlsearch
syntax on " Enable syntax highlighting
filetype plugin indent on " Enable filetype-specific indenting and plugins
" Load matchit (% to bounce from do to end, etc.)
runtime! macros/matchit.vim
" http://weblog.jamisbuck.org/2008/11/17/vim-follow-up
"set tabstop=2
" What you mean is: set sts
set sts=2
set smarttab
set shiftwidth=2
set autoindent
set expandtab
set backspace=start,indent
"But, some file types really do require explicit tabs, and not spaces
autocmd FileType make set noexpandtab
autocmd FileType python set noexpandtab
augroup myfiletypes
" Clear old autocmds in group
autocmd!
" autoindent with two spaces, always expand tabs
autocmd FileType ruby,eruby,yaml set ai sw=2 sts=2 et
augroup END
au! BufRead,BufNewFile *.haml setfiletype haml
map <leader>t :CommandT<CR>
map <leader>d :execute 'NERDTreeToggle ' . getcwd()<CR>
function! ToggleScratch()
if expand('%') == g:ScratchBufferName
quit
else
Sscratch
endif
endfunction
map <leader>s :call ToggleScratch()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment