From 06a80f143a3c681cc9a81a0879a131bcfeae9a92 Mon Sep 17 00:00:00 2001 From: Rohan Deshpande Date: Tue, 31 Jan 2012 16:49:01 -0800 Subject: [PATCH] Updates from Benny --- .gitignore | 1 + vim/autoload/pathogen.vim | 230 ------------------------------------- vim/snippets/ruby.snippets | 24 ++++ vim/update_bundles.rb | 17 ++- vim/vimrc | 3 + 5 files changed, 35 insertions(+), 240 deletions(-) delete mode 100644 vim/autoload/pathogen.vim create mode 100644 vim/snippets/ruby.snippets diff --git a/.gitignore b/.gitignore index d161839..bdecf73 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ vim/doc/* .netrwhist vim/bundle zsh/work.sh +vim/autoload diff --git a/vim/autoload/pathogen.vim b/vim/autoload/pathogen.vim deleted file mode 100644 index be68389..0000000 --- a/vim/autoload/pathogen.vim +++ /dev/null @@ -1,230 +0,0 @@ -" pathogen.vim - path option manipulation -" Maintainer: Tim Pope -" Version: 2.0 - -" Install in ~/.vim/autoload (or ~\vimfiles\autoload). -" -" For management of individually installed plugins in ~/.vim/bundle (or -" ~\vimfiles\bundle), adding `call pathogen#infect()` to your .vimrc -" prior to `fileype plugin indent on` is the only other setup necessary. -" -" The API is documented inline below. For maximum ease of reading, -" :set foldmethod=marker - -if exists("g:loaded_pathogen") || &cp - finish -endif -let g:loaded_pathogen = 1 - -" Point of entry for basic default usage. Give a directory name to invoke -" pathogen#runtime_append_all_bundles() (defaults to "bundle"), or a full path -" to invoke pathogen#runtime_prepend_subdirectories(). Afterwards, -" pathogen#cycle_filetype() is invoked. -function! pathogen#infect(...) abort " {{{1 - let source_path = a:0 ? a:1 : 'bundle' - if source_path =~# '[\\/]' - call pathogen#runtime_prepend_subdirectories(source_path) - else - call pathogen#runtime_append_all_bundles(source_path) - endif - call pathogen#cycle_filetype() -endfunction " }}}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,'\\\@,'edit',) -command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(,'edit',) -command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(,'split',) -command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(,'vsplit',) -command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(,'tabedit',) -command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(,'pedit',) -command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(,'read',) -command! -bar -bang -count=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(,'edit',,'lcd') - -" vim:set ft=vim ts=8 sw=2 sts=2: diff --git a/vim/snippets/ruby.snippets b/vim/snippets/ruby.snippets new file mode 100644 index 0000000..5dce39b --- /dev/null +++ b/vim/snippets/ruby.snippets @@ -0,0 +1,24 @@ +snippet desc Describe subject + describe "${1:subject}" do + ${2} + end +snippet cont Context + context "${1:subject}" do + ${2} + end +snippet it it block + it "${1:should do something}" do + ${2} + end +snippet bef Before each test + before do + ${1} + end +snippet aft After each test + after do + ${1} + end +snippet let + let(:${1}) { ${2} } +snippet its + its(:${1}) { ${2} } diff --git a/vim/update_bundles.rb b/vim/update_bundles.rb index c2dabdf..3dd05c2 100755 --- a/vim/update_bundles.rb +++ b/vim/update_bundles.rb @@ -3,17 +3,18 @@ git_bundles = [ "git://github.com/tpope/vim-fugitive.git", "https://github.com/sickill/vim-pasta.git", + "https://github.com/kien/ctrlp.vim.git", "git://github.com/tpope/vim-haml.git", "git://github.com/kchmck/vim-coffee-script.git", "git://github.com/Raimondi/delimitMate", + "https://github.com/tpope/vim-endwise.git", "https://github.com/kchmck/vim-coffee-script.git", "git://github.com/tpope/vim-rails.git", "git://github.com/tpope/vim-repeat.git", "git://github.com/tpope/vim-surround.git", + "https://github.com/msanders/snipmate.vim.git", "https://github.com/scrooloose/syntastic.git", "git://github.com/tsaleh/vim-align.git", - "git://github.com/vim-ruby/vim-ruby.git", - "git://github.com/edsono/vim-matchit.git", "git://github.com/pangloss/vim-javascript", ] @@ -21,8 +22,10 @@ require 'open-uri' bundles_dir = File.join(File.dirname(__FILE__), "bundle") +autoload_dir = File.join(File.dirname(__FILE__), "autoload") FileUtils.mkdir_p(bundles_dir) +FileUtils.mkdir_p(autoload_dir) Dir.chdir(bundles_dir) do @@ -36,12 +39,6 @@ FileUtils.rm_rf(File.join(dir, ".git")) end - vim_org_scripts.each do |name, script_id, script_type| - puts " Downloading #{name}" - local_file = File.join(name, script_type, "#{name}.vim") - FileUtils.mkdir_p(File.dirname(local_file)) - File.open(local_file, "w") do |file| - file << open("http://www.vim.org/scripts/download_script.php?src_id=#{script_id}").read - end - end + puts "installing pathogen" + `curl -so ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/HEAD/autoload/pathogen.vim` end diff --git a/vim/vimrc b/vim/vimrc index 28a337f..9b34aac 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -78,3 +78,6 @@ let g:pasta_enabled_filetypes = ['ruby', 'javascript', 'css', 'sh'] " Consider question/exclamation marks to be part of a Vim word. autocmd FileType ruby set iskeyword=@,48-57,_,?,!,192-255 autocmd FileType scss set iskeyword=@,48-57,_,-,?,!,192-255 + +" Reload Vimrc +map rv :source ~/.vimrc