Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add .vim folder to dotfiles repo

  • Loading branch information...
commit 2d1ea25d1492b2cb98697bbef276ff144dbfc6c6 1 parent 1e0d904
Wade Simmons wadey authored
139 vim/autoload/pathogen.vim
View
@@ -0,0 +1,139 @@
+" pathogen.vim - path option manipulation
+" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
+" Version: 1.2
+
+" 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
+
+" Returns a hash indicating which filetype features are enabled.
+function! pathogen#filetype() abort " {{{1
+ redir => output
+ silent filetype
+ redir END
+ let result = {}
+ let result.detection = match(output,'detection:ON') >= 0
+ let result.indent = match(output,'indent:ON') >= 0
+ let result.plugin = match(output,'plugin:ON') >= 0
+ return result
+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'
+ 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
+
+" }}}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:
74 vim/colors/twilight.vim
View
@@ -0,0 +1,74 @@
+" Maintainer: Yoshimasa NIWA<niw@disense.com>
+" Last Change: 14 Jun 2006
+
+set background=dark
+hi clear
+if exists("syntax_on")
+ syntax reset
+endif
+
+let g:colors_name="twilight"
+
+hi Normal guifg=#F8F8F8 guibg=#141414
+hi Cursor guifg=#F8F8F8 guibg=#A7A7A7
+hi CursorIM guifg=#F8F8F8 guibg=#5F5A60
+hi Directory guifg=#8F9D6A guibg=#141414
+hi ErrorMsg guifg=#CF6A4C guibg=#420E09
+hi VertSplit guifg=#AC885B guibg=#FFFFFF
+hi Folded guifg=#F9EE98 guibg=#494949
+hi IncSearch guifg=#000000 guibg=#CF6A4C
+hi LineNr guifg=#7587A6 guibg=#000000
+hi ModeMsg guifg=#CF7D34 guibg=#E9C062
+hi MoreMsg guifg=#CF7D34 guibg=#E9C062
+hi NonText guifg=#D2A8A1 guibg=#141414
+hi Question guifg=#7587A6 guibg=#0E2231
+hi Search guifg=#420E09 guibg=#CF6A4C
+hi SpecialKey guifg=#CF7D34 guibg=#141414
+hi StatusLine guifg=#0E2231 guibg=#8693A5
+hi StatusLineNC guifg=#7587A6 guibg=#F8F8F8
+hi Title guifg=#8B98AB guibg=#0E2231
+hi Visual guifg=#0E2231 guibg=#AFC4DB
+hi WarningMsg guifg=#CF6A4C guibg=#420E09
+hi WildMenu guifg=#AFC4DB guibg=#0E2231
+
+"Syntax hilight groups
+
+hi Comment guifg=#8F9D6A
+hi Constant guifg=#CF6A4C
+hi String guifg=#8F9D6A
+hi Character guifg=#E9C062
+hi Number guifg=#9B859D
+hi Boolean guifg=#CF6A4C
+hi Float guifg=#562D56
+hi Identifier guifg=#9B703F
+hi Function guifg=#9B5C2E
+hi Statement guifg=#CF7D34
+hi Conditional guifg=#9B703F
+hi Repeat guifg=khaki
+hi Label guifg=#E9C062
+hi Operator guifg=#CF6A4C
+hi Keyword guifg=#E9C062
+hi Exception guifg=khaki
+hi PreProc guifg=khaki4
+hi Include guifg=khaki4
+hi Define guifg=khaki1
+hi Macro guifg=#9B703F
+hi PreCondit guifg=khaki3
+hi Type guifg=khaki3
+hi StorageClass guifg=tan
+hi Structure guifg=DarkGoldenrod
+hi Typedef guifg=khaki3
+hi Special guifg=IndianRed
+hi SpecialChar guifg=DarkGoldenrod
+hi Tag guifg=DarkKhaki
+hi Delimiter guifg=DarkGoldenrod
+hi SpecialComment guifg=cornsilk
+hi Debug guifg=brown
+hi Underlined guifg=#Cf6A4C
+hi Ignore guifg=#494949
+hi Error guifg=#CF6A4C guibg=#420E09
+hi Todo guifg=#7587A6 guibg=#0E2231
+hi Pmenu guifg=#141414 guibg=#CDA869
+hi PmenuSel guifg=#F8F8F8 guibg=#9B703F
+hi PmenuSbar guibg=#DAEFA3
+hi PmenuThumb guifg=#8F9D6A
5 vim/update
View
@@ -0,0 +1,5 @@
+#!/bin/sh -x
+
+mkdir -p bundle
+./update_bundles
+(cd bundle/command-t && rake make)
74 vim/update_bundles
View
@@ -0,0 +1,74 @@
+#!/usr/bin/env ruby
+
+# Based on example from:
+# http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen
+
+git_bundles = [
+ "git://github.com/tpope/vim-fugitive.git",
+ "git://github.com/tpope/vim-git.git",
+ "git://github.com/kchmck/vim-coffee-script.git",
+ "git://github.com/pangloss/vim-javascript.git",
+ "git://git.wincent.com/command-t.git",
+ "git://github.com/tsaleh/vim-align.git",
+ "git://github.com/tsaleh/vim-supertab.git",
+ "git://github.com/tsaleh/vim-tcomment.git"
+]
+
+vim_org_scripts = [
+ ["puppet_syntax", "8052", "syntax"],
+ ["IndexedSearch", "7062", "plugin"]
+]
+
+vim_org_zips = [
+ ["puppet_syntax", "8052"]
+]
+
+url_scripts = [
+ ["thrift", "https://svn.apache.org/repos/asf/thrift/trunk/contrib/thrift.vim", "syntax"]
+]
+
+require 'fileutils'
+require 'open-uri'
+
+bundles_dir = File.join(File.dirname(__FILE__), "bundle")
+
+FileUtils.cd(bundles_dir)
+
+puts "Trashing everything (lookout!)"
+Dir["*"].each {|d| FileUtils.rm_rf d }
+
+git_bundles.each do |url|
+ dir = url.split('/').last.sub(/\.git$/, '')
+ puts " Unpacking #{url} into #{dir}"
+ `git clone #{url} #{dir}`
+ 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
+
+vim_org_zips.each do |name, script_id|
+ puts " Downloading #{name} ZIP"
+ local_file = File.join(name, "#{name}.zip")
+ local_dir = File.dirname(local_file)
+ FileUtils.mkdir_p(local_dir)
+ File.open(local_file, "w") do |file|
+ file << open("http://www.vim.org/scripts/download_script.php?src_id=#{script_id}").read
+ end
+ `cd #{local_dir} && unzip #{name}.zip`
+end
+
+url_scripts.each do |name, script_url, 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(script_url).read
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.