Skip to content

Instantly share code, notes, and snippets.

@trotter
Created December 15, 2010 16:34
Show Gist options
  • Select an option

  • Save trotter/742212 to your computer and use it in GitHub Desktop.

Select an option

Save trotter/742212 to your computer and use it in GitHub Desktop.
It's mah vimrc
set nocompatible
syntax on
set backspace=indent,eol,start
set number " Show line numbers
" Pathogen ********************************************************************
filetype off
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
" Folding *********************************************************************
set foldenable
set foldmethod=syntax
set foldlevelstart=99
" Tabs ************************************************************************
" Use 2 spaces
set softtabstop=2
set shiftwidth=2
set tabstop=2
set expandtab
" Searching *******************************************************************
set incsearch " incremental search, search as you type
" Status Line *****************************************************************
set showcmd
set ruler " Show ruler
" Backups *********************************************************************
set backupdir=~/.vim/backup
set directory=~/.vim/backup
" Better File Opening *********************************************************
set wildmode=list:longest,full
" Use \ as the leader *********************************************************
let mapleader = "\\"
nmap <silent> <leader>s :set spell!<CR>
" Put the cursor at the beginning of the edit after . macro *******************
nmap . .`[
" Show syntax highlighting groups for word under cursor ***********************
nmap <C-S-P> :call <SID>SynStack()<CR>
function! <SID>SynStack()
if !exists("*synstack")
return
endif
echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')
endfunc
" Show whitespace *************************************************************
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
set list
" Ruby helpers ****************************************************************
" Need to move this section to ruby.vim
iabbrev rdebug require 'ruby-debug'; debugger; 1
" Fix up grep.vim
let Grep_Xargs_Options='-0'
" Ctags ****************************************************************
augroup vimctags
autocmd!
autocmd BufWritePost * silent!ctags -R &
augroup END
" Highlight long rows **************************************************
highlight OverLength ctermbg=Magenta ctermfg=white guibg=#592929
match OverLength /\%73v.\+/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment