Created
January 13, 2010 01:39
-
-
Save jhsu/275837 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| set t_Co=256 | |
| colorscheme xoria256 | |
| set nocompatible " We're running Vim, not Vi! | |
| syntax on " Enable syntax highlighting | |
| filetype plugin indent on " Enable filetype-specific indenting and plugins | |
| runtime! autoload/pathogen.vim | |
| if exists('g:loaded_pathogen') | |
| call pathogen#runtime_prepend_subdirectories(expand('~/.vimbundles')) | |
| end | |
| " Remove ending whitespace, MAY BE DANGEROUS | |
| " autocmd BufWritePre *.rb :%s/\s\+$//e | |
| " autocmd BufWritePre *.html :%s/\s\+$//e | |
| " autocmd BufWritePre *.css :%s/\s\+$//e | |
| set guifont="Inconsolata 14" | |
| set viminfo^=! | |
| set clipboard+=unnamed | |
| " use indents of 2 spaces, and have them copied down lines: | |
| set shiftwidth=2 | |
| set tabstop=2 | |
| set softtabstop=2 | |
| set shiftround | |
| set expandtab | |
| set ai | |
| set history=1000 " have fifty lines of command-line (etc) history: | |
| set bs=2 " Allow backspacing over anything | |
| set nobackup " Don't leave backup files (swp is good) | |
| set complete=.,w,b,t " Word completion rules | |
| set noruler | |
| set number | |
| " display the current mode and partially-typed commands in the status line: | |
| set showmode | |
| set showcmd | |
| runtime! macros/matchit.vim " Load matchit (% to bounce from do to end, etc.) | |
| let &guicursor = &guicursor . ",a:blinkon0" " stops blink wake up | |
| augroup myfiletypes | |
| " autoindent with two spaces, always expand tabs | |
| autocmd FileType ruby,eruby,yaml,ru set ai sw=2 sts=2 et | |
| autocmd FileType html,css set ai sw=2 sts=2 et | |
| augroup END | |
| " some tips taken from http://items.sjbach.com/319/configuring-vim-right | |
| set hidden | |
| nnoremap ' ` | |
| nnoremap ` ' | |
| let mapleader = "," | |
| set wildmenu | |
| " make searches case-insensitive, unless they contain upper-case letters: | |
| set ignorecase | |
| set smartcase | |
| " set backupdir=~/.vim-tmp | |
| " set directory=~/.vim-tmp | |
| "faster scrolling using <C-e> and <C-y> | |
| nnoremap <C-e> 3<C-e> | |
| nnoremap <C-y> 3<C-y> | |
| " bash hotkeys | |
| vmap <C-c> y | |
| vmap <C-x> x | |
| imap <C-v> <esc>p | |
| " FuzzyFinder TextMate | |
| " map <leader>t :FuzzyFinderTextMate<CR> | |
| " map <leader>b :FuzzyFinderBuffer<CR> | |
| " " let g:fuzzy_ignore=*.log,*.swp,*.db | |
| " let g:fuzzy_matching_limit=70 | |
| " NERD_tree | |
| map <leader>d :execute 'NERDTreeToggle ' . getcwd()<CR> | |
| " Intuitive backspacing in insert mode | |
| set backspace=indent,eol,start | |
| " highlight search | |
| set hlsearch | |
| set incsearch " as you type | |
| set shortmess=atI " rid interruptive prompts | |
| set visualbell | |
| set nobackup " Don't leave backup files (swp is good) | |
| set complete=.,w,b,t " Word completion rules | |
| " display the current mode and partially-typed commands in the status line: | |
| set showmode | |
| set showcmd | |
| let &guicursor = &guicursor . ",a:blinkon0" " stops blink wake up | |
| 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 | |
| set nomodeline " don't have files trying to override this .vimrc: | |
| " don'tmake it look like there are line breaks where there aren't: | |
| set wrap | |
| if has("statusline") | |
| set statusline=%<%F%=%([%M%R%H%W]\ %)%l,%c%V\ %P\ (%n) | |
| endif " set statusline format | |
| set showbreak=\\ " show line break | |
| " normally don't automatically format `text' as it is typed, IE only do this | |
| " with comments, at 79 characters: | |
| " set formatoptions-=t | |
| " have the h and l cursor keys wrap between lines (like <Space> and <BkSpc> do | |
| " by default), and ~ covert case over line breaks; also have the cursor keys | |
| " wrap in insert mode: | |
| set whichwrap=h,l,~,[,] | |
| " page down with <Space> (like in `Lynx', `Mutt', `Pine', `Netscape Navigator', | |
| " `SLRN', `Less', and `More'); page up with - (like in `Lynx', `Mutt', `Pine'), | |
| " or <BkSpc> (like in `Netscape Navigator'): | |
| noremap <Space> <PageDown> | |
| noremap <BS> <PageUp> | |
| noremap - <PageUp> | |
| " [<Space> by default is like l, <BkSpc> like h, and - like k.] | |
| " use <F6> to cycle through split windows (and <Shift>+<F6> to cycle backwards, | |
| " where possible): | |
| nnoremap <F6> <C-W>w | |
| nnoremap <S-F6> <C-W>W | |
| " use <Ctrl>+N/<Ctrl>+P to cycle through files: | |
| nnoremap <C-N> :next<CR> | |
| nnoremap <C-P> :prev<CR> | |
| " [<Ctrl>+N by default is like j, and <Ctrl>+P like k.] | |
| " have % bounce between angled brackets, as well as t'other kinds: | |
| set matchpairs+=<:> | |
| map j gj | |
| map k gk | |
| nnoremap <F1> :help<Space> | |
| vmap <F1> <C-C><F1> | |
| omap <F1> <C-C><F1> | |
| map! <F1> <C-C><F1> | |
| " CSS | |
| au FileType css set ft=css | |
| " RUBY | |
| autocmd FileType ruby map <buffer> <leader><space> :w!<cr>:!ruby %<cr> | |
| " Snippets | |
| imap <C-q> <C-]> | |
| " HTML | |
| let html_use_css = 1 | |
| let use_xhtml = 1 | |
| au FileType html set syntax=html | |
| """""""""""""""""""""""""""""" | |
| " HTML | |
| """"""""""""""""""""""""""""""" | |
| autocmd FileType html inorea <buffer> cahref <c-r>=IMAP_PutTextWithMovement('<a href=""><++></a>')<cr> | |
| autocmd FileType html inorea <buffer> cbold <c-r>=IMAP_PutTextWithMovement('<b><++></b>')<cr> | |
| autocmd FileType html inorea <buffer> cimg <c-r>=IMAP_PutTextWithMovement('<img src="<++>" alt="<++>" />')<cr> | |
| autocmd FileType html inorea <buffer> cpara <c-r>=IMAP_PutTextWithMovement('<p><++></p>')<cr> | |
| autocmd FileType html inorea <buffer> ctag <c-r>=IMAP_PutTextWithMovement('<<++>><++></<++>>')<cr> | |
| autocmd FileType html inorea <buffer> ctag1 <c-r>=IMAP_PutTextWithMovement("<<++>><cr><++><cr></<++>>")<cr> | |
| " augroup mkd | |
| " autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:> | |
| " augroup END | |
| map <C-T> <Esc>:tabnew<CR> | |
| " Indent XML readably | |
| function! DoPrettyXML() | |
| 1,$!xmllint --format --recover - | |
| endfunction | |
| command! PrettyXML call DoPrettyXML() | |
| " miniBufExplorer | |
| " allow <C-Tab> and <C-S-Tab> | |
| let g:miniBufExplMapCTabSwitchBufs = 1 | |
| let g:miniBufExplUseSingleClick = 1 | |
| " alt+n or alt+p to navigate between entries in QuickFix | |
| map <silent> <m-p> :cp <cr> | |
| map <silent> <m-n> :cn <cr> | |
| " Rails | |
| " Change which file opens after executing :Rails command | |
| let g:rails_default_file='config/database.yml' | |
| " detect if gui | |
| if has("gui_running") | |
| endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment