Add vim dotfiles

pull/28/head
Alpha Chen 10 years ago
parent bab1979d4b
commit 7632f23d10

96
.gitmodules vendored

@ -0,0 +1,96 @@
[submodule ".vim/bundle/vim-pandoc"]
path = vim/.vim/bundle/vim-pandoc
url = git://github.com/vim-pandoc/vim-pandoc.git
[submodule ".vim/bundle/vim-textobj-user"]
path = vim/.vim/bundle/vim-textobj-user
url = git://github.com/kana/vim-textobj-user.git
[submodule ".vim/bundle/vim-textobj-line"]
path = vim/.vim/bundle/vim-textobj-line
url = git://github.com/kana/vim-textobj-line.git
[submodule ".vim/bundle/argtextobj.vim"]
path = vim/.vim/bundle/argtextobj.vim
url = git://github.com/vim-scripts/argtextobj.vim.git
[submodule ".vim/bundle/gist-vim"]
path = vim/.vim/bundle/gist-vim
url = git://github.com/mattn/gist-vim.git
[submodule ".vim/bundle/vim-textobj-rubyblock"]
path = vim/.vim/bundle/vim-textobj-rubyblock
url = git://github.com/nelstrom/vim-textobj-rubyblock.git
[submodule ".vim/bundle/vim-indent-object"]
path = vim/.vim/bundle/vim-indent-object
url = git://github.com/michaeljsmith/vim-indent-object.git
[submodule ".vim/bundle/vim-colors-solarized"]
path = vim/.vim/bundle/vim-colors-solarized
url = git://github.com/altercation/vim-colors-solarized.git
[submodule ".vim/bundle/vim-commentary"]
path = vim/.vim/bundle/vim-commentary
url = git://github.com/tpope/vim-commentary.git
[submodule ".vim/bundle/vim-repeat"]
path = vim/.vim/bundle/vim-repeat
url = git://github.com/tpope/vim-repeat.git
[submodule ".vim/bundle/vimux"]
path = vim/.vim/bundle/vimux
url = git://github.com/benmills/vimux.git
[submodule ".vim/bundle/vim-surround"]
path = vim/.vim/bundle/vim-surround
url = git://github.com/tpope/vim-surround.git
[submodule ".vim/bundle/tabular"]
path = vim/.vim/bundle/tabular
url = git://github.com/godlygeek/tabular.git
[submodule ".vim/bundle/vim-ruby"]
path = vim/.vim/bundle/vim-ruby
url = git://github.com/vim-ruby/vim-ruby.git
[submodule ".vim/bundle/vim-fugitive"]
path = vim/.vim/bundle/vim-fugitive
url = git://github.com/tpope/vim-fugitive.git
[submodule ".vim/bundle/vim-coffee-script"]
path = vim/.vim/bundle/vim-coffee-script
url = git://github.com/kchmck/vim-coffee-script.git
[submodule ".vim/bundle/vim-haml"]
path = vim/.vim/bundle/vim-haml
url = git://github.com/tpope/vim-haml.git
[submodule ".vim/bundle/bufkill"]
path = vim/.vim/bundle/bufkill
url = git://github.com/vim-scripts/bufkill.vim.git
[submodule ".vim/bundle/vim-easymotion"]
path = vim/.vim/bundle/vim-easymotion
url = git://github.com/Lokaltog/vim-easymotion.git
[submodule ".vim/bundle/vim-seek"]
path = vim/.vim/bundle/vim-seek
url = git://github.com/goldfeld/vim-seek.git
[submodule ".vim/bundle/gundo"]
path = vim/.vim/bundle/gundo
url = git://github.com/sjl/gundo.vim.git
[submodule ".vim/bundle/vim-dispatch"]
path = vim/.vim/bundle/vim-dispatch
url = git://github.com/tpope/vim-dispatch.git
[submodule ".vim/bundle/tagbar"]
path = vim/.vim/bundle/tagbar
url = git://github.com/majutsushi/tagbar.git
[submodule ".vim/bundle/ctrlp"]
path = vim/.vim/bundle/ctrlp
url = git@github.com:kien/ctrlp.vim.git
[submodule ".vim/bundle/sensible"]
path = vim/.vim/bundle/sensible
url = git@github.com:tpope/vim-sensible.git
[submodule ".vim/bundle/base16"]
path = vim/.vim/bundle/base16
url = git://github.com/chriskempson/base16-vim.git
[submodule "vim/.vim/bundle/fakeclip"]
path = vim/.vim/bundle/fakeclip
url = https://github.com/kana/vim-fakeclip
[submodule "vim/.vim/bundle/ag"]
path = vim/.vim/bundle/ag
url = git@github.com:rking/ag.vim.git
[submodule "vim/.vim/bundle/vimwiki"]
path = vim/.vim/bundle/vimwiki
url = https://github.com/vimwiki/vimwiki
[submodule "vim/.vim/bundle/vinegar"]
path = vim/.vim/bundle/vinegar
url = git://github.com/tpope/vim-vinegar.git
[submodule "vim/.vim/bundle/go"]
path = vim/.vim/bundle/go
url = https://github.com/fatih/vim-go.git
[submodule "vim/.vim/bundle/vim-tmux-navigator"]
path = vim/.vim/bundle/vim-tmux-navigator
url = git@github.com:christoomey/vim-tmux-navigator.git

@ -1,3 +1,3 @@
[defaults] [defaults]
hostfile = my.hosts hostfile = hosts
# ask_sudo_pass = True # ask_sudo_pass = True

@ -0,0 +1 @@
tComment.vba: call delete('C:\Users\alphach\vimfiles/doc/tComment.txt')|call delete('C:\Users\alphach\vimfiles/plugin/tComment.vim')|call delete('C:\Users\alphach\vimfiles/autoload/tcomment.vim')

@ -0,0 +1,6 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhist_cnt =4
let g:netrw_dirhist_1='/Users/alpha/Dropbox/conf_dir/Alfred 2/Alfred.alfredpreferences/workflows'
let g:netrw_dirhist_2='/Users/alpha/src/sm/sm-cap/.bundle/gems/chef-api-0.2.1'
let g:netrw_dirhist_3='/Users/alpha/Dropbox/src/github.com/kejadlen/dotfiles/ansible'
let g:netrw_dirhist_4='/Users/alpha/src/sm/sd-worker'

@ -0,0 +1,5 @@
PIP (Save OR Preserve OR Site OR Historic OR "#PreserveDMV" OR landmark OR PartnersinPres OR "Partners in Preservation" OR Amex OR AmericanExpress OR "American Express" OR "National Trust" OR "@PresNation" OR Preservation OR Grant OR Grants OR Win OR Vote OR Cast OR Ballot OR "@PartnersinPres" OR "@AmericanExpress" OR "Partners in Pres" OR "#AspinHill" OR "#AllSoulsUUDC" OR "#ArlingtonHouse" OR "#AthenaeumNVFAA" OR "#COCanal" OR "#CarterWoodson" OR "#clarabarton" OR "#ColvinRunMill" OR "#CongCemetery" OR "#DarbyGeneral" OR "#DOaksPark" OR "#GeorgeMasonMem" OR "#Greenbelttheatre" OR "#GUObservatory" OR "#LAMBPCS" OR "#LivingClassrooms" OR MetroAMEC OR "#MountVernon" OR "#NMWA" OR "#SixthandI" OR "#TeatroGALA" OR "#USMCMemorial" OR "#WNCathedral" OR "@MoCoHumane" OR "@allsoulsuudc" OR "@ArlingtonNPS" OR "@AthenaeumNVFAA" OR "@WoodsonNPS" OR "@CivilWarMed" OR "@fairfaxparks" OR "@CongCemetery" OR "@MontgomeryParks" OR "@DOaksPark" OR "@cityofgreenbelt" OR "@LAMBPCS" OR "@livingclassroom" OR "@MetropolitanAME" OR "@VisitMtVernon" OR "@WomenInTheArts" OR "@SixthandI" OR "@TeatroGALA" OR "@NPSGWMP" OR "@WNCathedral" OR "Aspin Hill" OR "Aspin Hill Kennel" OR "Aspin Hill Memorial Park" OR "All Souls Church Unitarian" OR "All Souls Church" OR "All Souls Unitarian" OR "All Souls D.C." OR "All Souls DC" OR "Arlington House" OR Athenaeum OR "Athenaeum NVFAA" OR "C&O Canal" OR "C&O Abner" OR "C&O Cloud House" OR (C AND "O Canal") OR (C AND "O Abner") OR (C AND "O Cloud House") OR "Abner Cloud House" OR "Carter G. Woodson Home" OR "Carter G Woodson Home" OR "Woodson Home" OR "Carter G Home" OR "Carter G. Home" OR "Clara Barton's Missing Soldiers Office" OR "Clara Bartons Missing Soldiers Office" OR "Clara Barton" OR "Colvin Run Mill" OR "Congressional Cemetery" OR "Con Cemetery" OR "Darby Store" OR "Darby General Store" OR "Darby General" OR "Dumbarton Oaks Park" OR "Dumbarton Oaks" OR "Dumbarton Park" OR Dumbarton OR "Metropolitan AME" OR "Metro AME" OR "Mount Vernon" OR "Mt. Vernon" OR "Mt Vernon" OR "Tivoli Square")
Win ("#AspinHill" OR "#AllSoulsUUDC" OR "#ArlingtonHouse" OR "#AthenaeumNVFAA" OR "#COCanal" OR "#CarterWoodson" OR "#clarabarton" OR "#ColvinRunMill" OR "#CongCemetery" OR "#DarbyGeneral" OR "#DOaksPark" OR "#GeorgeMasonMem" OR "#Greenbelttheatre" OR "#GUObservatory" OR "#LAMBPCS" OR "#LivingClassrooms" OR MetroAMEC OR "#MountVernon" OR "#NMWA" OR "#SixthandI" OR "#TeatroGALA" OR "#USMCMemorial" OR "#WNCathedral" OR "#MeridianHill" OR "@MoCoHumane" OR "@allsoulsuudc" OR "@ArlingtonNPS" OR "@AthenaeumNVFAA" OR "@WoodsonNPS" OR "@CivilWarMed" OR "@fairfaxparks" OR "@CongCemetery" OR "@MontgomeryParks" OR "@DOaksPark" OR "@cityofgreenbelt" OR "@LAMBPCS" OR "@livingclassroom" OR "@MetropolitanAME" OR "@VisitMtVernon" OR "@WomenInTheArts" OR "@SixthandI" OR "@TeatroGALA" OR "@NPSGWMP" OR "@WNCathedral" OR "@Georgetown" OR "Aspin Hill" OR "Aspin Hill Kennel" OR "Aspin Hill Memorial Park" OR "All Souls Church Unitarian" OR "All Souls Church" OR "All Souls Unitarian" OR "All Souls D.C." OR "All Souls D.C" OR "All Souls DC" OR "Arlington House" OR Athenaeum OR "Athenaeum NVFAA" OR "C&O Canal" OR "C&O Abner" OR "C&O Cloud House" OR (C AND "O Canal") OR (C AND "O Abner") OR (C AND "O Cloud House") OR "Abner Cloud House" OR "Carter G. Woodson Home" OR "Carter G Woodson Home" OR "Woodson Home" OR "Carter G Home" OR "Carter G. Home" OR "Clara Barton's Missing Soldiers Office" OR "Clara Bartons Missing Soldiers Office" OR "Clara Barton" OR "Colvin Run Mill" OR "Congressional Cemetery" OR "Con Cemetery" OR "Darby Store" OR "Darby General Store" OR "Darby General" OR "Dumbarton Oaks Park" OR "Dumbarton Oaks" OR "Dumbarton Park" OR Dumbarton OR "Metropolitan AME" OR "Metro AME" OR "Mount Vernon" OR "Mount Vernon" OR "Mt Vernon" OR "Tivoli Square" OR "GALA Hispanic Theatre" OR "GALA Hispanic Theater" OR "GALA Theatre" OR "GALA Theater" OR "USMC Memorial" OR "USMC War Statue" OR "Iwo Jima" OR "US Marine Corps War Memorial" OR "USMC Memorial" OR "USMC Bronze" OR "@COcanalNPS" OR "C & O Canal" OR "C & O Abner" OR "C & O Cloud House")
Vote ("#AspinHill" OR "#AllSoulsUUDC" OR "#ArlingtonHouse" OR "#AthenaeumNVFAA" OR "#COCanal" OR "#CarterWoodson" OR "#clarabarton" OR "#ColvinRunMill" OR "#CongCemetery" OR "#DarbyGeneral" OR "#DOaksPark" OR "#GeorgeMasonMem" OR "#Greenbelttheatre" OR "#GUObservatory" OR "#LAMBPCS" OR "#LivingClassrooms" OR MetroAMEC OR "#MountVernon" OR "#NMWA" OR "#SixthandI" OR "#TeatroGALA" OR "#USMCMemorial" OR "#WNCathedral" OR "#MeridianHill" OR "@MoCoHumane" OR "@allsoulsuudc" OR "@ArlingtonNPS" OR "@AthenaeumNVFAA" OR "@WoodsonNPS" OR "@CivilWarMed" OR "@fairfaxparks" OR "@CongCemetery" OR "@MontgomeryParks" OR "@DOaksPark" OR "@cityofgreenbelt" OR "@LAMBPCS" OR "@livingclassroom" OR "@MetropolitanAME" OR "@VisitMtVernon" OR "@WomenInTheArts" OR "@SixthandI" OR "@TeatroGALA" OR "@NPSGWMP" OR "@WNCathedral" OR "@Georgetown" OR "Aspin Hill" OR "Aspin Hill Kennel" OR "Aspin Hill Memorial Park" OR "All Souls Church Unitarian" OR "All Souls Church" OR "All Souls Unitarian" OR "All Souls D.C." OR "All Souls D.C" OR "All Souls DC" OR "Arlington House" OR Athenaeum OR "Athenaeum NVFAA" OR "C&O Canal" OR "C&O Abner" OR "C&O Cloud House" OR (C AND "O Canal") OR (C AND "O Abner") OR (C AND "O Cloud House") OR "Abner Cloud House" OR "Carter G. Woodson Home" OR "Carter G Woodson Home" OR "Woodson Home" OR "Carter G Home" OR "Carter G. Home" OR "Clara Barton's Missing Soldiers Office" OR "Clara Bartons Missing Soldiers Office" OR "Clara Barton" OR "Colvin Run Mill" OR "Congressional Cemetery" OR "Con Cemetery" OR "Darby Store" OR "Darby General Store" OR "Darby General" OR "Dumbarton Oaks Park" OR "Dumbarton Oaks" OR "Dumbarton Park" OR Dumbarton OR "Metropolitan AME" OR "Metro AME" OR "Mount Vernon" OR "Mount Vernon" OR "Mt Vernon" OR "Tivoli Square" OR "GALA Hispanic Theatre" OR "GALA Hispanic Theater" OR "GALA Theatre" OR "GALA Theater" OR "USMC Memorial" OR "USMC War Statue" OR "Iwo Jima" OR "US Marine Corps War Memorial" OR "USMC Memorial" OR "USMC Bronze" OR "@COcanalNPS" OR "C & O Canal" OR "C & O Abner")
"Icon Mann" ("@BET" OR "@CENTRICTV" OR "28 Men of Change" OR "#28menofchange" OR "Men of Change" OR "#Iconman" OR "Icon Man" OR "#Iconmann" OR "#BETIconMANN" OR "#28MOC" OR "Man of Change" OR "Nnamdi Asomugha" OR Asomugha OR "@AsomughaFndn" OR "Dr. Robert Gore" OR "Louis Carr" OR "Ed Lewis" OR "Edward T. Lewis" OR "Courtney Hollowell" OR "Marcus Samuelsson" OR "@MarcusCooks" OR "Dr. Steve Perry" OR "@DrStevePerry" OR "Ron Finley" OR "@RonFinleyHQ" OR "Swizz Beatz" OR "@THEREALSWIZZZ" OR "Ndaba Mandela" OR "@NdabaMandela" OR "Steve Pemberton" OR "Charles Jenkins" OR "@CharlesJenkins7" OR "@thejenkinsguy22" OR "Lonnie Bunch" OR "Lonnie Bunch III" OR "Ambassador Ron Kirk" OR "Ron Kirk" OR "Dr. Robert Ross" OR "Robert Ross" OR "Robert K. Ross" OR "@CalEndow" OR "DeVon Franklin" OR "@DeVonFranklin" OR "Nile Rodgers" OR "@nilerodgers" OR "Ray McGuire" OR "Raymond McGuire" OR "Sanford Biggers" OR "@noshun" OR "Wayne Brady" OR "@waynebrady" OR "Steve McQueen" OR "@McQueeninchains" OR "Lee Daniels" OR "Forest Whitaker" OR "@ForestWhitaker" OR "Leland Melvin" OR "@Astro_Flow" OR "Nick Cannon" OR "@NickCannon" OR "Steve Harvey" OR "@IAmSteveHarvey")
"Dairy Free" ("Nancys" OR amande OR "almond breeze" OR "blue diamond" OR "so delicious" OR WholeSoy OR "nu lait" OR "So Soy" OR "So Coconut milk" OR "trader joe's" OR nogurt OR "trader joe" OR "trader jo's" OR "almond dream" OR "dairy free" OR "Silk Live" OR "Dean Foods" OR WildWood OR Soyogurt OR Arrowroot OR "Almond Dream" OR "so delicious" OR "turtle mountain" OR "almond milk" OR "coconut milk" OR "soy milk" OR "hemp milk" OR silk OR "silk soy milk" OR westsoy OR "west soy" OR edensoy OR "almond breeze" OR "blue diamond" OR "rice dream" OR "rice milk" OR "pacific natural foods" OR pacific OR "so delicious" OR "turtle mountain" OR "dairy free" OR "coconut bliss" OR tofutti OR cuties OR "purely decadent" OR "double rainbow" OR "almond dream" OR "organic rice divine" OR "coconut bliss" OR "yours truly" OR "dream kreme" OR "omega cream" OR sorbet OR "Luna & Larrys" OR "Almond Dream" OR "Rice Dream" OR Tempt OR "so delicious" OR "turtle mountain" OR mimiccreme OR soygo OR "coconut milk" OR "soy creamer" OR "wildwood soy" OR "pacific foods" OR "pacific foods blenders" OR "Trader Joe's" OR "Trader Joes" OR "Taam Tov")

@ -0,0 +1,4 @@
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal noexpandtab

@ -0,0 +1,8 @@
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal noexpandtab
setlocal commentstring=//\ %s
setlocal foldmethod=syntax
compiler go
let b:dispatch="go test -v"

@ -0,0 +1,4 @@
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal noexpandtab

@ -0,0 +1,4 @@
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
" setlocal nosmartindent

@ -0,0 +1,2 @@
setlocal foldmethod=syntax
setlocal foldlevelstart=5

@ -0,0 +1 @@
nmap <leader><space> <Plug>VimwikiToggleListItem

@ -0,0 +1,328 @@
" pathogen.vim - path option manipulation
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 2.2
" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
"
" For management of individually installed plugins in ~/.vim/bundle (or
" ~\vimfiles\bundle), adding `call pathogen#infect()` to the top of your
" .vimrc 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
function! s:warn(msg)
if &verbose
echohl WarningMsg
echomsg a:msg
echohl NONE
endif
endfunction
" Point of entry for basic default usage. Give a relative path to invoke
" pathogen#incubate() (defaults to "bundle/{}"), or an absolute path to invoke
" pathogen#surround(). For backwards compatibility purposes, a full path that
" does not end in {} or * is given to pathogen#runtime_prepend_subdirectories()
" instead.
function! pathogen#infect(...) abort " {{{1
for path in a:0 ? reverse(copy(a:000)) : ['bundle/{}']
if path =~# '^[^\\/]\+$'
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#incubate(path . '/{}')
elseif path =~# '^[^\\/]\+[\\/]\%({}\|\*\)$'
call pathogen#incubate(path)
elseif path =~# '[\\/]\%({}\|\*\)$'
call pathogen#surround(path)
else
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#surround(path . '/{}')
endif
endfor
call pathogen#cycle_filetype()
return ''
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,'\\\@<!\%(\\\\\)*\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 (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
call remove(a:list,i)
elseif a:list[i] ==# ''
let i += 1
let empty = 1
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
" Turn filetype detection off and back on again if it was already enabled.
function! pathogen#cycle_filetype() " {{{1
if exists('g:did_load_filetypes')
filetype off
filetype on
endif
endfunction " }}}1
" Check if a bundle is disabled. A bundle is considered disabled if it ends
" in a tilde or its basename or full name is included in the list
" g:pathogen_disabled.
function! pathogen#is_disabled(path) " {{{1
if a:path =~# '\~$'
return 1
elseif !exists("g:pathogen_disabled")
return 0
endif
let sep = pathogen#separator()
let blacklist = g:pathogen_disabled
return index(blacklist, strpart(a:path, strridx(a:path, sep)+1)) != -1 && index(blacklist, a:path) != 1
endfunction "}}}1
" Prepend the given directory to the runtime path and append its corresponding
" after directory. If the directory is already included, move it to the
" outermost position. Wildcards are added as is. Ending a path in /{} causes
" all subdirectories to be added (except those in g:pathogen_disabled).
function! pathogen#surround(path) abort " {{{1
let sep = pathogen#separator()
let rtp = pathogen#split(&rtp)
if a:path =~# '[\\/]{}$'
let path = fnamemodify(a:path[0:-4], ':p:s?[\\/]\=$??')
let before = filter(pathogen#glob_directories(path.sep.'*'), '!pathogen#is_disabled(v:val)')
let after = filter(reverse(pathogen#glob_directories(path.sep."*".sep."after")), '!pathogen#is_disabled(v:val[0:-7])')
call filter(rtp,'v:val[0:strlen(path)-1] !=# path')
else
let path = fnamemodify(a:path, ':p:s?[\\/]\=$??')
let before = [path]
let after = [path . sep . 'after']
call filter(rtp, 'index(before + after, v:val) == -1')
endif
let &rtp = pathogen#join(before, rtp, after)
return &rtp
endfunction " }}}1
" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories. Deprecated.
function! pathogen#runtime_prepend_subdirectories(path) " {{{1
call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#surround('.string(a:path.'/{}').')')
return pathogen#surround(a:path . pathogen#separator() . '{}')
endfunction " }}}1
" For each directory in the runtime path, add a second entry with the given
" argument appended. If the argument ends in '/{}', add a separate entry for
" each subdirectory. The default argument is 'bundle/{}', which means that
" .vim/bundle/*, $VIM/vimfiles/bundle/*, $VIMRUNTIME/bundle/*,
" $VIM/vim/files/bundle/*/after, and .vim/bundle/*/after will be added (on
" UNIX).
function! pathogen#incubate(...) abort " {{{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$'
if name =~# '{}$'
let list += filter(pathogen#glob_directories(substitute(dir,'after$',name[0:-3],'').'*[^~]'.sep.'after'), '!pathogen#is_disabled(v:val[0:-7])') + [dir]
else
let list += [dir, substitute(dir, 'after$', '', '') . name . sep . 'after']
endif
else
if name =~# '{}$'
let list += [dir] + filter(pathogen#glob_directories(dir.sep.name[0:-3].'*[^~]'), '!pathogen#is_disabled(v:val)')
else
let list += [dir . sep . name, dir]
endif
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction " }}}1
" Deprecated alias for pathogen#incubate().
function! pathogen#runtime_append_all_bundles(...) abort " {{{1
if a:0
call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#incubate('.string(a:1.'/{}').')')
else
call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#incubate()')
endif
return call('pathogen#incubate', map(copy(a:000),'v:val . "/{}"'))
endfunction
let s:done_bundles = ''
" }}}1
" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() abort " {{{1
let sep = pathogen#separator()
for glob in pathogen#split(&rtp)
for dir in split(glob(glob), "\n")
if (dir.sep)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir.sep.'doc') == 2 && !empty(filter(split(glob(dir.sep.'doc'.sep.'*'),"\n>"),'!isdirectory(v:val)')) && (!filereadable(dir.sep.'doc'.sep.'tags') || filewritable(dir.sep.'doc'.sep.'tags'))
helptags `=dir.'/doc'`
endif
endfor
endfor
endfunction " }}}1
command! -bar Helptags :call pathogen#helptags()
" Execute the given command. This is basically a backdoor for --remote-expr.
function! pathogen#execute(...) abort " {{{1
for command in a:000
execute command
endfor
return ''
endfunction " }}}1
" Like findfile(), but hardcoded to use the runtimepath.
function! pathogen#runtime_findfile(file,count) abort "{{{1
let rtp = pathogen#join(1,pathogen#split(&rtp))
let file = findfile(a:file,rtp,a:count)
if file ==# ''
return ''
else
return fnamemodify(file,':p')
endif
endfunction " }}}1
" Backport of fnameescape().
function! pathogen#fnameescape(string) abort " {{{1
if exists('*fnameescape')
return fnameescape(a:string)
elseif a:string ==# '-'
return '\-'
else
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
endif
endfunction " }}}1
if exists(':Vedit')
finish
endif
let s:vopen_warning = 0
function! s:find(count,cmd,file,lcd) " {{{1
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
let file = pathogen#runtime_findfile(a:file,a:count)
if file ==# ''
return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
endif
if !s:vopen_warning
let s:vopen_warning = 1
let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
else
let warning = ''
endif
if a:lcd
let path = file[0:-strlen(a:file)-2]
execute 'lcd `=path`'
return a:cmd.' '.pathogen#fnameescape(a:file) . warning
else
return a:cmd.' '.pathogen#fnameescape(file) . warning
endif
endfunction " }}}1
function! s:Findcomplete(A,L,P) " {{{1
let sep = pathogen#separator()
let cheats = {
\'a': 'autoload',
\'d': 'doc',
\'f': 'ftplugin',
\'i': 'indent',
\'p': 'plugin',
\'s': 'syntax'}
if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
let request = cheats[a:A[0]].a:A[1:-1]
else
let request = a:A
endif
let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
let found = {}
for path in pathogen#split(&runtimepath)
let path = expand(path, ':p')
let matches = split(glob(path.sep.pattern),"\n")
call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
for match in matches
let found[match] = 1
endfor
endfor
return sort(keys(found))
endfunction " }}}1
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)
" vim:set et sw=2:

@ -0,0 +1 @@
Subproject commit 369c617c23d7683e936eef25250ec77ab3dc8a9b

@ -0,0 +1 @@
Subproject commit f3fbe427f7b4ec436416a5816d714dc917dc530b

@ -0,0 +1 @@
Subproject commit c0ad852dd453e4e9ac63cf7de89aae0c83f317a7

@ -0,0 +1,513 @@
*bufexplorer.txt* Buffer Explorer Last Change: 22 Oct 2010
Buffer Explorer *buffer-explorer* *bufexplorer*
Version 7.2.8
Plugin for easily exploring (or browsing) Vim |:buffers|.
|bufexplorer-installation| Installation
|bufexplorer-usage| Usage
|bufexplorer-windowlayout| Window Layout
|bufexplorer-customization| Customization
|bufexplorer-changelog| Change Log
|bufexplorer-todo| Todo
|bufexplorer-credits| Credits
For Vim version 7.0 and above.
This plugin is only available if 'compatible' is not set.
{Vi does not have any of this}
==============================================================================
INSTALLATION *bufexplorer-installation*
To install:
- Download the bufexplorer.zip.
- Extract the zip archive into your runtime directory.
The archive contains plugin/bufexplorer.vim, and doc/bufexplorer.txt.
- Start Vim or goto an existing instance of Vim.
- Execute the following command:
>
:helptag <your runtime directory>/doc
<
This will generate all the help tags for any file located in the doc
directory.
==============================================================================
USAGE *bufexplorer-usage*
To start exploring in the current window, use: >
\be or :BufExplorer
To start exploring in a newly split horizontal window, use: >
\bs or :BufExplorerHorizontalSplit
To start exploring in a newly split vertical window, use: >
\bv or :BufExplorerVerticalSplit
If you would like to use something other than '\', you may simply change the
leader (see |mapleader|).
Note: If the current buffer is modified when bufexplorer started, the current
window is always split and the new bufexplorer is displayed in that new
window.
Commands to use once exploring:
<F1> Toggle help information.
<enter> Opens the buffer that is under the cursor into the current
window.
<leftmouse> Opens the buffer that is under the cursor into the current
window.
<shift-enter> Opens the buffer that is under the cursor in another tab.
d |:delete|the buffer under the cursor from the list. The
buffer's 'buflisted' is cleared. This allows for the buffer to
be displayed again using the 'show unlisted' command.
R Toggles relative path/absolute path.
T Toggles to show only buffers for this tab or not.
D |:wipeout|the buffer under the cursor from the list. When a
buffers is wiped, it will not be shown when unlisted buffer are
displayed.
f Toggles whether you are taken to the active window when
selecting a buffer or not.
o Opens the buffer that is under the cursor into the current
window.
p Toggles the showing of a split filename/pathname.
q Quit exploring.
r Reverses the order the buffers are listed in.
s Selects the order the buffers are listed in. Either by buffer
number, file name, file extension, most recently used (MRU), or
full path.
t Opens the buffer that is under the cursor in another tab.
u Toggles the showing of "unlisted" buffers.
Once invoked, Buffer Explorer displays a sorted list (MRU is the default
sort method) of all the buffers that are currently opened. You are then
able to move the cursor to the line containing the buffer's name you are
wanting to act upon. Once you have selected the buffer you would like,
you can then either open it, close it(delete), resort the list, reverse
the sort, quit exploring and so on...
===============================================================================
WINDOW LAYOUT *bufexplorer-windowlayout*
-------------------------------------------------------------------------------
" Press <F1> for Help
" Sorted by mru | Locate buffer | Absolute Split path
"=
01 %a bufexplorer.txt C:\Vim\vimfiles\doc line 87
02 # bufexplorer.vim c:\Vim\vimfiles\plugin line 1
-------------------------------------------------------------------------------
| | | | |
| | | | +-- Current Line #.
| | | +-- Relative/Full Path
| | +-- Buffer Name.
| +-- Buffer Attributes. See|:buffers|for more information.
+-- Buffer Number. See|:buffers|for more information.
===============================================================================
CUSTOMIZATION *bufexplorer-customization*
*g:bufExplorerChgWin*
If set, bufexplorer will bring up the selected buffer in the window specified
by g:bufExplorerChgWin.
*g:bufExplorerDefaultHelp*
To control whether the default help is displayed or not, use: >
let g:bufExplorerDefaultHelp=0 " Do not show default help.
let g:bufExplorerDefaultHelp=1 " Show default help.
The default is to show the default help.
*g:bufExplorerDetailedHelp*
To control whether detailed help is display by, use: >
let g:bufExplorerDetailedHelp=0 " Do not show detailed help.
let g:bufExplorerDetailedHelp=1 " Show detailed help.
The default is NOT to show detailed help.
*g:bufExplorerFindActive*
To control whether you are taken to the active window when selecting a buffer,
use: >
let g:bufExplorerFindActive=0 " Do not go to active window.
let g:bufExplorerFindActive=1 " Go to active window.
The default is to be taken to the active window.
*g:bufExplorerFuncRef*
When a buffer is selected, the functions specified either singly or as a list
will be called.
*g:bufExplorerReverseSort*
To control whether to sort the buffer in reverse order or not, use: >
let g:bufExplorerReverseSort=0 " Do not sort in reverse order.
let g:bufExplorerReverseSort=1 " Sort in reverse order.
The default is NOT to sort in reverse order.
*g:bufExplorerShowDirectories*
Directories usually show up in the list from using a command like ":e .".
To control whether to show directories in the buffer list or not, use: >
let g:bufExplorerShowDirectories=1 " Show directories.
let g:bufExplorerShowDirectories=0 " Don't show directories.
The default is to show directories.
*g:bufExplorerShowRelativePath*
To control whether to show absolute paths or relative to the current
directory, use: >
let g:bufExplorerShowRelativePath=0 " Show absolute paths.
let g:bufExplorerShowRelativePath=1 " Show relative paths.
The default is to show absolute paths.
*g:bufExplorerShowTabBuffer*
To control weither or not to show buffers on for the specific tab or not, use: >
let g:bufExplorerShowTabBuffer=0 " No.
let g:bufExplorerShowTabBuffer=1 " Yes.
The default is not to show.
*g:bufExplorerShowUnlisted*
To control whether to show unlisted buffer or not, use: >
let g:bufExplorerShowUnlisted=0 " Do not show unlisted buffers.
let g:bufExplorerShowUnlisted=1 " Show unlisted buffers.
The default is to NOT show unlisted buffers.
*g:bufExplorerSortBy*
To control what field the buffers are sorted by, use: >
let g:bufExplorerSortBy='extension' " Sort by file extension.
let g:bufExplorerSortBy='fullpath' " Sort by full file path name.
let g:bufExplorerSortBy='mru' " Sort by most recently used.
let g:bufExplorerSortBy='name' " Sort by the buffer's name.
let g:bufExplorerSortBy='number' " Sort by the buffer's number.
The default is to sort by mru.
*g:bufExplorerSplitBelow*
To control where the new split window will be placed above or below the
current window, use: >
let g:bufExplorerSplitBelow=1 " Split new window below current.
let g:bufExplorerSplitBelow=0 " Split new window above current.
The default is to use what ever is set by the global &splitbelow
variable.
*g:bufExplorerSplitOutPathName*
To control whether to split out the path and file name or not, use: >
let g:bufExplorerSplitOutPathName=1 " Split the path and file name.
let g:bufExplorerSplitOutPathName=0 " Don't split the path and file
" name.
The default is to split the path and file name.
*g:bufExplorerSplitRight*
To control where the new vsplit window will be placed to the left or right of
current window, use: >
let g:bufExplorerSplitRight=0 " Split left.
let g:bufExplorerSplitRight=1 " Split right.
The default is to use the global &splitright.
===============================================================================
CHANGE LOG *bufexplorer-changelog*
7.2.8 - Enhancements:
* Thanks to Charles Campbell for integrating bufexplorer with GDBMGR.
http://mysite.verizon.net/astronaut/vim/index.html#GDBMGR
7.2.7 - Fix:
* My 1st attempt to fix the "cache" issue where buffers information
has changed but the cache/display does not reflect those changes.
More work still needs to be done.
7.2.6 - Fix:
* Thanks to Michael Henry for pointing out that I totally forgot to
update the inline help to reflect the previous change to the 'd'
and 'D' keys. Opps!
7.2.5 - Fix:
* Philip Morant suggested switching the command (bwipe) associated
with the 'd' key with the command (bdelete) associated with the 'D'
key. This made sense since the 'd' key is more likely to be used
compared to the 'D' key.
7.2.4 - Fix:
* I did not implement the patch provided by Godefroid Chapelle
correctly. I missed one line which happened to be the most
important one :)
7.2.3 - Enhancements:
* Thanks to David Fishburn for helping me out with a much needed
code overhaul as well as some awesome performance enhancements.
He also reworked the handling of tabs.
* Thanks to Vladimir Dobriakov for making the suggestions on
enhancing the documentation to include a better explaination of
what is contained in the main bufexplorer window.
* Thanks to Yuriy Ershov for added code that when the bufexplorer
window is opened, the cursor is now positioned at the line with the
active buffer (useful in non-MRU sort modes).
* Yuriy also added the abiltiy to cycle through the sort fields in
reverse order.
Fixes:
* Thanks to Michael Henry for supplying a patch that allows
bufexplorer to be opened even when there is one buffer or less.
* Thanks to Godefroid Chapelle for supplying a patch that fixed
MRU sort order after loading a session.
7.2.2 - Fixes:
* Thanks to David L. Dight for spotting and fixing an issue when
using ctrl^. bufexplorer would incorrectly handle the previous
buffer so that when ctrl^ was pressed the incorrect file was opened.
7.2.1 - Fixes:
* Thanks to Dimitar for spotting and fixing a feature that was
inadvertently left out of the previous version. The feature was
when bufexplorer was used together with WinManager, you could use
the tab key to open a buffer in a split window.
7.2.0 - Enhancements:
* For all those missing the \bs and \bv commands, these have now
returned. Thanks to Phil O'Connell for asking for the return of
these missing features and helping test out this version.
Fixes:
* Fixed problem with the bufExplorerFindActive code not working
correctly.
* Fixed an incompatibility between bufexplorer and netrw that caused
buffers to be incorrectly removed from the MRU list.
7.1.7 - Fixes:
* TaCahiroy fixed several issues related to opening a buffer in a
tab.
7.1.6 - Fixes:
* Removed ff=unix from modeline in bufexplorer.txt. Found by Bill
McCarthy.
7.1.5 - Fixes:
* Could not open unnamed buffers. Fixed by TaCahiroy.
7.1.4 - Fixes:
* Sometimes when a file's path has 'white space' in it, extra buffers
would be created containing each piece of the path. i.e:
opening c:\document and settings\test.txt would create a buffer
named "and" and a buffer named "Documents". This was reported and
fixed by TaCa Yoss.
7.1.3 - Fixes:
* Added code to allow only one instance of the plugin to run at a
time. Thanks Dennis Hostetler.
7.1.2 - Fixes:
* Fixed a jumplist issue spotted by JiangJun. I overlooked the
'jumplist' and with a couple calls to 'keepjumps', everything is
fine again.
* Went back to just having a plugin file, no autoload file. By having
the autoload, WinManager was no longer working and without really
digging into the cause, it was easier to go back to using just a
plugin file.
7.1.1 - Fixes:
* A problem spotted by Thomas Arendsen Hein.
When running Vim (7.1.94), error E493 was being thrown.
Enhancements:
* Added 'D' for 'delete' buffer as the 'd' command was a 'wipe'
buffer.
7.1.0 - Another 'major' update, some by Dave Larson, some by me.
* Making use of 'autoload' now to make the plugin load quicker.
* Removed '\bs' and '\bv'. These are now controlled by the user. The
user can issue a ':sp' or ':vs' to create a horizontal or vertical
split window and then issue a '\be'
* Added handling of tabs.
7.0.17 - Fixed issue with 'drop' command.
Various enhancements and improvements.
7.0.16 - Fixed issue reported by Liu Jiaping on non Windows systems, which was
...
Open file1, open file2, modify file1, open bufexplorer, you get the
following error:
--------8<--------
Error detected while processing function
<SNR>14_StartBufExplorer..<SNR>14_SplitOpen:
line 4:
E37: No write since last change (add ! to override)
But the worse thing is, when I want to save the current buffer and
type ':w', I get another error message:
E382: Cannot write, 'buftype' option is set
--------8<--------
7.0.15 - Thanks to Mark Smithfield for suggesting bufexplorer needed to handle
the ':args' command.
7.0.14 - Thanks to Randall Hansen for removing the requirement of terminal
versions to be recompiled with 'gui' support so the 'drop' command
would work. The 'drop' command is really not needed in terminal
versions.
7.0.13 - Fixed integration with WinManager.
Thanks to Dave Eggum for another update.
- Fix: The detailed help didn't display the mapping for toggling
the split type, even though the split type is displayed.
- Fixed incorrect description in the detailed help for toggling
relative or full paths.
- Deprecated s:ExtractBufferNbr(). Vim's str2nr() does the same
thing.
- Created a s:Set() function that sets a variable only if it hasn't
already been defined. It's useful for initializing all those
default settings.
- Removed checks for repetitive command definitions. They were
unnecessary.
- Made the help highlighting a little more fancy.
- Minor reverse compatibility issue: Changed ambiguous setting
names to be more descriptive of what they do (also makes the code
easier to follow):
Changed bufExplorerSortDirection to bufExplorerReverseSort
Changed bufExplorerSplitType to bufExplorerSplitVertical
Changed bufExplorerOpenMode to bufExplorerUseCurrentWindow
- When the BufExplorer window closes, all the file-local marks are
now deleted. This may have the benefit of cleaning up some of the
jumplist.
- Changed the name of the parameter for StartBufExplorer from
"split" to "open". The parameter is a string which specifies how
the buffer will be open, not if it is split or not.
- Deprecated DoAnyMoreBuffersExist() - it is a one line function
only used in one spot.
- Created four functions (SplitOpen(), RebuildBufferList(),
UpdateHelpStatus() and ReSortListing()) all with one purpose - to
reduce repeated code.
- Changed the name of AddHeader() to CreateHelp() to be more
descriptive of what it does. It now returns an array instead of
updating the window directly. This has the benefit of making the
code more efficient since the text the function returns is used a
little differently in the two places the function is called.
- Other minor simplifications.
7.0.12 - MAJOR Update.
This version will ONLY run with Vim version 7.0 or greater.
Dave Eggum has made some 'significant' updates to this latest
version:
- Added BufExplorerGetAltBuf() global function to be used in the
users rulerformat.
- Added g:bufExplorerSplitRight option.
- Added g:bufExplorerShowRelativePath option with mapping.
- Added current line highlighting.
- The split type can now be changed whether bufexplorer is opened
in split mode or not.
- Various major and minor bug fixes and speed improvements.
- Sort by extension.
Other improvements/changes:
- Changed the help key from '?' to <F1> to be more 'standard'.
- Fixed splitting of vertical bufexplorer window.
Hopefully I have not forgot something :)
7.0.11 - Fixed a couple of highlighting bugs, reported by David Eggum. He also
changed passive voice to active on a couple of warning messages.
7.0.10 - Fixed bug report by Xiangjiang Ma. If the 'ssl' option is set,
the slash character used when displaying the path was incorrect.
7.0.9 - Martin Grenfell found and eliminated an annoying bug in the
bufexplorer/winmanager integration. The bug was were an
annoying message would be displayed when a window was split or
a new file was opened in a new window. Thanks Martin!
7.0.8 - Thanks to Mike Li for catching a bug in the WinManager integration.
The bug was related to the incorrect displaying of the buffer
explorer's window title.
7.0.7 - Thanks to Jeremy Cowgar for adding a new enhancement. This
enhancement allows the user to press 'S', that is capital S, which
will open the buffer under the cursor in a newly created split
window.
7.0.6 - Thanks to Larry Zhang for finding a bug in the "split" buffer code.
If you force set g:bufExplorerSplitType='v' in your vimrc, and if you
tried to do a \bs to split the bufexplorer window, it would always
split horizontal, not vertical. He also found that I had a typeo in
that the variable g:bufExplorerSplitVertSize was all lower case in
the documentation which was incorrect.
7.0.5 - Thanks to Mun Johl for pointing out a bug that if a buffer was
modified, the '+' was not showing up correctly.
7.0.4 - Fixed a problem discovered first by Xiangjiang Ma. Well since I've
been using vim 7.0 and not 6.3, I started using a function (getftype)
that is not in 6.3. So for backward compatibility, I conditionaly use
this function now. Thus, the g:bufExplorerShowDirectories feature is
only available when using vim 7.0 and above.
7.0.3 - Thanks to Erwin Waterlander for finding a problem when the last
buffer was deleted. This issue got me to rewrite the buffer display
logic (which I've wanted to do for sometime now).
Also great thanks to Dave Eggum for coming up with idea for
g:bufExplorerShowDirectories. Read the above information about this
feature.
7.0.2 - Thanks to Thomas Arendsen Hein for finding a problem when a user
has the default help turned off and then brought up the explorer. An
E493 would be displayed.
7.0.1 - Thanks to Erwin Waterlander for finding a couple problems.
The first problem allowed a modified buffer to be deleted. Opps! The
second problem occurred when several files were opened, BufExplorer
was started, the current buffer was deleted using the 'd' option, and
then BufExplorer was exited. The deleted buffer was still visible
while it is not in the buffers list. Opps again!
7.0.0 - Thanks to Shankar R. for suggesting to add the ability to set
the fixed width (g:bufExplorerSplitVertSize) of a new window
when opening bufexplorer vertically and fixed height
(g:bufExplorerSplitHorzSize) of a new window when opening
bufexplorer horizontally. By default, the windows are normally
split to use half the existing width or height.
6.3.0 - Added keepjumps so that the jumps list would not get cluttered with
bufexplorer related stuff.
6.2.3 - Thanks to Jay Logan for finding a bug in the vertical split position
of the code. When selecting that the window was to be split
vertically by doing a '\bv', from then on, all splits, i.e. '\bs',
were split vertically, even though g:bufExplorerSplitType was not set
to 'v'.
6.2.2 - Thanks to Patrik Modesto for adding a small improvement. For some
reason his bufexplorer window was always showing up folded. He added
'setlocal nofoldenable' and it was fixed.
6.2.1 - Thanks goes out to Takashi Matsuo for added the 'fullPath' sorting
logic and option.
6.2.0 - Thanks goes out to Simon Johann-Ganter for spotting and fixing a
problem in that the last search pattern is overridden by the search
pattern for blank lines.
6.1.6 - Thanks to Artem Chuprina for finding a pesky bug that has been around
for sometime now. The <esc> key mapping was causing the buffer
explored to close prematurely when vim was run in an xterm. The <esc>
key mapping is now removed.
6.1.5 - Thanks to Khorev Sergey. Added option to show default help or not.
6.1.4 - Thanks goes out to Valery Kondakoff for suggesting the addition of
setlocal nonumber and foldcolumn=0. This allows for line numbering
and folding to be turned off temporarily while in the explorer.
6.1.3 - Added folding. Did some code cleanup. Added the ability to force the
newly split window to be temporarily vertical, which was suggested by
Thomas Glanzmann.
6.1.2 - Now pressing the <esc> key will quit, just like 'q'.
Added folds to hide winmanager configuration.
If anyone had the 'C' option in their cpoptions they would receive
a E10 error on startup of BufExplorer. cpo is now saved, updated and
restored. Thanks to Charles E Campbell, Jr.
Attempted to make sure there can only be one BufExplorer window open
at a time.
6.1.1 - Thanks to Brian D. Goodwin for adding toupper to FileNameCmp. This
way buffers sorted by name will be in the correct order regardless of
case.
6.0.16 - Thanks to Andre Pang for the original patch/idea to get bufexplorer
to work in insertmode/modeless mode (evim). Added Initialize
and Cleanup autocommands to handle commands that need to be
performed when starting or leaving bufexplorer.
6.0.15 - Srinath Avadhanulax added a patch for winmanager.vim.
6.0.14 - Fix a few more bug that I thought I already had fixed. Thanks
to Eric Bloodworth for adding 'Open Mode/Edit in Place'. Added
vertical splitting.
6.0.13 - Thanks to Charles E Campbell, Jr. for pointing out some embarrassing
typos that I had in the documentation. I guess I need to run
the spell checker more :o)
6.0.12 - Thanks to Madoka Machitani, for the tip on adding the augroup command
around the MRUList autocommands.
6.0.11 - Fixed bug report by Xiangjiang Ma. '"=' was being added to the
search history which messed up hlsearch.
6.0.10 - Added the necessary hooks so that the Srinath Avadhanula's
winmanager.vim script could more easily integrate with this script.
Tried to improve performance.
6.0.9 - Added MRU (Most Recently Used) sort ordering.
6.0.8 - Was not resetting the showcmd command correctly.
Added nifty help file.
6.0.7 - Thanks to Brett Carlane for some great enhancements. Some are added,
some are not, yet. Added highlighting of current and alternate
filenames. Added splitting of path/filename toggle. Reworked
ShowBuffers().
Changed my email address.
6.0.6 - Copyright notice added. Needed this so that it could be distributed
with Debian Linux. Fixed problem with the SortListing() function
failing when there was only one buffer to display.
6.0.5 - Fixed problems reported by David Pascoe, in that you where unable to
hit 'd' on a buffer that belonged to a files that no longer existed
and that the 'yank' buffer was being overridden by the help text when
the bufexplorer was opened.
6.0.4 - Thanks to Charles Campbell, Jr. for making this plugin more plugin
*compliant*, adding default keymappings of <Leader>be and <Leader>bs
as well as fixing the 'w:sortDirLabel not being defined' bug.
6.0.3 - Added sorting capabilities. Sort taken from explorer.vim.
6.0.2 - Can't remember. (2001-07-25)
6.0.1 - Initial release.
===============================================================================
TODO *bufexplorer-todo*
- Nothing as of now, buf if you have any suggestions, drop me an email.
===============================================================================
CREDITS *bufexplorer-credits*
Author: Jeff Lanzarotta <delux256-vim at yahoo dot com>
Credit must go out to Bram Moolenaar and all the Vim developers for
making the world's best editor (IMHO). I also want to thank everyone who
helped and gave me suggestions. I wouldn't want to leave anyone out so I
won't list names.
===============================================================================
vim:tw=78:noet:wrap:ts=8:ft=help:norl:

@ -0,0 +1,24 @@
bufexplorer bufexplorer.txt /*bufexplorer*
bufexplorer-changelog bufexplorer.txt /*bufexplorer-changelog*
bufexplorer-credits bufexplorer.txt /*bufexplorer-credits*
bufexplorer-customization bufexplorer.txt /*bufexplorer-customization*
bufexplorer-installation bufexplorer.txt /*bufexplorer-installation*
bufexplorer-todo bufexplorer.txt /*bufexplorer-todo*
bufexplorer-usage bufexplorer.txt /*bufexplorer-usage*
bufexplorer-windowlayout bufexplorer.txt /*bufexplorer-windowlayout*
bufexplorer.txt bufexplorer.txt /*bufexplorer.txt*
buffer-explorer bufexplorer.txt /*buffer-explorer*
g:bufExplorerChgWin bufexplorer.txt /*g:bufExplorerChgWin*
g:bufExplorerDefaultHelp bufexplorer.txt /*g:bufExplorerDefaultHelp*
g:bufExplorerDetailedHelp bufexplorer.txt /*g:bufExplorerDetailedHelp*
g:bufExplorerFindActive bufexplorer.txt /*g:bufExplorerFindActive*
g:bufExplorerFuncRef bufexplorer.txt /*g:bufExplorerFuncRef*
g:bufExplorerReverseSort bufexplorer.txt /*g:bufExplorerReverseSort*
g:bufExplorerShowDirectories bufexplorer.txt /*g:bufExplorerShowDirectories*
g:bufExplorerShowRelativePath bufexplorer.txt /*g:bufExplorerShowRelativePath*
g:bufExplorerShowTabBuffer bufexplorer.txt /*g:bufExplorerShowTabBuffer*
g:bufExplorerShowUnlisted bufexplorer.txt /*g:bufExplorerShowUnlisted*
g:bufExplorerSortBy bufexplorer.txt /*g:bufExplorerSortBy*
g:bufExplorerSplitBelow bufexplorer.txt /*g:bufExplorerSplitBelow*
g:bufExplorerSplitOutPathName bufexplorer.txt /*g:bufExplorerSplitOutPathName*
g:bufExplorerSplitRight bufexplorer.txt /*g:bufExplorerSplitRight*

File diff suppressed because it is too large Load Diff

@ -0,0 +1 @@
Subproject commit 1beec8127b6b03ea931b8e9e973b65bb1e2d7cb0

@ -0,0 +1 @@
camelcasemotion.vba: call delete('/Users/alpha/.vim/bundle/camelcasemotion//autoload/camelcasemotion.vim')|call delete('/Users/alpha/.vim/bundle/camelcasemotion//plugin/camelcasemotion.vim')|call delete('/Users/alpha/.vim/bundle/camelcasemotion//doc/camelcasemotion.txt')

@ -0,0 +1,173 @@
" camelcasemotion.vim: Motion through CamelCaseWords and underscore_notation.
"
" DEPENDENCIES:
" - Requires Vim 7.0 or higher.
"
" Copyright: (C) 2007-2009 by Ingo Karkat
" The VIM LICENSE applies to this script; see ':help copyright'.
"
" Maintainer: Ingo Karkat <ingo@karkat.de>
" REVISION DATE REMARKS
" 1.50.001 05-May-2009 Do not create mappings for select mode;
" according to|Select-mode|, printable character
" commands should delete the selection and insert
" the typed characters.
" Moved functions from plugin to separate autoload
" script.
" file creation
"- functions ------------------------------------------------------------------"
function! s:Move( direction, count, mode )
" Note: There is no inversion of the regular expression character class
" 'keyword character' (\k). We need an inversion "non-keyword" defined as
" "any non-whitespace character that is not a keyword character" (e.g.
" [!@#$%^&*()]). This can be specified via a non-whitespace character in
" whose place no keyword character matches (\k\@!\S).
"echo "count is " . a:count
let l:i = 0
while l:i < a:count
if a:direction == 'e'
" "Forward to end" motion.
"call search( '\>\|\(\a\|\d\)\+\ze_', 'We' )
" end of ...
" number | ACRONYM followed by CamelCase or number | CamelCase | underscore_notation | non-keyword | word
call search( '\d\+\|\u\+\ze\%(\u\l\|\d\)\|\u\l\+\|\%(\a\|\d\)\+\ze_\|\%(\k\@!\S\)\+\|\%(_\@!\k\)\+\>', 'We' )
" Note: word must be defined as '\k\>'; '\>' on its own somehow
" dominates over the previous branch. Plus, \k must exclude the
" underscore, or a trailing one will be incorrectly moved over:
" '\%(_\@!\k\)'.
if a:mode == 'o'
" Note: Special additional treatment for operator-pending mode
" "forward to end" motion.
" The difference between normal mode, operator-pending and visual
" mode is that in the latter two, the motion must go _past_ the
" final "word" character, so that all characters of the "word" are
" selected. This is done by appending a 'l' motion after the
" search for the next "word".
"
" In operator-pending mode, the 'l' motion only works properly
" at the end of the line (i.e. when the moved-over "word" is at
" the end of the line) when the 'l' motion is allowed to move
" over to the next line. Thus, the 'l' motion is added
" temporarily to the global 'whichwrap' setting.
" Without this, the motion would leave out the last character in
" the line. I've also experimented with temporarily setting
" "set virtualedit=onemore" , but that didn't work.
let l:save_ww = &whichwrap
set whichwrap+=l
normal! l
let &whichwrap = l:save_ww
endif
else
" Forward (a:direction == '') and backward (a:direction == 'b')
" motion.
let l:direction = (a:direction == 'w' ? '' : a:direction)
" CamelCase: Jump to beginning of either (start of word, Word, WORD,
" 123).
" Underscore_notation: Jump to the beginning of an underscore-separated
" word or number.
"call search( '\<\|\u', 'W' . l:direction )
"call search( '\<\|\u\(\l\+\|\u\+\ze\u\)\|\d\+', 'W' . l:direction )
"call search( '\<\|\u\(\l\+\|\u\+\ze\u\)\|\d\+\|_\zs\(\a\|\d\)\+', 'W' . l:direction )
" beginning of ...
" word | empty line | non-keyword after whitespaces | non-whitespace after word | number | ACRONYM followed by CamelCase or number | CamelCase | underscore followed by ACRONYM, Camel, lowercase or number
call search( '\<\D\|^$\|\%(^\|\s\)\+\zs\k\@!\S\|\>\S\|\d\+\|\u\+\ze\%(\u\l\|\d\)\|\u\l\+\|_\zs\%(\u\+\|\u\l\+\|\l\+\|\d\+\)', 'W' . l:direction )
" Note: word must be defined as '\<\D' to avoid that a word like
" 1234Test is moved over as [1][2]34[T]est instead of [1]234[T]est
" because \< matches with zero width, and \d\+ will then start
" matching '234'. To fix that, we make \d\+ be solely responsible
" for numbers by taken this away from \< via \<\D. (An alternative
" would be to replace \d\+ with \D\%#\zs\d\+, but that one is more
" complex.) All other branches are not affected, because they match
" multiple characters and not the same character multiple times.
endif
let l:i = l:i + 1
endwhile
endfunction
function! camelcasemotion#Motion( direction, count, mode )
"*******************************************************************************
"* PURPOSE:
" Perform the motion over CamelCaseWords or underscore_notation.
"* ASSUMPTIONS / PRECONDITIONS:
" none
"* EFFECTS / POSTCONDITIONS:
" Move cursor / change selection.
"* INPUTS:
" a:direction one of 'w', 'b', 'e'
" a:count number of "words" to move over
" a:mode one of 'n', 'o', 'v', 'iv' (latter one is a special visual mode
" when inside the inner "word" text objects.
"* RETURN VALUES:
" none
"*******************************************************************************
" Visual mode needs special preparations and postprocessing;
" normal and operator-pending mode breeze through to s:Move().
if a:mode == 'v'
" Visual mode was left when calling this function. Reselecting the current
" selection returns to visual mode and allows to call search() and issue
" normal mode motions while staying in visual mode.
normal! gv
endif
if a:mode == 'v' || a:mode == 'iv'
" Note_1a:
if &selection != 'exclusive' && a:direction == 'w'
normal! l
endif
endif
call s:Move( a:direction, a:count, a:mode )
if a:mode == 'v' || a:mode == 'iv'
" Note: 'selection' setting.
if &selection == 'exclusive' && a:direction == 'e'
" When set to 'exclusive', the "forward to end" motion (',e') does not
" include the last character of the moved-over "word". To include that, an
" additional 'l' motion is appended to the motion; similar to the
" special treatment in operator-pending mode.
normal! l
elseif &selection != 'exclusive' && a:direction != 'e'
" Note_1b:
" The forward and backward motions move to the beginning of the next "word".
" When 'selection' is set to 'inclusive' or 'old', this is one character too far.
" The appended 'h' motion undoes this. Because of this backward step,
" though, the forward motion finds the current "word" again, and would
" be stuck on the current "word". An 'l' motion before the CamelCase
" motion (see Note_1a) fixes that.
normal! h
endif
endif
endfunction
function! camelcasemotion#InnerMotion( direction, count )
" If the cursor is positioned on the first character of a CamelWord, the
" backward motion would move to the previous word, which would result in a
" wrong selection. To fix this, first move the cursor to the right, so that
" the backward motion definitely will cover the current "word" under the
" cursor.
normal! l
" Move "word" backwards, enter visual mode, then move "word" forward. This
" selects the inner "word" in visual mode; the operator-pending mode takes
" this selection as the area covered by the motion.
if a:direction == 'b'
" Do not do the selection backwards, because the backwards "word" motion
" in visual mode + selection=inclusive has an off-by-one error.
call camelcasemotion#Motion( 'b', a:count, 'n' )
normal! v
" We decree that 'b' is the opposite of 'e', not 'w'. This makes more
" sense at the end of a line and for underscore_notation.
call camelcasemotion#Motion( 'e', a:count, 'iv' )
else
call camelcasemotion#Motion( 'b', 1, 'n' )
normal! v
call camelcasemotion#Motion( a:direction, a:count, 'iv' )
endif
endfunction
" vim: set sts=4 sw=4 noexpandtab ff=unix fdm=syntax :

@ -0,0 +1,183 @@
*camelcasemotion.txt* Motion through CamelCaseWords and underscore_notation.
CAMEL CASE MOTION by Ingo Karkat
*camelcasemotion.vim*
description |camelcasemotion-description|
usage |camelcasemotion-usage|
installation |camelcasemotion-installation|
configuration |camelcasemotion-configuration|
known problems |camelcasemotion-known-problems|
todo |camelcasemotion-todo|
history |camelcasemotion-history|
==============================================================================
DESCRIPTION *camelcasemotion-description*
Vim provides many built-in motions, e.g. to move to the next word, or end of
the current word. Most programming languages use either CamelCase
("anIdentifier") or underscore_notation ("an_identifier") naming conventions
for identifiers. The best way to navigate inside those identifiers using Vim
built-in motions is the [count]f{char} motion, i.e. f{uppercase-char} or f_,
respectively. But we can make this easier:
This script defines motions|,w|,|,b| and|,e|(similar to |w|,|b|,|e|), which do
not move word-wise (forward/backward), but Camel-wise; i.e. to word boundaries
and uppercase letters. The motions also work on underscore notation, where
words are delimited by underscore ('_') characters. From here on, both
CamelCase and underscore_notation entities are referred to as "words" (in
double quotes). Just like with the regular motions, a [count] can be prepended
to move over multiple "words" at once. Outside of "words" (e.g. in non-keyword
characters like // or ;), the new motions move just like the regular motions.
Vim provides a built-in|iw|text object called 'inner word', which works in
operator-pending and visual mode. Analog to that, this script defines inner
"word" motions |i,w|,|i,b| and|i,e|, which select the "word" (or multiple
"words" if a [count] is given) where the cursor is located.
==============================================================================
USAGE *camelcasemotion-usage*
*,w* *,b* *,e*
Use the new motions|,w|,|,b| and|,e| in normal mode, operator-pending mode
(cp.|operator|), and visual mode. For example, type 'bc,w' to change 'Camel'
in 'CamelCase' to something else.
EXAMPLE: motions
Given the following CamelCase identifiers in a source code fragment:
set Script31337PathAndNameWithoutExtension11=%~dpn0 ~
set Script31337PathANDNameWITHOUTExtension11=%~dpn0 ~
and the corresponding identifiers in underscore_notation:
set script_31337_path_and_name_without_extension_11=%~dpn0 ~
set SCRIPT_31337_PATH_AND_NAME_WITHOUT_EXTENSION_11=%~dpn0 ~
,w moves to ([x] is cursor position): [s]et, [s]cript, [3]1337, [p]ath,
[a]nd, [n]ame, [w]ithout, [e]xtension, [1]1, [d]pn0, dpn[0], [s]et
,b moves to: [d]pn0, [1]1, [e]xtension, [w]ithout, ...
,e moves to: se[t], scrip[t], 3133[7], pat[h], an[d], nam[e], withou[t],
extensio[n], 1[1], dpn[0]
EXAMPLE: inner motions
Given the following identifier, with the cursor positioned at [x]:
script_31337_path_and_na[m]e_without_extension_11 ~
v3i,w selects script_31337_path_and_[name_without_extension_]11
v3i,b selects script_31337_[path_and_name]_without_extension_11
v3i,e selects script_31337_path_and_[name_without_extension]_11
Instead of visual mode, you can also use c3i,w to change, d3i,w to delete,
gU3i,w to upper-case, and so on.
==============================================================================
INSTALLATION *camelcasemotion-installation*
This script is packaged as a|vimball|. If you have the "gunzip" decompressor
in your PATH, simply edit the *.vba.gz package in Vim; otherwise, decompress
the archive first, e.g. using WinZip. Inside Vim, install by sourcing the
vimball or via the|:UseVimball|command. >
vim camelcasemotion.vba.gz
:so %
To uninstall, use the|:RmVimball|command.
DEPENDENCIES *camelcasemotion-dependencies*
- Requires Vim 7.0 or higher.
==============================================================================
CONFIGURATION *camelcasemotion-configuration*
If you want to use different mappings, map your keys to the
<Plug>CamelCaseMotion_? mapping targets _before_ sourcing this script (e.g. in
your|vimrc|).
EXAMPLE: Replace the default|w|,|b| and|e| mappings instead of defining
additional mappings|,w|,|,b| and|,e|: >
map <silent> w <Plug>CamelCaseMotion_w
map <silent> b <Plug>CamelCaseMotion_b
map <silent> e <Plug>CamelCaseMotion_e
sunmap w
sunmap b
sunmap e
EXAMPLE: Replace default|iw|text-object and define|ib|and |ie|motions: >
omap <silent> iw <Plug>CamelCaseMotion_iw
xmap <silent> iw <Plug>CamelCaseMotion_iw
omap <silent> ib <Plug>CamelCaseMotion_ib
xmap <silent> ib <Plug>CamelCaseMotion_ib
omap <silent> ie <Plug>CamelCaseMotion_ie
xmap <silent> ie <Plug>CamelCaseMotion_ie
==============================================================================
KNOWN PROBLEMS *camelcasemotion-known-problems*
- A degenerate CamelCaseWord containing '\U\u\d' (e.g. "MaP1Roblem") confuses
the operator-pending and visual mode ,e mapping if 'selection' is not set to
"exclusive". It'll skip "P" and select "P1" in one step. As a workaround,
use ',w' instead of ',e'; those two mappings have the same effect inside
CamelCaseWords, anyway.
- The operator-pending and visual mode ,e mapping doesn't work properly when
it reaches the end of the buffer; the final character of the moved-over
"word" remains. As a workaround, use the default 'e' motion instead of ',e'.
- When the Vim setting 'selection' is not set to "exclusive", a
forward-backward combination in visual mode (e.g. 'v,w,b') selects one
additional character to the left, instead of only the character where the
motion started. Likewise, extension of the visual selection from the front
end is off by one additional character.
==============================================================================
TODO *camelcasemotion-todo*
==============================================================================
HISTORY *camelcasemotion-history*
1.50 05-May-2009
- Do not create mappings for select mode; according to|Select-mode|, printable
character commands should delete the selection and insert the typed
characters. Now using :xmap to only target visual mode.
- Moved functions from plugin to separate autoload script.
- Split off documentation into separate help file.
1.40 30-Jun-2008
BF: Now using :normal! to be independent from any user mappings. Thanks to
Neil Walker for the patch.
1.40 19-May-2008
BF: Wrong forward motion stop at the second digit if a word starts with
multiple numbers (e.g. 1234.56789). Thanks to Wasim Ahmed for reporting this.
1.40 24-Apr-2008
ENH: Added inner "word" text objects 'i,w' etc. that work analoguous to the
built-in |iw| text object. Thanks to David Kotchan for this suggestion.
1.30 20-Apr-2008
The motions now also stop at non-keyword boundaries, just like the regular
motions. This has no effect inside a CamelCaseWord or inside
underscore_notation, but it makes the motions behave like the regular motions
(which is important if you replace the default motions). Thanks to Mun Johl
for reporting this.
1.30 09-Apr-2008
- Allowing users to use mappings different than ,w ,b ,e by defining
<Plug>CamelCaseMotion_? target mappings. This can even be used to replace
the default 'w', 'b' and 'e' mappings, as suggested by Mun Johl.
- Now requires VIM 7.0 or higher.
1.20 29-May-2007
ENH: The visual mode motions now also (mostly) work with the (default) setting
'set selection=inclusive', instead of selecting one character too much.
1.10 28-May-2007
Incorporated major improvements and simplifications done by Joseph Barker.
1.00 22-May-2007
First published version.
0.01 11-Oct-2005
Started development based on vimtip #1016 by Anthony Van Ham.
==============================================================================
Copyright: (C) 2007-2009 by Ingo Karkat
The VIM LICENSE applies to this script; see|copyright|.
Maintainer: Ingo Karkat <ingo@karkat.de>
==============================================================================
vim:tw=78:ts=8:ft=help:norl:

@ -0,0 +1,13 @@
,b camelcasemotion.txt /*,b*
,e camelcasemotion.txt /*,e*
,w camelcasemotion.txt /*,w*
camelcasemotion-configuration camelcasemotion.txt /*camelcasemotion-configuration*
camelcasemotion-dependencies camelcasemotion.txt /*camelcasemotion-dependencies*
camelcasemotion-description camelcasemotion.txt /*camelcasemotion-description*
camelcasemotion-history camelcasemotion.txt /*camelcasemotion-history*
camelcasemotion-installation camelcasemotion.txt /*camelcasemotion-installation*
camelcasemotion-known-problems camelcasemotion.txt /*camelcasemotion-known-problems*
camelcasemotion-todo camelcasemotion.txt /*camelcasemotion-todo*
camelcasemotion-usage camelcasemotion.txt /*camelcasemotion-usage*
camelcasemotion.txt camelcasemotion.txt /*camelcasemotion.txt*
camelcasemotion.vim camelcasemotion.txt /*camelcasemotion.vim*

@ -0,0 +1,204 @@
" camelcasemotion.vim: Motion through CamelCaseWords and underscore_notation.
"
" DEPENDENCIES:
" - Requires Vim 7.0 or higher.
"
" Copyright: (C) 2007-2009 by Ingo Karkat
" The VIM LICENSE applies to this script; see ':help copyright'.
"
" Source: Based on vimtip #1016 by Anthony Van Ham.
" Maintainer: Ingo Karkat <ingo@karkat.de>
" REVISION DATE REMARKS
" 1.50.019 05-May-2009 Do not create mappings for select mode;
" according to|Select-mode|, printable character
" commands should delete the selection and insert
" the typed characters.
" Moved functions from plugin to separate autoload
" script.
" Split off documentation into separate help file.
" Now cleaning up Create...Mappings functions.
" 1.40.018 30-Jun-2008 Minor: Removed unnecessary <script> from
" mappings.
" 1.40.017 19-May-2008 BF: Now using :normal! to be independent from
" any user mappings. Thanks to Neil Walker for the
" patch.
" 1.40.016 28-Apr-2008 BF: Wrong forward motion stop at the second
" digit if a word starts with multiple numbers
" (e.g. 1234.56789). Thanks to Wasim Ahmed for
" reporting this.
" 1.40.015 24-Apr-2008 ENH: Added inner "word" text objects 'i,w' etc.
" that work analogous to the built-in 'iw' text
" object. Thanks to David Kotchan for this
" suggestion.
" 1.30.014 20-Apr-2008 The motions now also stop at non-keyword
" boundaries, just like the regular motions. This
" has no effect inside a CamelCaseWord or inside
" underscore_notation, but it makes the motions
" behave like the regular motions (which is
" important if you replace the default motions).
" Thanks to Mun Johl for reporting this.
" Now using non-capturing parentheses \%() in the
" patterns.
" 1.30.013 09-Apr-2008 Refactored away s:VisualCamelCaseMotion().
" Allowing users to use mappings different than
" ,w ,b ,e by defining <Plug>CamelCaseMotion_?
" target mappings. This can even be used to
" replace the default 'w', 'b' and 'e' mappings,
" as suggested by Mun Johl.
" Mappings are now created in a generic function.
" Now requires Vim 7.0 or higher.
" 1.20.012 02-Jun-2007 BF: Corrected motions through mixed
" CamelCase_and_UnderScore words by re-ordering
" and narrowing the search patterns.
" 1.20.011 02-Jun-2007 Thanks again to Joseph Barker for discussing the
" complicated visual mode mapping on the vim-dev
" mailing list and coming up with a great
" simplification:
" Removed s:CheckForChangesToTheSelectionSetting().
" Introduced s:VisualCamelCaseMotion(), which
" handles the differences depending on the
" 'selection' setting.
" Visual mode mappings now directly map to the
" s:VisualCamelCaseMotion() function; no mark is
" clobbered, the complex mapping with the inline
" expression has been retired.
" 1.20.010 29-May-2007 BF: The operator-pending and visual mode ,e
" mapping doesn't work properly when it reaches
" the end of line; the final character of the
" moved-over "word" remains. Fixed this problem
" unless the "word" is at the very end of the
" buffer.
" ENH: The visual mode motions now also (mostly)
" work with the (default) setting
" 'set selection=inclusive', instead of selecting
" one character too much.
" ENH: All mappings will check for changes to the
" 'selection' setting and remap the visual mode
" mappings via function
" s:SetupVisualModeMappings(). We cannot rely on
" the setting while sourcing camelcasemotion.vim
" because the mswin.vim script may be sourced
" afterwards, and its 'behave mswin' changes
" 'selection'.
" Refactored the arguments of function
" s:CamelCaseMotion(...).
" 1.10.009 28-May-2007 BF: Degenerate CamelCaseWords that consist of
" only a single uppercase letter (e.g. "P" in
" "MapPRoblem") are skipped by all motions. Thanks
" to Joseph Barker for reporting this.
" BF: In CamelCaseWords that consist of uppercase
" letters followed by decimals (e.g.
" "MyUPPER123Problem", the uppercase "word" is
" skipped by all motions.
" 1.10.008 28-May-2007 Incorporated major improvements and
" simplifications done by Joseph Barker:
" Operator-pending and visual mode motions now
" accept [count] of more than 9.
" Visual selections can now be extended from
" either end.
" Instead of misusing the :[range], the special
" variable v:count1 is used. Custom commands are
" not needed anymore.
" Operator-pending and visual mode mappings are
" now generic: There's only a single mapping for
" ,w that can be repeated, rather than having a
" separate mapping for 1,w 2,w 3,w ...
" 1.00.007 22-May-2007 Added documentation for publication.
" 006 20-May-2007 BF: visual mode [1,2,3],e on pure CamelCase
" mistakenly marks [2,4,6] words. If the cursor is
" on a uppercase letter, the search pattern
" '\u\l\+' doesn't match at the cursor position,
" so another match won. Changed search pattern
" from '\l\+',
" 005 16-May-2007 Added support for underscore notation.
" Added support for "forward to end of word"
" (',e') motion.
" 004 16-May-2007 Improved search pattern so that
" UppercaseWORDSInBetween and digits are handled,
" too.
" 003 15-May-2007 Changed mappings from <Leader>w to ,w;
" other \w mappings interfere here, because it's
" irritating when the cursor jump doesn't happen
" immediately, because Vim waits whether the
" mapping is complete. ,w is faster to type that
" \w (and, because of the left-right touch,
" preferred over gw).
" Added visual mode mappings.
" 0.02 15-Feb-2006 BF: missing <SID> for omaps.
" 0.01 11-Oct-2005 file creation
" Avoid installing twice or when in compatible mode
if exists('g:loaded_camelcasemotion') || (v:version < 700)
finish
endif
let g:loaded_camelcasemotion = 1
"- mappings -------------------------------------------------------------------
" The count is passed into the function through the special variable 'v:count1',
" which is easier than misusing the :[range] that :call supports.
" <C-U> is used to delete the unused range.
" Another option would be to use a custom 'command! -count=1', but that doesn't
" work with the normal mode mapping: When a count is typed before the mapping,
" the ':' will convert a count of 3 into ':.,+2MyCommand', but ':3MyCommand'
" would be required to use -count and <count>.
"
" We do not provide the fourth "backward to end" motion (,E), because it is
" seldomly used.
function! s:CreateMotionMappings()
" Create mappings according to this template:
" (* stands for the mode [nov], ? for the underlying motion [wbe].)
"
" *noremap <Plug>CamelCaseMotion_? :<C-U>call camelcasemotion#Motion('?',v:count1,'*')<CR>
" if ! hasmapto('<Plug>CamelCaseMotion_?', '*')
" *map <silent> ,? <Plug>CamelCaseMotion_?
" endif
for l:mode in ['n', 'o', 'v']
for l:motion in ['w', 'b', 'e']
let l:targetMapping = '<Plug>CamelCaseMotion_' . l:motion
execute l:mode . 'noremap ' . l:targetMapping . ' :<C-U>call camelcasemotion#Motion(''' . l:motion . ''',v:count1,''' . l:mode . ''')<CR>'
if ! hasmapto(l:targetMapping, l:mode)
execute (l:mode ==# 'v' ? 'x' : l:mode) . 'map <silent> ,' . l:motion . ' ' . l:targetMapping
endif
endfor
endfor
endfunction
" To create a text motion, a mapping for operator-pending mode needs to be
" defined. This mapping should move the cursor according to the implemented
" motion, or mark the covered text via a visual selection. As inner text motions
" need to mark both to the left and right of the cursor position, the visual
" selection needs to be used.
"
" Vim's built-in inner text objects also work in visual mode; they have
" different behavior depending on whether visual mode has just been entered or
" whether text has already been selected.
" We deviate from that and always override the existing selection.
function! s:CreateInnerMotionMappings()
" Create mappings according to this template:
" (* stands for the mode [ov], ? for the underlying motion [wbe].)
"
" *noremap <Plug>CamelCaseMotion_i? :<C-U>call camelcasemotion#InnerMotion('?',v:count1)<CR>
" if ! hasmapto('<Plug>CamelCaseInnerMotion_i?', '*')
" *map <silent> i,? <Plug>CamelCaseInnerMotion_i?
" endif
for l:mode in ['o', 'v']
for l:motion in ['w', 'b', 'e']
let l:targetMapping = '<Plug>CamelCaseMotion_i' . l:motion
execute l:mode . 'noremap ' . l:targetMapping . ' :<C-U>call camelcasemotion#InnerMotion(''' . l:motion . ''',v:count1)<CR>'
if ! hasmapto(l:targetMapping, l:mode)
execute (l:mode ==# 'v' ? 'x' : l:mode) . 'map <silent> i,' . l:motion . ' ' . l:targetMapping
endif
endfor
endfor
endfunction
call s:CreateMotionMappings()
call s:CreateInnerMotionMappings()
delfunction s:CreateMotionMappings
delfunction s:CreateInnerMotionMappings
" vim: set sts=4 sw=4 noexpandtab ff=unix fdm=syntax :

@ -0,0 +1 @@
Subproject commit b5d3fe66a58a13d2ff8b6391f4387608496a030f

@ -0,0 +1 @@
Subproject commit 04da1a1c25faf792d94498084d5b36f8ec752b9e

@ -0,0 +1 @@
Subproject commit 71ed5f7e3a60dc0bbcfe419a4476f72a2004fcd8

@ -0,0 +1 @@
Subproject commit 3367878b12bb7ca998ffceb687c0f27449e588fd

@ -0,0 +1 @@
Subproject commit 3975ac871565115e3769dc69c06bc88ddc1369af

@ -0,0 +1,157 @@
# vim:fileencoding=utf-8:noet
import sys
import codecs
try:
import vim
except ImportError:
vim = {}
if hasattr(vim, 'bindeval'):
def vim_get_func(f, rettype=None):
'''Return a vim function binding.'''
try:
func = vim.bindeval('function("' + f + '")')
if sys.version_info >= (3,) and rettype is str:
return (lambda *args, **kwargs: func(*args, **kwargs).decode('utf-8', errors='replace'))
return func
except vim.error:
return None
else:
import json
class VimFunc(object):
'''Evaluate a vim function using vim.eval().
This is a fallback class for older vim versions.
'''
__slots__ = ('f', 'rettype')
def __init__(self, f, rettype=None):
self.f = f
self.rettype = rettype
def __call__(self, *args):
r = vim.eval(self.f + '(' + json.dumps(args)[1:-1] + ')')
if self.rettype:
return self.rettype(r)
return r
vim_get_func = VimFunc
# It may crash on some old vim versions and I do not remember in which patch
# I fixed this crash.
if hasattr(vim, 'vvars') and vim.vvars['version'] > 703:
_vim_to_python_types = {
vim.Dictionary: lambda value: dict(((key, _vim_to_python(value[key])) for key in value.keys())),
vim.List: lambda value: [_vim_to_python(item) for item in value],
vim.Function: lambda _: None,
}
_id = lambda value: value
def _vim_to_python(value):
return _vim_to_python_types.get(type(value), _id)(value)
def vim_getvar(varname):
return _vim_to_python(vim.vars[str(varname)])
def bufvar_exists(buffer, varname):
buffer = buffer or vim.current.buffer
return varname in buffer.vars
def vim_getwinvar(segment_info, varname):
return _vim_to_python(segment_info['window'].vars[str(varname)])
else:
_vim_exists = vim_get_func('exists', rettype=int)
def vim_getvar(varname): # NOQA
varname = 'g:' + varname
if _vim_exists(varname):
return vim.eval(varname)
else:
raise KeyError(varname)
def bufvar_exists(buffer, varname): # NOQA
if not buffer or buffer.number == vim.current.buffer.number:
return vim.eval('exists("b:{0}")'.format(varname))
else:
return vim.eval('has_key(getbufvar({0}, ""), {1})'
.format(buffer.number, varname))
def vim_getwinvar(segment_info, varname): # NOQA
result = vim.eval('getwinvar({0}, "{1}")'.format(segment_info['winnr'], varname))
if result == '':
if not int(vim.eval('has_key(getwinvar({0}, ""), "{1}")'.format(segment_info['winnr'], varname))):
raise KeyError(varname)
return result
if hasattr(vim, 'options'):
def vim_getbufoption(info, option):
return info['buffer'].options[str(option)]
else:
def vim_getbufoption(info, option): # NOQA
return getbufvar(info['bufnr'], '&' + option)
if sys.version_info < (3,) or not hasattr(vim, 'bindeval'):
getbufvar = vim_get_func('getbufvar')
else:
_getbufvar = vim_get_func('getbufvar')
def getbufvar(*args):
r = _getbufvar(*args)
if type(r) is bytes:
return r.decode('utf-8')
return r
class VimEnviron(object):
@staticmethod
def __getitem__(key):
return vim.eval('$' + key)
@staticmethod
def get(key, default=None):
return vim.eval('$' + key) or default
@staticmethod
def __setitem__(key, value):
return vim.command('let $' + key + '="'
+ value.replace('"', '\\"').replace('\\', '\\\\').replace('\n', '\\n').replace('\0', '')
+ '"')
if sys.version_info < (3,):
def buffer_name(buf):
return buf.name
else:
vim_bufname = vim_get_func('bufname')
def buffer_name(buf): # NOQA
try:
name = buf.name
except UnicodeDecodeError:
return vim_bufname(buf.number)
else:
return name.encode('utf-8') if name else None
vim_strtrans = vim_get_func('strtrans')
def powerline_vim_strtrans_error(e):
if not isinstance(e, UnicodeDecodeError):
raise NotImplementedError
# Assuming &encoding is utf-8 strtrans should not return anything but ASCII
# under current circumstances
text = vim_strtrans(e.object[e.start:e.end]).decode()
return (text, e.end)
codecs.register_error('powerline_vim_strtrans_error', powerline_vim_strtrans_error)
environ = VimEnviron()

@ -0,0 +1,89 @@
if exists('g:powerline_loaded')
finish
endif
let g:powerline_loaded = 1
if !has('python') && !has('python3')
if !exists('g:powerline_no_python_error')
echohl ErrorMsg
echomsg 'You need vim compiled with Python 2.6, 2.7 or 3.2 and later support'
echomsg 'for Powerline to work. Please consult the documentation for more'
echomsg 'details.'
echohl None
endif
finish
endif
let s:pycmd = substitute(get(g:, 'powerline_pycmd', has('python') ? 'py' : 'py3'), '\v^(py)%[thon](3?)$', '\1\2', '')
let s:pyeval = get(g:, 'powerline_pyeval', s:pycmd.'eval')
let s:import_cmd = 'from powerline.vim import setup as powerline_setup'
try
let s:pystr = "try:\n"
let s:pystr .= " ".s:import_cmd."\n"
let s:pystr .= "except ImportError:\n"
let s:pystr .= " import sys, vim\n"
let s:pystr .= " sys.path.append(vim.eval('expand(\"<sfile>:h:h:h:h:h\")'))\n"
let s:pystr .= " ".s:import_cmd."\n"
execute s:pycmd s:pystr
unlet s:pystr
let s:launched = 1
finally
unlet s:import_cmd
if !exists('s:launched')
echohl ErrorMsg
echomsg 'An error occurred while importing powerline package.'
echomsg 'This could be caused by invalid sys.path setting,'
echomsg 'or by an incompatible Python version (powerline requires'
echomsg 'Python 2.6, 2.7 or 3.2 and later to work). Please consult'
echomsg 'the troubleshooting section in the documentation for'
echomsg 'possible solutions.'
echohl None
let s:pystr = "def powerline_troubleshoot():\n"
let s:pystr .= " import sys\n"
let s:pystr .= " if sys.version_info < (2, 6):\n"
let s:pystr .= " print('Too old python version: ' + sys.version + ' (first supported is 2.6)')\n"
let s:pystr .= " elif sys.version_info[0] == 3 and sys.version_info[1] < 2:\n"
let s:pystr .= " print('Too old python 3 version: ' + sys.version + ' (first supported is 3.2)')\n"
let s:pystr .= " try:\n"
let s:pystr .= " import powerline\n"
let s:pystr .= " except ImportError:\n"
let s:pystr .= " print('Unable to import powerline, is it installed?')\n"
if expand('<sfile>')[:4] isnot# '/usr/'
let s:pystr .= " else:\n"
let s:pystr .= " import os\n"
let s:pystr .= " powerline_dir = os.path.dirname(os.path.realpath(powerline.__file__))\n"
let s:pystr .= " this_dir = os.path.dirname(os.path.realpath(vim.eval('expand(\"<sfile>:p\")')))\n"
let s:pystr .= " this_dir = os.path.dirname(os.path.dirname(os.path.dirname(this_dir)))\n"
let s:pystr .= " if os.path.basename(this_dir) != 'powerline':\n"
let s:pystr .= " print('Check your installation:')\n"
let s:pystr .= " print('this script is not in powerline[/bindings/vim/plugin] directory,')\n"
let s:pystr .= " print('neither it is installed system-wide')\n"
let s:pystr .= " this_dir = os.path.dirname(this_dir)\n"
let s:pystr .= " real_powerline_dir = os.path.realpath(powerline_dir)\n"
let s:pystr .= " real_this_dir = os.path.realpath(this_dir)\n"
let s:pystr .= " if real_this_dir != sys.path[-1]:\n"
let s:pystr .= " print('Check your installation:')\n"
let s:pystr .= " print('this script is symlinked somewhere where powerline is not present.')\n"
let s:pystr .= " elif real_powerline_dir != real_this_dir:\n"
let s:pystr .= " print('It appears that you have two powerline versions installed:')\n"
let s:pystr .= " print('one in ' + real_powerline_dir + ', other in ' + real_this_dir + '.')\n"
let s:pystr .= " print('You should remove one of this. Check out troubleshooting section,')\n"
let s:pystr .= " print('it contains some information about the alternatives.')\n"
endif
execute s:pycmd s:pystr
unlet s:pystr
unlet s:pycmd
unlet s:pyeval
finish
else
unlet s:launched
endif
endtry
execute s:pycmd 'import vim'
execute s:pycmd 'powerline_setup(pyeval=vim.eval("s:pyeval"), pycmd=vim.eval("s:pycmd"))'
execute s:pycmd 'del powerline_setup'
unlet s:pycmd
unlet s:pyeval

@ -0,0 +1,134 @@
" scratch.vim
" Author: Abhilash Koneri (abhilash_koneri at hotmail dot com)
" Improved By: Hari Krishna Dara (hari_vim at yahoo dot com)
" Last Change: 25-Feb-2004 @ 09:48
" Created: 17-Aug-2002
" Version: 1.0.0
" Download From:
" http://www.vim.org/script.php?script_id=389
"----------------------------------------------------------------------
" This is a simple plugin that creates a scratch buffer for your
" vim session and helps to access it when you need it.
"
" If you like the custom mappings provided in the script - hitting
" <F8> should create a new scratch buffer. You can do your scribes
" here and if you want to get rid of it, hit <F8> again inside scratch buffer
" window. If you want to get back to the scratch buffer repeat <F8>. Use
" <Plug>ShowScratchBuffer and <Plug>InsShowScratchBuffer to customize these
" mappings.
"
" If you want to designate a file into which the scratch buffer contents
" should automatically be dumped to, when Vim exits, set its path to
" g:scratchBackupFile global variable. This file can be accessed just in case
" you happen to have some important information in the scratch buffer and quit
" Vim (or shutdown the m/c) forgetting to copy it over. The target file is
" force overwritten using the :write! command so make sure you set a file name
" that can accidentally be used for other purposes (especially when you use
" relative paths). I recommend a value of '/tmp/scratch.txt'.
" CAUTION: This feature works only when Vim generates VimLeavePre autocommad.
"
" Custom mappings
" ---------------
" The ones defined below are not very ergonomic!
"----------------------------------------------------------------------
"Standard Inteface: <F8> to make a new ScratchBuffer, <F8>-again to hide one
if exists('loaded_scratch')
finish
endif
let loaded_scratch = 1
" Make sure line-continuations won't cause any problem. This will be restored
" at the end
let s:save_cpo = &cpo
set cpo&vim
if (! exists("no_plugin_maps") || ! no_plugin_maps) &&
\ (! exists("no_scratch_maps") || ! no_scratch_maps)
if !hasmapto('<Plug>ShowScratchBuffer',"n")
nmap <unique> <silent> <F8> <Plug>ShowScratchBuffer
endif
if !hasmapto('<Plug>InsShowScratchBuffer',"i")
imap <unique> <silent> <F8> <Plug>InsShowScratchBuffer
endif
endif
" User Overrideable Plugin Interface
nmap <script> <silent> <Plug>ShowScratchBuffer
\ :silent call <SID>ShowScratchBuffer()<cr>
imap <script> <silent> <Plug>InsShowScratchBuffer
\ <c-o>:silent call <SID>ShowScratchBuffer()<cr>
command! -nargs=0 Scratch :call <SID>ShowScratchBuffer()
if !exists('g:scratchBackupFile')
let g:scratchBackupFile = '' " So that users can easily find this var.
endif
aug ScratchBackup
au!
au VimLeavePre * :call <SID>BackupScratchBuffer()
aug END
let s:SCRATCH_BUFFER_NAME="[Scratch]"
if !exists('s:buffer_number') " Supports reloading.
let s:buffer_number = -1
endif
"----------------------------------------------------------------------
" Diplays the scratch buffer. Creates one if it is an already
" present
"----------------------------------------------------------------------
function! <SID>ShowScratchBuffer()
if(s:buffer_number == -1 || bufexists(s:buffer_number) == 0)
" Temporarily modify isfname to avoid treating the name as a pattern.
let _isf = &isfname
set isfname-=\
set isfname-=[
if exists('+shellslash')
exec "sp \\\\". s:SCRATCH_BUFFER_NAME
else
exec "sp \\". s:SCRATCH_BUFFER_NAME
endif
let &isfname = _isf
let s:buffer_number = bufnr('%')
else
let buffer_win=bufwinnr(s:buffer_number)
if(buffer_win == -1)
exec 'sb '. s:buffer_number
else
exec buffer_win.'wincmd w'
endif
endif
" Do setup always, just in case.
setlocal buftype=nofile
setlocal bufhidden=hide
setlocal nobuflisted
setlocal noswapfile
setlocal noro
nmap <buffer> <silent> <Plug>ShowScratchBuffer :hide<cr>
imap <buffer> <silent> <Plug>InsShowScratchBuffer <c-o>:hide<cr>
command! -buffer -nargs=0 Scratch :hide
endfunction
function! s:BackupScratchBuffer()
if s:buffer_number != -1 && exists('g:scratchBackupFile') &&
\ g:scratchBackupFile != ''
exec 'split #' . s:buffer_number
" Avoid writing empty scratch buffers.
if line('$') > 1 || getline(1) !~ '^\s*$'
let _cpo=&cpo
try
set cpo-=A
exec 'write!' g:scratchBackupFile
finally
let &cpo=_cpo
endtry
endif
endif
endfunction
" Restore cpo.
let &cpo = s:save_cpo
unlet s:save_cpo
" vim6: sw=2 et

@ -0,0 +1 @@
Subproject commit 98a6555e4a26451145c2739052e124b88da99eac

@ -0,0 +1 @@
Subproject commit 60f25648814f0695eeb6c1040d97adca93c4e0bb

@ -0,0 +1 @@
Subproject commit 9bf4fd99e4b460c547207b0f0bc3557280874b61

@ -0,0 +1 @@
Subproject commit 18c68524ab8a043a566bbe227ea8f81ab922d092

@ -0,0 +1 @@
Subproject commit 528a59f26d12278698bb946f8fb82a63711eec21

@ -0,0 +1 @@
Subproject commit 4658aa78fd1b797fb0645064afe8eebbf2bfbb54

@ -0,0 +1 @@
Subproject commit 49307b76fc076f8a44bbda020bcc48e951e1ffc1

@ -0,0 +1 @@
Subproject commit 9f836921d37e050cada7fa911a025638c6708dc8

@ -0,0 +1 @@
Subproject commit c99f0ff06bd1915b2f05c5750283aa9e826ad3d8

@ -0,0 +1 @@
Subproject commit c5b09ad120c20aa79cc061d48db84697eab44ca1

@ -0,0 +1 @@
Subproject commit 78fffa609b3e6b84ef01ee4c9aba6d7435d7b18e

@ -0,0 +1 @@
Subproject commit 3196aec8899101a3939c7366e8028c9bdd56da77

@ -0,0 +1 @@
Subproject commit 2a3c5f8e3c26a57b8eb4cfc4be79615a1c508ef6

@ -0,0 +1 @@
Subproject commit e9a7554bca4a3b6676b1277fe69ba37d9fbe8e74

@ -0,0 +1 @@
Subproject commit 8c81c0099a8b18fdc2e31aab5f6e76e211727e3a

@ -0,0 +1 @@
Subproject commit 42e9b46e7a20a2f394664874c7bbd9d6f6c39e8a

@ -0,0 +1 @@
Subproject commit f8ab33c017f329248773e92968a7a3497b48d287

@ -0,0 +1 @@
Subproject commit b5b84e49e609439e81aa03fa8e605a6097185665

@ -0,0 +1 @@
Subproject commit 96aeac30a586c7b55e4f408e2afa1f25862e3526

@ -0,0 +1 @@
Subproject commit 45e697c2a42f28b915e5f38fc2fccca104b41cda

@ -0,0 +1 @@
Subproject commit fbb873a26568d9db2b109df0705dd25364685b37

@ -0,0 +1 @@
Subproject commit 2c03d82a0e4662adf1e347487d73a9bf4bf6fdac

@ -0,0 +1 @@
Subproject commit 835dd5a448e1fcf98b869ae69bfe099830b984a7

@ -0,0 +1,338 @@
" Vim color file
" Maintainer: Henry So, Jr. <henryso@panix.com>
" These are the colors of the "desert" theme by Hans Fugal with a few small
" modifications (namely that I lowered the intensity of the normal white and
" made the normal and nontext backgrounds black), modified to work with 88-
" and 256-color xterms.
"
" The original "desert" theme is available as part of the vim distribution or
" at http://hans.fugal.net/vim/colors/.
"
" The real feature of this color scheme, with a wink to the "inkpot" theme, is
" the programmatic approximation of the gui colors to the palettes of 88- and
" 256- color xterms. The functions that do this (folded away, for
" readability) are calibrated to the colors used for Thomas E. Dickey's xterm
" (version 200), which is available at http://dickey.his.com/xterm/xterm.html.
"
" I struggled with trying to parse the rgb.txt file to avoid the necessity of
" converting color names to #rrggbb form, but decided it was just not worth
" the effort. Maybe someone seeing this may decide otherwise...
set background=dark
if version > 580
" no guarantees for version 5.8 and below, but this makes it stop
" complaining
hi clear
if exists("syntax_on")
syntax reset
endif
endif
let g:colors_name="desert256"
if has("gui_running") || &t_Co == 88 || &t_Co == 256
" functions {{{
" returns an approximate grey index for the given grey level
fun <SID>grey_number(x)
if &t_Co == 88
if a:x < 23
return 0
elseif a:x < 69
return 1
elseif a:x < 103
return 2
elseif a:x < 127
return 3
elseif a:x < 150
return 4
elseif a:x < 173
return 5
elseif a:x < 196
return 6
elseif a:x < 219
return 7
elseif a:x < 243
return 8
else
return 9
endif
else
if a:x < 14
return 0
else
let l:n = (a:x - 8) / 10
let l:m = (a:x - 8) % 10
if l:m < 5
return l:n
else
return l:n + 1
endif
endif
endif
endfun
" returns the actual grey level represented by the grey index
fun <SID>grey_level(n)
if &t_Co == 88
if a:n == 0
return 0
elseif a:n == 1
return 46
elseif a:n == 2
return 92
elseif a:n == 3
return 115
elseif a:n == 4
return 139
elseif a:n == 5
return 162
elseif a:n == 6
return 185
elseif a:n == 7
return 208
elseif a:n == 8
return 231
else
return 255
endif
else
if a:n == 0
return 0
else
return 8 + (a:n * 10)
endif
endif
endfun
" returns the palette index for the given grey index
fun <SID>grey_color(n)
if &t_Co == 88
if a:n == 0
return 16
elseif a:n == 9
return 79
else
return 79 + a:n
endif
else
if a:n == 0
return 16
elseif a:n == 25
return 231
else
return 231 + a:n
endif
endif
endfun
" returns an approximate color index for the given color level
fun <SID>rgb_number(x)
if &t_Co == 88
if a:x < 69
return 0
elseif a:x < 172
return 1
elseif a:x < 230
return 2
else
return 3
endif
else
if a:x < 75
return 0
else
let l:n = (a:x - 55) / 40
let l:m = (a:x - 55) % 40
if l:m < 20
return l:n
else
return l:n + 1
endif
endif
endif
endfun
" returns the actual color level for the given color index
fun <SID>rgb_level(n)
if &t_Co == 88
if a:n == 0
return 0
elseif a:n == 1
return 139
elseif a:n == 2
return 205
else
return 255
endif
else
if a:n == 0
return 0
else
return 55 + (a:n * 40)
endif
endif
endfun
" returns the palette index for the given R/G/B color indices
fun <SID>rgb_color(x, y, z)
if &t_Co == 88
return 16 + (a:x * 16) + (a:y * 4) + a:z
else
return 16 + (a:x * 36) + (a:y * 6) + a:z
endif
endfun
" returns the palette index to approximate the given R/G/B color levels
fun <SID>color(r, g, b)
" get the closest grey
let l:gx = <SID>grey_number(a:r)
let l:gy = <SID>grey_number(a:g)
let l:gz = <SID>grey_number(a:b)
" get the closest color
let l:x = <SID>rgb_number(a:r)
let l:y = <SID>rgb_number(a:g)
let l:z = <SID>rgb_number(a:b)
if l:gx == l:gy && l:gy == l:gz
" there are two possibilities
let l:dgr = <SID>grey_level(l:gx) - a:r
let l:dgg = <SID>grey_level(l:gy) - a:g
let l:dgb = <SID>grey_level(l:gz) - a:b
let l:dgrey = (l:dgr * l:dgr) + (l:dgg * l:dgg) + (l:dgb * l:dgb)
let l:dr = <SID>rgb_level(l:gx) - a:r
let l:dg = <SID>rgb_level(l:gy) - a:g
let l:db = <SID>rgb_level(l:gz) - a:b
let l:drgb = (l:dr * l:dr) + (l:dg * l:dg) + (l:db * l:db)
if l:dgrey < l:drgb
" use the grey
return <SID>grey_color(l:gx)
else
" use the color
return <SID>rgb_color(l:x, l:y, l:z)
endif
else
" only one possibility
return <SID>rgb_color(l:x, l:y, l:z)
endif
endfun
" returns the palette index to approximate the 'rrggbb' hex string
fun <SID>rgb(rgb)
let l:r = ("0x" . strpart(a:rgb, 0, 2)) + 0
let l:g = ("0x" . strpart(a:rgb, 2, 2)) + 0
let l:b = ("0x" . strpart(a:rgb, 4, 2)) + 0
return <SID>color(l:r, l:g, l:b)
endfun
" sets the highlighting for the given group
fun <SID>X(group, fg, bg, attr)
if a:fg != ""
exec "hi " . a:group . " guifg=#" . a:fg . " ctermfg=" . <SID>rgb(a:fg)
endif
if a:bg != ""
exec "hi " . a:group . " guibg=#" . a:bg . " ctermbg=" . <SID>rgb(a:bg)
endif
if a:attr != ""
exec "hi " . a:group . " gui=" . a:attr . " cterm=" . a:attr
endif
endfun
" }}}
call <SID>X("Normal", "cccccc", "000000", "")
" highlight groups
call <SID>X("Cursor", "708090", "f0e68c", "")
"CursorIM
"Directory
"DiffAdd
"DiffChange
"DiffDelete
"DiffText
"ErrorMsg
call <SID>X("VertSplit", "c2bfa5", "7f7f7f", "reverse")
call <SID>X("Folded", "ffd700", "4d4d4d", "")
call <SID>X("FoldColumn", "d2b48c", "4d4d4d", "")
call <SID>X("IncSearch", "708090", "f0e68c", "")
"LineNr
call <SID>X("ModeMsg", "daa520", "", "")
call <SID>X("MoreMsg", "2e8b57", "", "")
call <SID>X("NonText", "addbe7", "000000", "bold")
call <SID>X("Question", "00ff7f", "", "")
call <SID>X("Search", "f5deb3", "cd853f", "")
call <SID>X("SpecialKey", "9acd32", "", "")
call <SID>X("StatusLine", "c2bfa5", "000000", "reverse")
call <SID>X("StatusLineNC", "c2bfa5", "7f7f7f", "reverse")
call <SID>X("Title", "cd5c5c", "", "")
call <SID>X("Visual", "6b8e23", "f0e68c", "reverse")
"VisualNOS
call <SID>X("WarningMsg", "fa8072", "", "")
"WildMenu
"Menu
"Scrollbar
"Tooltip
" syntax highlighting groups
call <SID>X("Comment", "87ceeb", "", "")
call <SID>X("Constant", "ffa0a0", "", "")
call <SID>X("Identifier", "98fb98", "", "none")
call <SID>X("Statement", "f0e68c", "", "bold")
call <SID>X("PreProc", "cd5c5c", "", "")
call <SID>X("Type", "bdb76b", "", "bold")
call <SID>X("Special", "ffdead", "", "")
"Underlined
call <SID>X("Ignore", "666666", "", "")
"Error
call <SID>X("Todo", "ff4500", "eeee00", "")
" delete functions {{{
delf <SID>X
delf <SID>rgb
delf <SID>color
delf <SID>rgb_color
delf <SID>rgb_level
delf <SID>rgb_number
delf <SID>grey_color
delf <SID>grey_level
delf <SID>grey_number
" }}}
else
" color terminal definitions
hi SpecialKey ctermfg=darkgreen
hi NonText cterm=bold ctermfg=darkblue
hi Directory ctermfg=darkcyan
hi ErrorMsg cterm=bold ctermfg=7 ctermbg=1
hi IncSearch cterm=NONE ctermfg=yellow ctermbg=green
hi Search cterm=NONE ctermfg=grey ctermbg=blue
hi MoreMsg ctermfg=darkgreen
hi ModeMsg cterm=NONE ctermfg=brown
hi LineNr ctermfg=3
hi Question ctermfg=green
hi StatusLine cterm=bold,reverse
hi StatusLineNC cterm=reverse
hi VertSplit cterm=reverse
hi Title ctermfg=5
hi Visual cterm=reverse
hi VisualNOS cterm=bold,underline
hi WarningMsg ctermfg=1
hi WildMenu ctermfg=0 ctermbg=3
hi Folded ctermfg=darkgrey ctermbg=NONE
hi FoldColumn ctermfg=darkgrey ctermbg=NONE
hi DiffAdd ctermbg=4
hi DiffChange ctermbg=5
hi DiffDelete cterm=bold ctermfg=4 ctermbg=6
hi DiffText cterm=bold ctermbg=1
hi Comment ctermfg=darkcyan
hi Constant ctermfg=brown
hi Special ctermfg=5
hi Identifier ctermfg=6
hi Statement ctermfg=3
hi PreProc ctermfg=5
hi Type ctermfg=2
hi Underlined cterm=underline ctermfg=5
hi Ignore ctermfg=darkgrey
hi Error cterm=bold ctermfg=7 ctermbg=1
endif
" vim: set fdl=0 fdm=marker:

@ -0,0 +1 @@
au BufRead,BufNewFile *.applescript setf applescript

@ -0,0 +1 @@
au BufRead,BufNewFile *.rl setf ragel

@ -0,0 +1,196 @@
" Python indent file
" Language: Python
" Maintainer: Eric Mc Sween <em@tomcom.de>
" Original Author: David Bustos <bustos@caltech.edu>
" Last Change: 2004 Jun 07
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal expandtab
setlocal nolisp
setlocal autoindent
setlocal indentexpr=GetPythonIndent(v:lnum)
setlocal indentkeys=!^F,o,O,<:>,0),0],0},=elif,=except
let s:maxoff = 50
" Find backwards the closest open parenthesis/bracket/brace.
function! s:SearchParensPair()
let line = line('.')
let col = col('.')
" Skip strings and comments and don't look too far
let skip = "line('.') < " . (line - s:maxoff) . " ? dummy :" .
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? ' .
\ '"string\\|comment"'
" Search for parentheses
call cursor(line, col)
let parlnum = searchpair('(', '', ')', 'bW', skip)
let parcol = col('.')
" Search for brackets
call cursor(line, col)
let par2lnum = searchpair('\[', '', '\]', 'bW', skip)
let par2col = col('.')
" Search for braces
call cursor(line, col)
let par3lnum = searchpair('{', '', '}', 'bW', skip)
let par3col = col('.')
" Get the closest match
if par2lnum > parlnum || (par2lnum == parlnum && par2col > parcol)
let parlnum = par2lnum
let parcol = par2col
endif
if par3lnum > parlnum || (par3lnum == parlnum && par3col > parcol)
let parlnum = par3lnum
let parcol = par3col
endif
" Put the cursor on the match
if parlnum > 0
call cursor(parlnum, parcol)
endif
return parlnum
endfunction
" Find the start of a multi-line statement
function! s:StatementStart(lnum)
let lnum = a:lnum
while 1
if getline(lnum - 1) =~ '\\$'
let lnum = lnum - 1
else
call cursor(lnum, 1)
let maybe_lnum = s:SearchParensPair()
if maybe_lnum < 1
return lnum
else
let lnum = maybe_lnum
endif
endif
endwhile
endfunction
" Find the block starter that matches the current line
function! s:BlockStarter(lnum, block_start_re)
let lnum = a:lnum
let maxindent = 10000 " whatever
while lnum > 1
let lnum = prevnonblank(lnum - 1)
if indent(lnum) < maxindent
if getline(lnum) =~ a:block_start_re
return lnum
else
let maxindent = indent(lnum)
" It's not worth going further if we reached the top level
if maxindent == 0
return -1
endif
endif
endif
endwhile
return -1
endfunction
function! GetPythonIndent(lnum)
" First line has indent 0
if a:lnum == 1
return 0
endif
" If we can find an open parenthesis/bracket/brace, line up with it.
call cursor(a:lnum, 1)
let parlnum = s:SearchParensPair()
if parlnum > 0
let parcol = col('.')
let closing_paren = match(getline(a:lnum), '^\s*[])}]') != -1
if match(getline(parlnum), '[([{]\s*$', parcol - 1) != -1
if closing_paren
return indent(parlnum)
else
return indent(parlnum) + &shiftwidth
endif
else
if closing_paren
return parcol - 1
else
return parcol
endif
endif
endif
" Examine this line
let thisline = getline(a:lnum)
let thisindent = indent(a:lnum)
" If the line starts with 'elif' or 'else', line up with 'if' or 'elif'
if thisline =~ '^\s*\(elif\|else\)\>'
let bslnum = s:BlockStarter(a:lnum, '^\s*\(if\|elif\)\>')
if bslnum > 0
return indent(bslnum)
else
return -1
endif
endif
" If the line starts with 'except' or 'finally', line up with 'try'
" or 'except'
if thisline =~ '^\s*\(except\|finally\)\>'
let bslnum = s:BlockStarter(a:lnum, '^\s*\(try\|except\)\>')
if bslnum > 0
return indent(bslnum)
else
return -1
endif
endif
" Examine previous line
let plnum = a:lnum - 1
let pline = getline(plnum)
let sslnum = s:StatementStart(plnum)
" If the previous line is blank, keep the same indentation
if pline =~ '^\s*$'
return -1
endif
" If this line is explicitly joined, try to find an indentation that looks
" good.
if pline =~ '\\$'
let compound_statement = '^\s*\(if\|while\|for\s.*\sin\|except\)\s*'
let maybe_indent = matchend(getline(sslnum), compound_statement)
if maybe_indent != -1
return maybe_indent
else
return indent(sslnum) + &sw * 2
endif
endif
" If the previous line ended with a colon, indent relative to
" statement start.
if pline =~ ':\s*$'
return indent(sslnum) + &sw
endif
" If the previous line was a stop-execution statement or a pass
if getline(sslnum) =~ '^\s*\(break\|continue\|raise\|return\|pass\)\>'
" See if the user has already dedented
if indent(a:lnum) > indent(sslnum) - &sw
" If not, recommend one dedent
return indent(sslnum) - &sw
endif
" Otherwise, trust the user
return -1
endif
" In all other cases, line up with the start of the previous statement.
return indent(sslnum)
endfunction

@ -0,0 +1,245 @@
" Vim syntax file
" Language: AppleScript
" Maintainer: Jim Eberle <jim.eberle@fastnlight.com>
" Last Change: Mar 18, 2010
" URL: http://www.fastnlight.com/syntax/applescript.vim
" Use :syn w/in a buffer to see language element breakdown
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" --- Statement ---
syn keyword scptStmt get set count copy run global local prop property
syn keyword scptStmt close put delete duplicate exists
syn keyword scptStmt launch open print quit make move reopen save
syn keyword scptStmt saving into
hi def link scptStmt Statement
" --- Type ---
syn keyword scptType text string number integer real color date
hi def link scptType Type
" --- Operator ---
syn keyword scptOp div mod not and or as
syn match scptOp "[-+*/^&]"
" MacRoman single char :- (divide)
exec 'syn match scptOp "'.nr2char(214).'"'
syn match scptOp "\<\(a \)\?\(ref\( to\)\?\|reference to\)\>"
hi def link scptOp Operator
" Containment
syn match scptIN "\<starts\? with\>"
syn match scptIN "\<begins\? with\>"
syn match scptIN "\<ends\? with\>"
syn match scptIN "\<contains\>"
syn match scptIN "\<does not contain\>"
syn match scptIN "\<doesn't contain\>"
syn match scptIN "\<is in\>"
syn match scptIN "\<is contained by\>"
syn match scptIN "\<is not in\>"
syn match scptIN "\<is not contained by\>"
syn match scptIN "\<isn't contained by\>"
hi def link scptIN scptOp
" Equals
syn match scptEQ "="
syn match scptEQ "\<equal\>"
syn match scptEQ "\<equals\>"
syn match scptEQ "\<equal to\>"
syn match scptEQ "\<is\>"
syn match scptEQ "\<is equal to\>"
hi def link scptEQ scptOp
" Not Equals
syn match scptNE "\<does not equal\>"
syn match scptNE "\<doesn't equal\>"
syn match scptNE "\<is not\>"
syn match scptNE "\<is not equal\( to\)\?\>"
syn match scptNE "\<isn't\>"
syn match scptNE "\<isn't equal\( to\)\?\>"
hi def link scptNE scptOp
" MacRoman single char /=
exec 'syn match scptNE "'.nr2char(173).'"'
" Less Than
syn match scptLT "<"
syn match scptLT "\<comes before\>"
syn match scptLT "\(is \)\?less than"
syn match scptLT "\<is not greater than or equal\( to\)\?\>"
syn match scptLT "\<isn't greater than or equal\( to\)\?\>"
hi def link scptLT scptOp
" Greater Than
syn match scptGT ">"
syn match scptGT "\<comes after\>"
syn match scptGT "\(is \)\?greater than"
syn match scptGT "\<is not less than or equal\( to\)\?\>"
syn match scptGT "\<isn't less than or equal\( to\)\?\>"
hi def link scptGT scptOp
" Less Than or Equals
syn match scptLE "<="
syn match scptLE "\<does not come after\>"
syn match scptLE "\<doesn't come after\>"
syn match scptLE "\(is \)\?less than or equal\( to\)\?"
syn match scptLE "\<is not greater than\>"
syn match scptLE "\<isn't greater than\>"
hi def link scptLE scptOp
" MacRoman single char <=
exec 'syn match scptLE "'.nr2char(178).'"'
" Greater Than or Equals
syn match scptGE ">="
syn match scptGE "\<does not come before\>"
syn match scptGE "\<doesn't come before\>"
syn match scptGE "\(is \)\?greater than or equal\( to\)\?"
syn match scptGE "\<is not less than\>"
syn match scptGE "\<isn't less than\>"
hi def link scptGE scptOp
" MacRoman single char >=
exec 'syn match scptGE "'.nr2char(179).'"'
" --- Constant String ---
syn region scptString start=+"+ skip=+\\\\\|\\"+ end=+"+
hi def link scptString String
" --- Constant Number ---
syn match scptNumber "\<-\?\d\+\>"
hi def link scptNumber Number
" --- Constant Float ---
syn match scptFloat display contained "\d\+\.\d*\(e[-+]\=\d\+\)\="
syn match scptFloat display contained "\.\d\+\(e[-+]\=\d\+\)\=\>"
syn match scptFloat display contained "\d\+e[-+]\>"
hi def link scptFloat Float
" --- Constant Boolean ---
syn keyword scptBoolean true false yes no ask
hi def link scptBoolean Boolean
" --- Other Constants ---
syn keyword scptConst it me version pi result space tab anything
syn match scptConst "\<missing value\>"
" Considering and Ignoring
syn match scptConst "\<application responses\>"
syn match scptConst "\<current application\>"
syn match scptConst "\<white space\>"
syn keyword scptConst case diacriticals expansion hyphens punctuation
hi def link scptConst Constant
" Style
syn match scptStyle "\<all caps\>"
syn match scptStyle "\<all lowercase\>"
syn match scptStyle "\<small caps\>"
syn keyword scptStyle bold condensed expanded hidden italic outline plain
syn keyword scptStyle shadow strikethrough subscript superscript underline
hi def link scptStyle scptConst
" Day
syn keyword scptDay Mon Tue Wed Thu Fri Sat Sun
syn keyword scptDay Monday Tuesday Wednesday Thursday Friday Saturday Sunday
syn keyword scptDay weekday
hi def link scptDay scptConst
" Month
syn keyword scptMonth Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
syn keyword scptMonth January February March
syn keyword scptMonth April May June
syn keyword scptMonth July August September
syn keyword scptMonth October November December
syn keyword scptMonth month
hi def link scptMonth scptConst
" Time
syn keyword scptTime minutes hours days weeks
hi def link scptTime scptConstant
" --- Conditional ---
syn keyword scptCond if then else
syn match scptCond "\<end if\>"
hi def link scptCond Conditional
" --- Repeat ---
syn keyword scptRepeat repeat with from to by continue
syn match scptRepeat "\<repeat while\>"
syn match scptRepeat "\<repeat until\>"
syn match scptRepeat "\<repeat with\>"
syn match scptRepeat "\<end repeat\>"
hi def link scptRepeat Repeat
" --- Exception ---
syn keyword scptException try error
syn match scptException "\<on error\>"
syn match scptException "\<end try\>"
syn match scptException "\<end error\>"
hi def link scptException Exception
" --- Keyword ---
syn keyword scptKeyword end tell times exit
syn keyword scptKeyword application file alias activate
syn keyword scptKeyword script on return without given
syn keyword scptKeyword considering ignoring items delimiters
syn keyword scptKeyword some each every whose where id index item its
syn keyword scptKeyword first second third fourth fifth sixth seventh
syn keyword scptKeyword eighth ninth tenth container
syn match scptKeyword "\d\+\(st\|nd\|rd\|th\)"
syn keyword scptKeyword last front back middle named thru through
syn keyword scptKeyword before after in of the
syn match scptKeyword "\<text \>"
syn match scptKeyword "\<partial result\>"
syn match scptKeyword "\<but ignoring\>"
syn match scptKeyword "\<but considering\>"
syn match scptKeyword "\<with timeout\>"
syn match scptKeyword "\<with transaction\>"
syn match scptKeyword "\<do script\>"
syn match scptKeyword "\<POSIX path\>"
syn match scptKeyword "\<quoted form\>"
syn match scptKeyword "'s"
hi def link scptKeyword Keyword
" US Units
syn keyword scptUnitUS quarts gallons ounces pounds inches feet yards miles
syn match scptUnitUS "\<square feet\>"
syn match scptUnitUS "\<square yards\>"
syn match scptUnitUS "\<square miles\>"
syn match scptUnitUS "\<cubic inches\>"
syn match scptUnitUS "\<cubic feet\>"
syn match scptUnitUS "\<cubic yards\>"
syn match scptUnitUS "\<degrees Fahrenheit\>"
hi def link scptUnitUS scptKey
" British Units
syn keyword scptUnitBT litres centimetres metres kilometres
syn match scptUnitBT "\<square metres\>"
syn match scptUnitBT "\<square kilometres\>"
syn match scptUnitBT "\<cubic centimetres\>"
syn match scptUnitBT "\<cubic metres\>"
hi def link scptUnitBT scptKey
" Metric Units
syn keyword scptUnitMT liters centimeters meters kilometers grams kilograms
syn match scptUnitMT "\<square meters\>"
syn match scptUnitMT "\<square kilometers\>"
syn match scptUnitMT "\<cubic centimeters\>"
syn match scptUnitMT "\<cubic meters\>"
syn match scptUnitMT "\<degrees Celsius\>"
syn match scptUnitMT "\<degrees Kelvin\>"
hi def link scptUnitMT scptKey
" --- Comment ---
syn match scptComment "--.*"
syn match scptComment "#.*"
syn region scptComment start="(\*" end="\*)"
hi def link scptComment Comment
" --- Todo ---
syn keyword scptTodo contained TODO FIXME XXX
hi def link scptTodo Todo
let b:current_syntax = "applescript"

@ -0,0 +1,149 @@
" Vim syntax file
"
" Language: Ragel
" Author: Adrian Thurston
syntax clear
"
" Outside code
"
" Comments
syntax region ocComment start="\/\*" end="\*\/"
syntax match ocComment "\/\/.*$"
" Anything preprocessor
syntax match ocPreproc "#\(.\|\\\n\)*$"
syntax region ocPreproc start="#" end="[^\\]$"
" Strings
syntax match ocLiteral "'\(\\.\|[^'\\]\)*'"
syntax match ocLiteral "\"\(\\.\|[^\"\\]\)*\""
" C/C++ Keywords
syntax keyword ocType unsigned signed void char short int long float double bool
syntax keyword ocType inline static extern register const volatile auto
syntax keyword ocType union enum struct class typedef
syntax keyword ocType namespace template typename mutable
syntax keyword ocKeyword break continue default do else for
syntax keyword ocKeyword goto if return switch while
syntax keyword ocKeyword new delete this using friend public private protected sizeof
syntax keyword ocKeyword throw try catch operator typeid
syntax keyword ocKeyword and bitor xor compl bitand and_eq or_eq xor_eq not not_eq
syntax keyword ocKeyword static_cast dynamic_cast
" Numbers
syntax match ocNumber "[0-9][0-9]*"
syntax match ocNumber "0x[0-9a-fA-F][0-9a-fA-F]*"
" Booleans
syntax keyword ocBoolean true false
" Identifiers
syntax match anyId "[a-zA-Z_][a-zA-Z_0-9]*"
" Inline code only
syntax keyword fsmType fpc fc fcurs fbuf fblen ftargs fstack
syntax keyword fsmKeyword fhold fgoto fcall fret fentry fnext fexec fbreak
syntax cluster rlItems contains=rlComment,rlLiteral,rlAugmentOps,rlOtherOps,rlKeywords,rlWrite,rlCodeCurly,rlCodeSemi,rlNumber,anyId,rlLabelColon,rlExprKeywords
syntax region machineSpec1 matchgroup=beginRL start="%%{" end="}%%" contains=@rlItems
syntax region machineSpec2 matchgroup=beginRL start="%%[^{]"rs=e-1 end="$" keepend contains=@rlItems
syntax region machineSpec2 matchgroup=beginRL start="%%$" end="$" keepend contains=@rlItems
" Comments
syntax match rlComment "#.*$" contained
" Literals
syntax match rlLiteral "'\(\\.\|[^'\\]\)*'[i]*" contained
syntax match rlLiteral "\"\(\\.\|[^\"\\]\)*\"[i]*" contained
syntax match rlLiteral /\/\(\\.\|[^\/\\]\)*\/[i]*/ contained
syntax match rlLiteral "\[\(\\.\|[^\]\\]\)*\]" contained
" Numbers
syntax match rlNumber "[0-9][0-9]*" contained
syntax match rlNumber "0x[0-9a-fA-F][0-9a-fA-F]*" contained
" Operators
syntax match rlAugmentOps "[>$%@]" contained
syntax match rlAugmentOps "<>\|<" contained
syntax match rlAugmentOps "[>\<$%@][!\^/*~]" contained
syntax match rlAugmentOps "[>$%]?" contained
syntax match rlAugmentOps "<>[!\^/*~]" contained
syntax match rlAugmentOps "=>" contained
syntax match rlOtherOps "->" contained
syntax match rlOtherOps ":>" contained
syntax match rlOtherOps ":>>" contained
syntax match rlOtherOps "<:" contained
" Keywords
" FIXME: Enable the range keyword post 5.17.
" syntax keyword rlKeywords machine action context include range contained
syntax keyword rlKeywords machine action context include import export prepush postpop contained
syntax keyword rlExprKeywords when inwhen outwhen err lerr eof from to contained
" Case Labels
syntax keyword caseLabelKeyword case contained
syntax cluster caseLabelItems contains=ocComment,ocPreproc,ocLiteral,ocType,ocKeyword,caseLabelKeyword,ocNumber,ocBoolean,anyId,fsmType,fsmKeyword
syntax match caseLabelColon "case" contains=@caseLabelItems
syntax match caseLabelColon "case[\t ]\+.*:$" contains=@caseLabelItems
syntax match caseLabelColon "case[\t ]\+.*:[^=:]"me=e-1 contains=@caseLabelItems
" Labels
syntax match ocLabelColon "^[\t ]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:$" contains=anyLabel
syntax match ocLabelColon "^[\t ]*[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:[^=:]"me=e-1 contains=anyLabel
syntax match rlLabelColon "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:$" contained contains=anyLabel
syntax match rlLabelColon "[a-zA-Z_][a-zA-Z_0-9]*[ \t]*:[^=:>]"me=e-1 contained contains=anyLabel
syntax match anyLabel "[a-zA-Z_][a-zA-Z_0-9]*" contained
" All items that can go in a code block.
syntax cluster inlineItems contains=rlCodeCurly,ocComment,ocPreproc,ocLiteral,ocType,ocKeyword,ocNumber,ocBoolean,ocLabelColon,anyId,fsmType,fsmKeyword,caseLabelColon
" Blocks of code. rlCodeCurly is recursive.
syntax region rlCodeCurly matchgroup=NONE start="{" end="}" contained contains=@inlineItems
syntax region rlCodeSemi matchgroup=Type start="\<alphtype\>" start="\<getkey\>" start="\<access\>" start="\<variable\>" matchgroup=NONE end=";" contained contains=@inlineItems
syntax region rlWrite matchgroup=Type start="\<write\>" matchgroup=NONE end="[;)]" contained contains=rlWriteKeywords,rlWriteOptions
syntax keyword rlWriteKeywords init data exec exports start error first_final contained
syntax keyword rlWriteOptions noerror nofinal noprefix noend nocs contained
"
" Sync at the start of machine specs.
"
" Match The ragel delimiters only if there quotes no ahead on the same line.
" On the open marker, use & to consume the leader.
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"%]*%%{&^[^\'\"%]*"
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"%]*%%[^{]&^[^\'\"%]*"
syntax sync match ragelSyncPat grouphere NONE "^[^\'\"]*}%%"
"
" Specifying Groups
"
hi link ocComment Comment
hi link ocPreproc Macro
hi link ocLiteral String
hi link ocType Type
hi link ocKeyword Keyword
hi link ocNumber Number
hi link ocBoolean Boolean
hi link rlComment Comment
hi link rlNumber Number
hi link rlLiteral String
hi link rlAugmentOps Keyword
hi link rlExprKeywords Keyword
hi link rlWriteKeywords Keyword
hi link rlWriteOptions Keyword
hi link rlKeywords Type
hi link fsmType Type
hi link fsmKeyword Keyword
hi link anyLabel Label
hi link caseLabelKeyword Keyword
hi link beginRL Type
let b:current_syntax = "ragel"

@ -0,0 +1,87 @@
"
" You will have to restart vim for this to take effect. In any case
" it is a good idea to read ":he new-filetype" so that you know what
" is going on, and why the above lines work.
"
" Written originally by Dominic Mitchell, Jan 2006.
" happygiraffe.net
"
" Modified by Aaron Bieber, May 2007.
" blog.aaronbieber.com
"
" Modified by Tim Harper, July 2008 - current
" tim.theenchanter.com
" @(#) $Id$
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" Textile commands like "h1" are case sensitive, AFAIK.
syn case match
" Textile syntax: <http://textism.com/tools/textile/>
" Inline elements.
syn match txtEmphasis /_[^_]\+_/
syn match txtBold /\*[^*]\+\*/
syn match txtCite /??.\+??/
syn match txtDeleted /-[^-]\+-/
syn match txtInserted /+[^+]\++/
syn match txtSuper /\^[^^]\+\^/
syn match txtSub /\~[^~]\+\~/
syn match txtSpan /%[^%]\+%/
syn match txtFootnoteRef /\[[0-9]\+]/
syn match txtCode /@[^@]\+@/
" Block elements.
syn match txtHeader /^h1\. .\+/
syn match txtHeader2 /^h2\. .\+/
syn match txtHeader3 /^h[3-6]\..\+/
syn match txtBlockquote /^bq\./
syn match txtFootnoteDef /^fn[0-9]\+\./
syn match txtListBullet /\v^\*+ /
syn match txtListBullet2 /\v^(\*\*)+ /
syn match txtListNumber /\v^#+ /
syn match txtListNumber2 /\v^(##)+ /
syn cluster txtBlockElement contains=txtHeader,txtBlockElement,txtFootnoteDef,txtListBullet,txtListNumber
" Everything after the first colon is from RFC 2396, with extra
" backslashes to keep vim happy... Original:
" ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?
"
" Revised the pattern to exclude spaces from the URL portion of the
" pattern. Aaron Bieber, 2007.
syn match txtLink /"[^"]\+":\(\([^:\/?# ]\+\):\)\?\(\/\/\([^\/?# ]*\)\)\?\([^?# ]*\)\(?\([^# ]*\)\)\?\(#\([^ ]*\)\)\?/
syn cluster txtInlineElement contains=txtEmphasis,txtBold,txtCite,txtDeleted,txtInserted,txtSuper,txtSub,txtSpan
if version >= 508 || !exists("did_txt_syn_inits")
if version < 508
let did_txt_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink txtHeader Title
HiLink txtHeader2 Question
HiLink txtHeader3 Statement
HiLink txtBlockquote Comment
HiLink txtListBullet Operator
HiLink txtListBullet2 Constant
HiLink txtListNumber Operator
HiLink txtListNumber2 Constant
HiLink txtLink String
HiLink txtCode Identifier
hi def txtEmphasis term=underline cterm=underline gui=italic
hi def txtBold term=bold cterm=bold gui=bold
delcommand HiLink
endif
" vim: set ai et sw=4 :

@ -0,0 +1,267 @@
set nocompatible
if filereadable(glob("~/.vimrc.before"))
source ~/.vimrc.before
endif
" pathogen
filetype off
if empty($GOPATH)
let g:pathogen_disabled = []
call add(g:pathogen_disabled, 'go')
endif
execute pathogen#infect()
filetype plugin indent on
""" mappings
let mapleader=','
" let maplocalleader='\\'
noremap <up> <nop>
noremap <down> <nop>
noremap <left> <nop>
noremap <right> <nop>
nnoremap ' `
nnoremap ` '
" nnoremap \ ,
nnoremap Y y$
nnoremap <leader>/ :noh<cr>
nnoremap gt :exec tabpagenr('$') == 1 ? 'bn' : 'tabnext'<cr>
nnoremap gT :exec tabpagenr('$') == 1 ? 'bp' : 'tabprevious'<cr>
nnoremap <C-n> :exec tabpagenr('$') == 1 ? 'bn' : 'tabnext'<cr>
nnoremap <C-p> :exec tabpagenr('$') == 1 ? 'bp' : 'tabprevious'<cr>
cnoremap w!! w !sudo tee % > /dev/null
" inoremap <bs> <nop>
inoremap <esc> <nop>
inoremap <C-c> <esc>
inoremap <C-[> <esc>
" inoremap jk <esc>
command W w
nnoremap <C-h> <C-w><C-h>
nnoremap <C-j> <C-w><C-j>
nnoremap <C-k> <C-w><C-k>
nnoremap <C-l> <C-w><C-l>
" don't unindent lines starting with #
inoremap # X#
" don't change the cursor position when joining lines
" nnoremap J mzJ`z
""" buffers
set hidden
" programming
syntax on
set number
set ttyfast
set lazyredraw
set modelines=1
" has to go after syntax enable
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
" has to go after solarized, wtf?
highlight LongLine term=reverse cterm=reverse ctermfg=1 guifg=Black guibg=Yellow
match LongLine /\%81v./
" searching
set gdefault
set hlsearch
set ignorecase
set smartcase
" encoding
set encoding=utf8
set fileencoding=utf8
set fileformat=unix
" indent/tabbing
set smartindent
set expandtab
set shiftwidth=2
" set softtabstop=2
set tabstop=2
" reading
set linebreak
" set ttyfast
set list
let &listchars = "tab:\u21e5 ,trail:\u2423,extends:\u21c9,precedes:\u21c7,nbsp:\u00b7"
" autogroups
augroup CursorLine
au!
au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
augroup END
if v:version >= 700
augroup BufferScrolling
au!
au BufLeave * if !&diff | let b:winview = winsaveview() | endif
au BufEnter * if exists('b:winview') && !&diff | call winrestview(b:winview) | endif
augroup END
endif
" folding
" set foldmethod=indent
set foldlevel=3
" set nofoldenable
" view
set viewdir=$HOME/.vim_view//
" " au BufWinLeave ?* mkview
au BufWritePost,BufLeave,WinLeave ?* mkview " for tabs
au BufWinEnter ?* silent loadview
" jump to last cursor position when opening a file
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g'\"" |
\ endif
" diffing
set diffopt=filler,context:5
" command mode
set undolevels=1000
set wildmode=list:longest
" backup
set nobackup
" set backupdir=$HOME/.vim_backup//
set directory=$HOME/.vim_tmp//
" shell
" set title
" set titleold=
" customize syntax highlighting
" highlight MatchParen cterm=bold ctermbg=none ctermfg=none
" highlight Folded ctermfg=1 ctermbg=NONE
" highlight FoldColumn ctermfg=1 ctermbg=NONE
" highlight clear Search
" highlight Search ctermfg=6 ctermbg=9 term=underline cterm=underline gui=underline
" ack
set grepprg=ack
" blessed silence
set visualbell
" set t_vb
" move into blank spaces in visual block mode
set virtualedit=block
" splits
set splitbelow
set splitright
" scratch
noremap <leader>s :Scratch<cr>
let g:scratchBackupFile='$HOME/.vim/.scratch'
" Tagbar
nnoremap <silent> <leader>t :TagbarToggle<cr>
let g:tagbar_autoclose=1
let g:tagbar_autofocus=1
let g:tagbar_compact=1
" Command-T
" nnoremap <silent> <leader>f :CommandT<cr>
" let g:CommandTMatchWindowReverse=1
" CtrlP
let g:ctrlp_map = '<leader>p'
let g:ctrlp_match_window='bottom,order:btt,min:1,max:20'
let g:ctrlp_reuse_window='startify'
let g:ctrlp_working_path_mode='ra'
" Startify
let g:startify_change_to_vcs_root = 1
" Gist
let g:gist_detect_filetype=1
let g:gist_open_browser_after_post=1
let g:gist_clip_command = 'pbcopy'
" Gundo
nnoremap <leader>u :GundoToggle<cr>
let g:gundo_preview_bottom=1
" vimwiki
let g:vimwiki_list = [{'path': '~/Dropbox/vimwiki', 'syntax': 'markdown', 'ext': '.md'},
\ {'path': '~/Dropbox/simplymeasured/vimwiki', 'syntax': 'markdown', 'ext': '.md'}]
let g:vimwiki_global_ext = 0
nmap <leader>vw <plug>VimwikiIndex
nmap <leader>vwt <plug>VimwikiTabIndex
nmap <leader>vws <plug>VimwikiUISelect
nmap <leader>vwi <plug>VimwikiDiaryIndex
nmap <leader>vw<leader>w <plug>VimwikiMakeDiaryNote
nmap <leader>vw<leader>t <plug>VimwikiTabMakeDiaryNote
nmap <leader>vw<leader>n :VimwikiDiaryNextDay<cr>
nmap <leader>vw<leader>p :VimwikiDiaryPrevDay<cr>
nmap <leader>vw<leader>i <plug>VimwikiDiaryGenerateLinks
" Vimux
" map <leader>vp :VimuxPromptCommand<cr>
" map <leader>vl :VimuxRunLastCommand<cr>
" map <leader>vq :VimuxCloseRunner<cr>
" gui stuff
set guioptions-=T
set guifont=Consolas:h9:cANSI
set mousehide
" quickfix
autocmd QuickFixCmdPost *grep* cwindow
" populate the argument list with each of the files named in the quickfix list
function! QuickfixFilenames()
let buffer_numbers = {}
for quickfix_item in getqflist()
let buffer_numbers[quickfix_item['bufnr']] =
bufname(quickfix_item['bufnr'])
endfor
return join(map(values(buffer_numbers), 'fnameescape(v:val)'))
endfunction
command! -nargs=0 -bar Qargs execute 'args' QuickfixFilenames()
" Expand %% into the directory of the current file
cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'
if has("gui_running")
" au GUIEnter * simalt ~x " fullscreen
" set transparency=10
set macmeta
set background=light
set guifont=Source\ Code\ Pro\ for\ Powerline:h13
" else
" fix Command-T's selection in Terminal.app
" hi Visual term=reverse cterm=reverse ctermfg=187 ctermbg=235 guifg=Black guibg=Yellow
end
if v:version >= 703
" set relativenumber
set undofile
set undodir=$HOME/.vim_undo//
" omnicomplete
set completeopt=longest,menuone
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<cr>"
inoremap <expr> <C-n> pumvisible() ? '<C-n>' :
\ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<cr>'
highlight Pmenu ctermbg=grey ctermfg=black
highlight PmenuSel ctermbg=magenta ctermfg=black
" set colorcolumn=81
endif
if filereadable(glob("~/.vimrc.local"))
source ~/.vimrc.local
endif
Loading…
Cancel
Save