Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
amerine committed Dec 28, 2010
0 parents commit 0b3eaf7
Show file tree
Hide file tree
Showing 162 changed files with 36,640 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
@@ -0,0 +1,7 @@
.netrwhist

swapfiles/*
undofiles/*

bundle/vim-peepopen
snippets
80 changes: 80 additions & 0 deletions README.rdoc
@@ -0,0 +1,80 @@
= Mark Turner's .vim

Welcome to the magical world of my .vim. I use this setup every day and
finally decided to share it with the world... or at least my co-workers.

It is based primarily on the work of {Ben Bleything}[http://bleything.net],
the people that inspired him, and the crew at {Opscode}[http://opscode.com].
See the Credits section below for more details.

== Installation

Pretty straightforward. Clone and symlink:

$ git clone git://github.com/amerine/dotvim.git ~/.vim
$ ln -s ~/.vim/vimrc ~/.vimrc

Then install/update the bundles:

$ cd ~/.vim && rake update:bundles

The link the snippets:

$ cd ~/.vim/bundle/snipmate_snippets && rake install

== Basics

* My personal settings
* The {mustang}[http://www.deviantart.com/download/98974484/Mustang_Vim_Colorscheme_by_hcalves.vim] color scheme

=== Plugins

* {ack.vim}[http://www.vim.org/scripts/script.php?script_id=2572]
* {Buffer Explorer}[http://www.vim.org/scripts/download_script.php?src_id=14208]
* {CamelCaseMotion}[http://www.vim.org/scripts/script.php?script_id=1905]
* {fugitive.vim}[https://github.com/tpope/vim-fugitive]
* {NERD Commenter}[http://www.vim.org/scripts/download_script.php?src_id=14455]
* {NERD Tree}[http://www.vim.org/scripts/download_script.php?src_id=11834]
* {Pathogen}[http://www.vim.org/scripts/script.php?script_id=2332]
* {ragtag.vim}[https://github.com/tpope/vim-ragtag]
* {Rails}[https://github.com/tpope/vim-rails.git]
* {Ruby-Refactoring}[https://github.com/ecomba/vim-ruby-refactoring]
* {Snipmate}[https://github.com/msanders/snipmate.vim]
* {Snipmate-snippets}[https://github.com/scrooloose/snipmate-snippets]
* {Specky}[https://github.com/vim-scripts/Specky]
* {surround.vim}[https://github.com/tpope/vim-surround]
* {Tabular}[https://github.com/godlygeek/tabular]
* {Taglist}[http://www.vim.org/scripts/script.php?script_id=273]

=== Syntax

* {Git}[http://www.vim.org/scripts/script.php?script_id=1654]
* {vim-haml}[https://github.com/tpope/vim-haml]
* {HTML5}[https://github.com/othree/html5-syntax.vim]
* {JSON}[http://www.vim.org/scripts/script.php?script_id=1945]
* {Markdown}[http://github.com/ujihisa/vim-markdown]
* {nginx}[http://www.vim.org/scripts/script.php?script_id=1886]
* {RDoc}[http://www.vim.org/scripts/script.php?script_id=2878]
* {Textile}[http://www.vim.org/scripts/script.php?script_id=2305]

== Credits

[Ben Bleything] Without Ben's amazing {dotvim}[https://github.com/bleything/dotvim] none of this would have
been possible. Thanks Ben! You should read his {blog}[http://bleything.net] and stalk him on
{twitter}[http://twitter.com/bleything]. Also, buy him a beer whenever you can.

[Mahlon Smith] Responsible for getting me into vi in the first place and
providing a ton of support, tips, and tricks over the years.
You should go read {this blog post he wrote}[http://martini.nu/blog/2008/07/vim.html]
about his vim setup.

[Adam Jacob] Upon whose config Joshua and AJ based their tweaks.
Available on {the git hubs}[http://github.com/adamhjk/adam-vim].

[Joshua Timberman] Various tweaks to Adam's config, available on {the git
hubs}[http://github.com/jtimberman/dotvim].

[AJ Christensen] Various tweaks to Adam's config, available on {the git
hubs}[http://github.com/fujin/dotvim].

[Other Folks] The authors of the plugins and syntax defined above.
79 changes: 79 additions & 0 deletions Rakefile
@@ -0,0 +1,79 @@
require 'pathname'

task :default do
puts "update the bundles:"
puts # blank line
puts " $ rake update:bundles"
end

namespace :update do

BUNDLES = {
# plugins
:ack => "git://github.com/mileszs/ack.vim.git",
:bufexplorer => "http://www.vim.org/scripts/download_script.php?src_id=14208",
:fugitive => "git://github.com/tpope/vim-fugitive.git",
:nerdcommenter => "git://github.com/scrooloose/nerdcommenter.git",
:nerdtree => "git://github.com/scrooloose/nerdtree.git",
:ragtag => "git://github.com/tpope/vim-ragtag.git",
:rails => "git://github.com/tpope/vim-rails.git",
:ruby_refactoring => "git://github.com/ecomba/vim-ruby-refactoring.git",
:snipmate => "git://github.com/msanders/snipmate.vim.git",
:snipmate_snippets => "git@github.com:amerine/snipmate-snippets.git",
:specky => "git://github.com/vim-scripts/Specky.git",
:surround => "git://github.com/tpope/vim-surround.git",
:tabular => "git://github.com/godlygeek/tabular",
:taglist => "http://www.vim.org/scripts/download_script.php?src_id=7701",
:textobj_user => "git://github.com/kana/vim-textobj-user.git",
:textobj_rubyblock => "git://github.com/nelstrom/vim-textobj-rubyblock.git",

# syntax definitions
:syntax_git => "git://github.com/tpope/vim-git.git",
:syntax_haml => "git://github.com/tpope/vim-haml.git",
:syntax_html5 => "git://github.com/othree/html5-syntax.vim.git",
:syntax_json => "git://github.com/leshill/vim-json.git",
:syntax_markdown => "git://github.com/ujihisa/vim-markdown.git",
:syntax_rdoc => "git://github.com/hallison/vim-rdoc.git",
:syntax_textile => "git://github.com/timcharper/textile.vim.git"
}

desc "update any bundles defined in the Rakefile"
task :bundles do

bundle_home = Pathname.new( ENV['HOME'] ) + '.vim' + 'bundle'
mkdir_p bundle_home

BUNDLES.sort_by {|k,v| k.to_s }.each do |bundle, location|
target_path = bundle_home + bundle.to_s

puts "*" * 72
puts "*** Instaling #{bundle} to #{target_path} from #{location}"
puts # blank line

rm_rf target_path

case location.match( /^(.*?):/ )[1]
when 'git'
sh "git clone #{location} #{target_path} > /dev/null"
rm_rf target_path + '.git'
when 'http'
mkdir_p target_path
sh "cd #{target_path} && curl -s '#{location}' | tar zx -"
end

docdir = target_path + 'doc'
if docdir.exist?
puts "doc dir exists; tagging"
sh "vim -u NONE -esX -c 'helptags #{docdir}' -c quit"
end

puts # blank line
puts "Removing the snippets included in snipmate"
rm_rf Pathname.new( ENV['HOME'] ) + '.vim' + 'bundle' + 'snipmate' + 'snippets'

puts # blank line
end
end # task :bundles

end # namespace :update

134 changes: 134 additions & 0 deletions autoload/pathogen.vim
@@ -0,0 +1,134 @@
" pathogen.vim - path option manipulation
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Version: 1.2
"
" http://www.vim.org/scripts/script.php?script_id=2332
"
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
"
" API is documented below.

if exists("g:loaded_pathogen") || &cp
finish
endif
let g:loaded_pathogen = 1

" Split a path into a list.
function! pathogen#split(path) abort " {{{1
if type(a:path) == type([]) | return a:path | endif
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
endfunction " }}}1

" Convert a list to a path.
function! pathogen#join(...) abort " {{{1
if type(a:1) == type(1) && a:1
let i = 1
let space = ' '
else
let i = 0
let space = ''
endif
let path = ""
while i < a:0
if type(a:000[i]) == type([])
let list = a:000[i]
let j = 0
while j < len(list)
let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
let path .= ',' . escaped
let j += 1
endwhile
else
let path .= "," . a:000[i]
endif
let i += 1
endwhile
return substitute(path,'^,','','')
endfunction " }}}1

" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
function! pathogen#legacyjoin(...) abort " {{{1
return call('pathogen#join',[1] + a:000)
endfunction " }}}1

" Remove duplicates from a list.
function! pathogen#uniq(list) abort " {{{1
let i = 0
let seen = {}
while i < len(a:list)
if has_key(seen,a:list[i])
call remove(a:list,i)
else
let seen[a:list[i]] = 1
let i += 1
endif
endwhile
return a:list
endfunction " }}}1

" \ on Windows unless shellslash is set, / everywhere else.
function! pathogen#separator() abort " {{{1
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction " }}}1

" Convenience wrapper around glob() which returns a list.
function! pathogen#glob(pattern) abort " {{{1
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#separator()."/]$","","")')
endfunction "}}}1

" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort " {{{1
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction "}}}1

" Prepend all subdirectories of path to the rtp, and append all after
" directories in those subdirectories.
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
let sep = pathogen#separator()
let before = pathogen#glob_directories(a:path.sep."*[^~]")
let after = pathogen#glob_directories(a:path.sep."*[^~]".sep."after")
let rtp = pathogen#split(&rtp)
let path = expand(a:path)
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
let &rtp = pathogen#join(pathogen#uniq(before + rtp + after))
return &rtp
endfunction " }}}1

" For each directory in rtp, check for a subdirectory named dir. If it
" exists, add all subdirectories of that subdirectory to the rtp, immediately
" after the original directory. If no argument is given, 'bundle' is used.
" Repeated calls with the same arguments are ignored.
function! pathogen#runtime_append_all_bundles(...) " {{{1
let sep = pathogen#separator()
let name = a:0 ? a:1 : 'bundle'
if "\n".s:done_bundles =~# "\\M\n".name."\n"
return ""
endif
let s:done_bundles .= name . "\n"
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
let list += pathogen#glob_directories(substitute(dir,'after$',name.sep.'*[^~]'.sep.'after','')) + [dir]
else
let list += [dir] + pathogen#glob_directories(dir.sep.name.sep.'*[^~]')
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction

let s:done_bundles = ''
" }}}1

" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() " {{{1
for dir in pathogen#split(&rtp)
if dir[0 : strlen($VIM)-1] !=# $VIM && isdirectory(dir.'/doc') && (!filereadable(dir.'/doc/tags') || filewritable(dir.'/doc/tags'))
helptags `=dir.'/doc'`
endif
endfor
endfunction " }}}1

" vim:set ft=vim ts=8 sw=2 sts=2:
18 changes: 18 additions & 0 deletions basic
@@ -0,0 +1,18 @@
"BASIC OPTIONS
set nocompatible
set wildmenu

" Miscellaneous Options. Values:
" a: ":read" sets window filename
" A: ":write" sets window filename
" B: backslash has no special meaning in ":map"
" c: search continues from the end of the match
" e: automatically add <CR> to the end of executed registers
" F: ":write" sets buffer filename
" s: set buffer options on entering the buffer
" W: refuse to overwrite a readonly file, even with :w!
" Z: don't reset 'readonly' when using :w!
set cpoptions=aABceFsWZ
set wildignore+=*.png,*.jpg,*.gif,*.ai,*.jpeg,*.psd,*.swp,*.jar,*.zip,*.gem,.DS_Store,log/**,tmp/**,coverage/**,rdoc/**
set list
set spell
51 changes: 51 additions & 0 deletions bindings
@@ -0,0 +1,51 @@
"KEY BINDINGS
let mapleader=',' " set leader to ,

" format paragraphs (72 columns)
map ^^ {!}par w72qrg<CR>

" one-stroke window maximizing
map <C-H> <C-W>h<C-W><BAR>
map <C-L> <C-W>l<C-W><BAR>
map <C-J> <C-W>j<C-W>_
map <C-K> <C-W>k<C-W>_

" quick buffer switching
map <leader>[ :bprevious<CR>
map <leader>] :bnext<CR>

" shortcut to strip trailing whitespace
map <leader>s :s/\s\+$//g<CR>

" Replicate textmate CMD-[ and CMD-] for indentation
nmap <D-[> <<
nmap <D-]> >>
vmap <D-[> <gv
vmap <D-]> >gv

" Replicate textmate shift arrow/movement in order to select stuff
nmap <S-up> vk
vmap <S-up> k
nmap <S-k> vk
vmap <S-k> k

nmap <S-right> vl
vmap <S-right> l
nmap <S-l> vl
vmap <S-l> l

nmap <S-down> vj
vmap <S-down> j
nmap <S-j> vj
vmap <S-j> j

nmap <S-left> v
vmap <S-left> h
nmap <S-h> vh
vmap <S-h> h

" use command+r to execute my ruby code
nmap <D-r> :!ruby %<CR>

" retab the document (tabs to spaces)
nmap <silent> <leader><S-t> :retab!<CR>
1 change: 1 addition & 0 deletions bundle/ack/.gitignore
@@ -0,0 +1 @@
tags

0 comments on commit 0b3eaf7

Please sign in to comment.