Skip to content

Instantly share code, notes, and snippets.

@jlong
Created June 8, 2009 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlong/125937 to your computer and use it in GitHub Desktop.
Save jlong/125937 to your computer and use it in GitHub Desktop.
set runtimepath+=,/usr/share/vim/vimfiles
set backspace=indent,eol,start
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif
" 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")
syntax on
set hlsearch
set guifont=Monaco:h13
endif
if has("gui_running")
colorscheme rubyblue
endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
" Put these in an autocmd group, so that we can delete them easily.
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
else
set autoindent " always set autoindenting on
endif " has("autocmd")
set nocompatible
set tabstop=2 shiftwidth=2 expandtab
set fileformats=unix,mac,dos
set cindent
set cinoptions=(s,m1
set showmatch
set nojoinspaces
set scrolloff=2
set splitbelow
" Ignore case in search patterns, unless uppercase letters used
set ignorecase smartcase
set incsearch "hlsearch
set laststatus=2
set visualbell
" Backup Dir
set bdir=/tmp
" Swapfile Dir
set directory=/tmp
" Space pages
map <Space> <C-F>
" Move between windows
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_
set winheight=15 winminheight=0
" Split Explore Hotkey
map <F2> :Sexplore<CR>
" Ruby Hotkey
map <F5> :!ruby "%:p"<CR>
" Vimrc Hotkey
map <F8> :split ~/.vimrc<CR>
" Textmate Finder
map ,t :FuzzyFinderTextMate<CR>
" Shortcuts for html
nmap ,html _i<html><CR><ESC>0i<TAB><head><CR><ESC>0i<TAB><TAB><title></title><CR><ESC>0i<TAB></head><CR><ESC>0i<TAB><body><CR><ESC>0i<TAB></body><CR><ESC>0i</html><ESC>bbbbbbbbbbbbbba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment