Created
May 13, 2011 05:55
-
-
Save ruanwz/970050 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Don't use abbreviations! Spelling things out makes grepping easy. | |
" Let Pathogen bring in all the plugins | |
filetype off | |
call pathogen#runtime_append_all_bundles() | |
set modelines=0 | |
filetype indent plugin on | |
syntax on | |
" TODO: clean all this junk out! | |
" basics | |
"set nocompatible " tends to make things work better | |
set showcmd " show incomplete cmds down the bottom | |
set showmode " show current mode down the bottom | |
let mapleader = "," | |
set ignorecase | |
set incsearch " find the next match as we type the search | |
set hlsearch " hilight searches by default | |
set nowrap " by default, dont wrap lines (see <leader>w) | |
set showmatch " briefly jump to matching }] when typing | |
set nostartofline " don't jump to start of line as a side effect (i.e. <<) | |
set scrolloff=3 " lines to keep visible before and after cursor | |
set sidescrolloff=7 " columns to keep visible before and after cursor | |
set sidescroll=1 " continuous horizontal scroll rather than jumpy | |
set laststatus=2 " always display status line even if only one window is visible. | |
set updatetime=1000 " reduce updatetime so current tag in taglist is highlighted faster | |
set autoread " suppress warnings when git,etc. changes files on disk. | |
set nrformats=alpha,hex " C-A/C-X works on dec, hex, and chars (not octal so no leading 0 ambiguity) | |
set wildmode=list:longest "make cmdline tab completion similar to bash | |
set wildmenu "enable ctrl-n and ctrl-p to scroll thru matches | |
set wildignore=*.o,*.obj,*~ "stuff to ignore when tab completing | |
set backspace=indent,eol,start "allow backspacing over everything in insert mode | |
set history=1000 "store lots of :cmdline history | |
set hidden " allow buffers to go into the background without needing to save | |
set encoding=utf-8 | |
set cursorline | |
set ttyfast | |
set ruler | |
set relativenumber | |
set undofile | |
nnoremap / /\v | |
vnoremap / /\v | |
set smartcase | |
set gdefault | |
nnoremap <leader><space> :noh<cr> | |
nnoremap <tab> % | |
vnoremap <tab> % | |
set wrap | |
set textwidth=79 | |
set formatoptions=qrn1 | |
"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 | |
inoremap <F1> <ESC> | |
nnoremap <F1> <ESC> | |
vnoremap <F1> <ESC> | |
nnoremap ; : | |
au FocusLost * :wa | |
nnoremap <leader>W :%s/\s\+$//<cr>:let @/=''<CR> | |
nnoremap <leader>a :Ack | |
nnoremap <leader>q gqip | |
nnoremap <leader>v V`] | |
nnoremap <leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr> | |
inoremap jj <ESC> | |
nnoremap <leader>w <C-w>v<C-w>l | |
nnoremap <C-h> <C-w>h | |
nnoremap <C-j> <C-w>j | |
nnoremap <C-k> <C-w>k | |
nnoremap <C-l> <C-w>l | |
nnoremap <S-Left> <C-w>< | |
nnoremap <S-Right> <C-w>> | |
nnoremap <S-Up> <C-w>+ | |
nnoremap <S-Down> <C-w>- | |
nnoremap <leader>r <C-w>r | |
set visualbell " don't beep constantly, it's annoying. | |
set t_vb= " and don't flash the screen either (terminal anyway... | |
set guioptions-=T " hide gvim's toolbar by default | |
" set guifont=Inconsolata Medium 10 | |
" set guifont=* to bring up a font selector, set guifont? to see result | |
" search for a tags file recursively from cwd to / | |
set tags=.tags,tags;/ | |
" Store swapfiles in a single directory. | |
set directory=~/.vim/swap,~/tmp,/var/tmp/,tmp | |
" indenting, languages | |
set expandtab " use spaces instead of tabstops | |
set smarttab " use shiftwidth when hitting tab instead of sts (?) | |
set autoindent " try to put the right amount of space at the beginning of a new line | |
set shiftwidth=2 | |
set softtabstop=2 | |
" autocmd FileType ruby setlocal shiftwidth=2 softtabstop=2 | |
" ruby includes ! and ? in method names (array.empty?) | |
autocmd FileType ruby setlocal iskeyword+=!,? | |
" fixes | |
" <C-L> redraws the screen and also turns off highlighting the current search | |
" nnoremap <C-L> :nohl<CR><C-L> | |
" add a keybinding to toggle paste mode | |
nnoremap <leader>p :set paste!<CR>:set paste?<CR> | |
" make ' jump to saved line & column rather than just line. | |
" http://items.sjbach.com/319/configuring-vim-right | |
nnoremap ' ` | |
nnoremap ` ' | |
" make Y yank to the end of the line (like C and D). Use yy to yank the entire line. | |
" Upside: feels more natural. Downside: not stock vi/vim. | |
nmap Y y$ | |
" Make the quickfix window wrap no matter the setting of nowrap | |
au BufWinEnter * if &buftype == 'quickfix' | setl wrap | endif | |
" Plugins: | |
runtime macros/matchit.vim " enable vim's built-in matchit script (make % bounce between tags, begin/end, etc) | |
" BUNDLE: git://github.com/rstacruz/sparkup.git | |
" BUNDLE: git://github.com/sjl/gundo.vim.git | |
" # BUNDLE: git://github.com/vim-scripts/TwitVim.git | |
" BUNDLE: git://github.com/ruanwz/TwitVim.git | |
" BUNDLE: git://github.com/scrooloose/nerdtree.git | |
" BUNDLE: git://github.com/scrooloose/nerdcommenter.git | |
" BUNDLE: git://github.com/tpope/vim-surround.git | |
" BUNDLE: git://github.com/vim-scripts/taglist.vim.git | |
" # BUNDLE: git://github.com/bronson/vim-bufexplorer.git | |
" BUNDLE: git://github.com/vim-scripts/Command-T.git | |
" # BUNDLE: git://github.com/bronson/vim-closebuffer.git | |
" BUNDLE: git://github.com/vim-ruby/vim-ruby.git | |
" BUNDLE: git://github.com/tpope/vim-rails.git | |
" BUNDLE: git://github.com/tpope/vim-rake.git | |
" BUNDLE: git://github.com/msanders/snipmate.vim.git | |
" BUNDLE: git://github.com/scrooloose/snipmate-snippets.git | |
" # BUNDLE: git://github.com/bronson/vim-indexedsearch.git | |
" # BUNDLE: git://github.com/bronson/vim-ruby-block-conv.git | |
" # BUNDLE: git://github.com/janx/vim-rubytest.git | |
" # BUNDLE: git://github.com/tsaleh/vim-align.git | |
" BUNDLE: git://github.com/tpope/vim-endwise.git | |
" BUNDLE: git://github.com/tpope/vim-repeat.git | |
" BUNDLE: git://github.com/tpope/vim-fugitive.git | |
" # BUNDLE: git://github.com/tsaleh/vim-supertab.git | |
" # BUNDLE: git://github.com/mikezackles/Bisect.git | |
" BUNDLE: git://github.com/rson/vim-conque.git | |
" # BUNDLE: git://github.com/bronson/vim-scrollcolors.git | |
" # BUNDLE: git://github.com/bronson/vim-visual-star-search.git | |
" # BUNDLE: git://github.com/bronson/vim-trailing-whitespace.git | |
" # BUNDLE: git://github.com/bronson/vim-toggle-wrap.git | |
" # BUNDLE: git://github.com/Raimondi/YAIFA.git | |
" # BUNDLE: git://github.com/bronson/vim-jquery.git | |
" BUNDLE: git://github.com/garbas/vim-jquery.git | |
" BUNDLE: git://github.com/tsaleh/vim-shoulda.git | |
" BUNDLE: git://github.com/tpope/vim-git.git | |
" BUNDLE: git://github.com/tpope/vim-cucumber.git | |
" BUNDLE: git://github.com/tpope/vim-haml.git | |
" BUNDLE: git://github.com/tpope/vim-markdown.git | |
" # BUNDLE: git://github.com/timcharper/textile.vim.git | |
" BUNDLE: git://github.com/kchmck/vim-coffee-script.git | |
" # BUNDLE: git://github.com/tpope/vim-vividchalk.git | |
" # BUNDLE: git://github.com/astashov/vim-ruby-debugger.git | |
" BUNDLE: git://github.com/mattn/gist-vim.git | |
" BUNDLE: git://github.com/mileszs/ack.vim.git | |
" # BUNDLE: git://github.com/defmacro/vimclojure.git | |
" BUNDLE: git://github.com/vim-scripts/YankRing.vim.git | |
" BUNDLE: git://github.com/vim-scripts/dbext.vim.git | |
" BUNDLE: git://github.com/vim-scripts/molokai.git | |
" BUNDLE: git://github.com/vim-scripts/go.vim.git | |
" BUNDLE: git://repo.or.cz/vcscommand | |
" # BUNDLE: git://github.com/vim-scripts/vcscommand.vim.git | |
" # BUNDLE: git://github.com/vim-scripts/Rainbow-Parenthsis-Bundle.git | |
"nmap <silent> <Leader>t :TlistToggle<CR> | |
nmap <silent> T :TlistToggle<CR> | |
nmap <leader>d :NERDTreeToggle<cr> | |
nmap <leader>D :NERDTreeFind<cr> | |
"clojure | |
"let clj_highlight_builtins = 1 | |
let vimclojure#HighlightBuiltins = 1 | |
"let clj_highlight_contrib = 1 | |
"let g:clj_paren_rainbow=1 | |
let vimclojure#ParenRainbow=1 | |
autocmd BufNewFile,BufRead *.clj set filetype=clojure | |
au Bufenter,Bufnewfile *.clj setl complete+=k~/.clj_completions | |
"let vimclojure#NailgunClient = "/home/david/gitrepos/vimclojure/ng" | |
let g:clj_want_gorilla = 1 | |
let vimclojure#WantNailgun = 1 | |
"Gtags | |
nnoremap <leader>j :cn<CR> | |
nnoremap <leader>k :cp<CR> | |
nnoremap <C-\> :GtagsCursor<CR> | |
"gist-vim | |
let g:gist_browser_command = 'w3m %URL%' | |
" change the current directory to the the parent of the current file | |
"autocmd BufEnter * lcd %:p:h | |
" set autochdir | |
" VCSCommand | |
let VCSCommandMapPrefix = '<leader>v' | |
"twitvim | |
let twitvim_socks4a_proxy="localhost:6666" | |
let twitvim_browser_cmd="google-chrome" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment