Skip to content

Instantly share code, notes, and snippets.

@rufo
Created January 4, 2012 20:23
Show Gist options
  • Save rufo/1561939 to your computer and use it in GitHub Desktop.
Save rufo/1561939 to your computer and use it in GitHub Desktop.
vim setup
" with inspiration from http://stevelosh.com/blog/2010/09/coming-home-to-vim/
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype plugin indent on
set nocompatible
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set autoindent
set encoding=utf-8
set scrolloff=5
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set number
set undofile
set ignorecase
set smartcase
set incsearch
set showmatch
set hlsearch
nnoremap <tab> %
vnoremap <tab> %
set wrap
set linebreak
set colorcolumn=85
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
nnoremap j gj
nnoremap k gk
"nnoremap ; :
"vnoremap ; :
inoremap jj <ESC>
inoremap jk <ESC>
nnoremap <leader>u :GundoToggle<CR>
nnoremap <leader>[ :NERDTreeToggle<CR>
nnoremap <leader>] :NERDTreeFind<CR>
nnoremap <leader>; :if &number <Bar>
\set relativenumber<Bar>
\else <Bar>
\set number <Bar>
\endif<cr>
nnoremap <leader>o :put ='' <Bar>put! =''<cr>
nnoremap <leader>r :CommandTFlush
nnoremap <leader>p :CommandT<CR>
"nnoremap <leader>b :buffers<CR>:buffer<Space>
syntax enable
set background=dark
set guifont=Ubuntu\ Mono:h16
set guioptions-=T
colorscheme wombat
hi MatchParen ctermbg=red guibg=red
let g:fuzzy_ignore="vendor/**;*.png;*.jpg;*.pdf;*.xls;*.doc;*.docx;*.xlsx;coverage/**"
set shell=/bin/sh
let vimclojure#WantNailgun = 1
let vimclojure#NailgunClient = "/Users/rufo/sandbox/vimclojure-nailgun-client/ng"
if has("gui_running")
autocmd FileType ruby,eruby set noballooneval
endif
let g:NERDTreeQuitOnOpen = 1
"let g:EasyMotion_leader_key = '<Leader>m'
"nmap <silent> <Leader>p :CommandT<CR>
" from http://vim.wikia.com/wiki/Diff_current_buffer_and_the_original_file
function! s:DiffWithSaved()
let filetype=&ft
diffthis
vnew | r # | normal! 1Gdd
diffthis
exe "setlocal bt=nofile bh=wipe nobl noswf ro ft=" . filetype
endfunction
com! DiffSaved call s:DiffWithSaved()
let g:yankring_history_dir = '~/.vim/'
" http://stackoverflow.com/questions/3878692/aliasing-a-command-in-vim
cnoreabbrev W w
ack
command-t
cucumber
delimitMate
fugitive
gundo
haml
nerdcommenter
nerdtree
php
rails
rainbow_parenthesis
repeat
snipmate
surround
tabular
tail
textile
vim-coffee-script
vim-colors-solarized
vim-easymotion
vim-endwise
vimclojure
yankring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment