Created
April 29, 2010 06:03
-
-
Save acoffman/383210 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 nocompatible | |
" have command-line completion <Tab> (for filenames, help topics, option names) | |
" first list the available options and complete the longest common part, then | |
" have further <Tab>s cycle through the possibilities: | |
set wildmode=list:longest,full | |
" display the current mode and partially-typed commands in the status line: | |
set showmode | |
set showcmd | |
" when using list, keep tabs at their full width and display `arrows': | |
execute 'set listchars+=tab:' . nr2char(187) . nr2char(183) | |
" (Character 187 is a right double-chevron, and 183 a mid-dot.) | |
" have the mouse enabled all the time: | |
set mouse=a | |
" don't have files trying to override this .vimrc: | |
set nomodeline | |
" * Text Formatting -- General | |
" don't make it look like there are line breaks where there aren't: | |
set nowrap | |
" use indents of 2 spaces, and have them copied down lines: | |
set shiftwidth=2 | |
set expandtab | |
" set shiftround | |
set autoindent | |
" normally don't automatically format `text' as it is typed, IE only do this | |
" with comments, at 79 characters: | |
set formatoptions-=t | |
set textwidth=79 | |
" get rid of the default style of C comments, and define a style with two stars | |
" at the start of `middle' rows which (looks nicer and) avoids asterisks used | |
" for bullet lists being treated like C comments; then define a bullet list | |
" style for single stars (like already is for hyphens): | |
set comments-=s1:/*,mb:*,ex:*/ | |
set comments+=s:/*,mb:**,ex:*/ | |
set comments+=fb:* | |
" treat lines starting with a quote mark as comments (for `Vim' files, such as | |
" this very one!), and colons as well so that reformatting usenet messages from | |
" `Tin' users works OK: | |
set comments+=b:\" | |
set comments+=n:: | |
" * Text Formatting -- Specific File Formats | |
" enable filetype detection: | |
filetype on | |
filetype indent on | |
filetype plugin on | |
" for C-like programming, have automatic indentation: | |
autocmd FileType c,cpp,slang set cindent | |
" for actual C (not C++) programming where comments have explicit end | |
" characters, if starting a new line in the middle of a comment automatically | |
" insert the comment leader characters: | |
autocmd FileType c set formatoptions+=ro | |
" for Perl programming, have things in braces indenting themselves: | |
autocmd FileType perl set smartindent | |
" for CSS, also have things in braces indented: | |
autocmd FileType css set smartindent | |
" for HTML, generally format text, but if a long line has been created leave it | |
" alone when editing: | |
autocmd FileType html set formatoptions+=tl | |
" in makefiles, don't expand tabs to spaces, since actual tab characters are | |
" needed, and have indentation at 8 chars to be sure that all indents are tabs | |
" (despite the mappings later): | |
autocmd FileType make set noexpandtab shiftwidth=8 | |
" * Search & Replace | |
" make searches case-insensitive, unless they contain upper-case letters: | |
set ignorecase | |
set smartcase | |
" show the `best match so far' as search strings are typed: | |
set incsearch | |
" assume the /g flag on :s substitutions to replace all matches in a line: | |
set gdefault | |
" * Spelling | |
" have % bounce between angled brackets, as well as t'other kinds: | |
set matchpairs+=<:> | |
" * Keystrokes -- Formatting | |
" have Q reformat the current paragraph (or selected text if there is any): | |
nnoremap Q gqap | |
vnoremap Q gq | |
" have Y behave analogously to D and C rather than to dd and cc (which is | |
" already done by yy): | |
noremap Y y$ | |
set laststatus=2 | |
augroup filetype | |
autocmd BufNewFile,BufRead *.rhtml set filetype=eruby | |
autocmd BufNewFile,BufRead *.erb* set filetype=eruby | |
autocmd BufNewFile,BufRead *.rake set filetype=ruby | |
augroup END | |
syntax on | |
" auto indent | |
set ai | |
" show line numbers | |
set nu | |
set ts=2 | |
set tabstop=2 | |
set shiftwidth=2 | |
set binary noeol | |
set backspace=indent,eol,start | |
set showmatch | |
win 160 60 | |
colorscheme molokai | |
set wildmenu | |
filetype plugin on | |
"Remove the toolbar | |
set guioptions-=T | |
set guioptions-=L | |
set guioptions-=r | |
"better status line | |
set statusline=%<%f%h%m%r%=%{strftime(\"%I:%M:%S\ \%p,\ %a\ %b\ %d,\ %Y\")}\ \ \|\ \ %{&ff}\ %l,%c%V\ %P\ \ | |
"bigger font so i don't go blind | |
set guifont=Monaco:h14 | |
"Sets the location of the ctags command for the TagList plugin | |
let Tlist_Ctags_Cmd = "/usr/local/bin/ctags" | |
"Taglist | |
map \a :TlistToggle<CR> | |
"autogenerate tags | |
let generate_tags=1 | |
" Jump to taglist window on open. | |
let Tlist_GainFocus_On_ToggleOpen = 1 | |
let Tlist_Close_OnSelect=1 | |
" if you are the last window, kill yourself | |
let Tlist_Exist_OnlyWindow = 1 | |
" sort by order or name | |
let Tlist_Sort_Type = "name" | |
" do not show prototypes and not tags in the taglist window. | |
let Tlist_Display_Prototype = 0 | |
" Remove extra information and blank lines from the taglist window. | |
let Tlist_Compart_Format = 1 | |
" Show tag scope next to the tag name. | |
let Tlist_Display_Tag_Scope = 1 | |
let Tlist_WinWidth = 25 | |
" Show only current file | |
let Tlist_Show_One_File = 1 | |
" Dont mess with my titlebar plz | |
let g:ctags_title=0 | |
"replace all tabs with 4 spaces | |
map \ft :%s/ / /g<CR> | |
"FuzzyFinder | |
"Seriously FF, setting up your options sucks | |
if !exists('g:FuzzyFinderOptions') | |
let g:FuzzyFinderOptions = { 'Base':{}, 'Buffer':{}, 'File':{}, 'Dir':{}, 'MruFile':{}, 'MruCmd':{}, 'Bookmark':{}, 'Tag':{}, 'TaggedFile':{}} | |
let g:FuzzyFinderOptions.File.excluded_path = '\v\~$|\.o$|\.exe$|\.bak$|\.swp$|((^|[/\\])\.{1,2}[/\\]$)|\.pyo$|\.pyc$|\.svn[/\\]$' | |
let g:FuzzyFinderOptions.Base.key_open_vsplit = '<Space>' | |
endif | |
let g:fuzzy_matching_limit = 60 | |
let g:fuzzy_ceiling = 50000 | |
let g:fuzzy_ignore = "*.log;*.git;*.pyc;*.svn;" | |
map <silent> \f :FuzzyFinderTextMate<CR> | |
map <silent> \F :FuzzyFinderTextMateRefreshFiles<CR>:FuzzyFinderTextMate<CR> | |
map <silent> \b :FuzzyFinderBuffer!<CR> | |
"NERDTree | |
map <silent> \e :NERDTreeToggle<CR> | |
let NERDTreeWinPos='right' | |
let NERDTreeChDirMode='2' | |
let NERDTreeIgnore=['\.vim$', '\~$', '\.pyo$', '\.pyc$', '\.svn[\//]$', '\.swp$', '\.git[\//]$'] | |
set et | |
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1 | |
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1 | |
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1 | |
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete | |
"remove trailing whitespace and ^M when source files are open and closed | |
"autocmd BufWritePre *.rb,*.cpp,*.pde,*.java,*.c :%s/\s\+$//e | |
"autocmd BufEnter *.rb,*.cpp,*.pde,*.java,*.c :%s/[ \t\r]\+$//e | |
"split stuff | |
nmap <silent> <C-Up> :wincmd k<CR> | |
nmap <silent> <C-Down> :wincmd j<CR> | |
nmap <silent> <C-Left> :wincmd h<CR> | |
nmap <silent> <C-Right> :wincmd l<CR> | |
nmap <silent> <C-n> :vsplit <CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment