Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Add vim configuration and bundle. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
fa2e9eaf5a6f6f831c1df1b47989410b |
| User & Date: | mastersrp 2013-12-09 02:34:35.997 |
Context
|
2013-12-09
| ||
| 02:53 | Add ZSH and antigen support. check-in: 3a6e4b8425 user: mastersrp tags: trunk | |
| 02:34 | Add vim configuration and bundle. check-in: fa2e9eaf5a user: mastersrp tags: trunk | |
| 02:29 | initial empty check-in check-in: 247126c700 user: mastersrp tags: trunk | |
Changes
Added .fossil-settings/ignore-glob.
> | 1 | .vim/bundle |
Added .vim/bundle/neobundle.vim/README.md.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
[](https://waffle.io/Shougo/neobundle.vim)
## About
NeoBundle is a Vim plugin manager inspired by Vundle(https://github.com/gmarik/vundle).
Requirements: Vim 7.2.051 or above.
## Advantages
1. improved command name(:Bundle vs :NeoBundle).
2. neobundle works if you set 'shellslash' in your .vimrc.
3. neobundle supports vimproc(asynchronous update/install).
4. neobundle supports unite.vim interface(update/install/search).
5. neobundle supports revision lock feature.
6. neobundle supports other VCS(Subversion/Git).
7. neobundle supports lazy initialization for optimizing startup time.
8. and so on...
## Quick start
1. Setup NeoBundle:
```
$ mkdir -p ~/.vim/bundle
$ git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
```
2. Configure bundles:
Sample `.vimrc`:
```vim
if has('vim_starting')
set nocompatible " Be iMproved
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#rc(expand('~/.vim/bundle/'))
" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'
" Recommended to install
" After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
NeoBundle 'Shougo/vimproc'
" My Bundles here:
"
" Note: You don't set neobundle setting in .gvimrc!
" Original repos on github
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'Lokaltog/vim-easymotion', '09c0cea8' " This plugin is locked at revision 09c0cea8
NeoBundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" vim-scripts repos
NeoBundle 'L9'
NeoBundle 'FuzzyFinder'
NeoBundle 'rails.vim'
" Non github repos
NeoBundle 'git://git.wincent.com/command-t.git'
" gist repos
NeoBundle 'gist:Shougo/656148', {
\ 'name': 'everything.vim',
\ 'script_type': 'plugin'}
" Non git repos
NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'
NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'
" ...
filetype plugin indent on " Required!
"
" Brief help
" :NeoBundleList - list configured bundles
" :NeoBundleInstall(!) - install(update) bundles
" :NeoBundleClean(!) - confirm(or auto-approve) removal of unused bundles
" Installation check.
NeoBundleCheck
```
3. Install configured bundles:
Launch `vim`, run `:NeoBundleInstall`, or `:Unite neobundle/install`(required unite.vim)
Or Command run `bin/neoinstall`
## Docs
see `:h neobundle`
|
Added .vim/bundle/neobundle.vim/autoload/neobundle.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 |
"=============================================================================
" FILE: neobundle.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
" Last Modified: 15 Nov 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
" Version: 3.0, for Vim 7.2
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
" Check 'term' option value.
if exists('g:loaded_neobundle') && &term ==# 'builtin_gui'
echoerr 'neobundle is initialized in .gvimrc!'
\' neobundle must be initialized in .vimrc.'
endif
if v:version < 702
echoerr 'neobundle does not work this version of Vim (' . v:version . ').'
finish
endif
" Global options definition." "{{{
call neobundle#util#set_default(
\ 'g:neobundle#log_filename', '', 'g:neobundle_log_filename')
call neobundle#util#set_default(
\ 'g:neobundle#default_site', 'github', 'g:neobundle_default_site')
call neobundle#util#set_default(
\ 'g:neobundle#enable_name_conversion', 0)
call neobundle#util#set_default(
\ 'g:neobundle#default_options', {})
"}}}
let s:neobundle_dir = get(
\ filter(split(globpath(&runtimepath, 'bundle', 1), '\n'),
\ 'isdirectory(v:val)'), 0, '~/.vim/bundle')
let g:neobundle#tapped = {}
command! -nargs=+ NeoBundle
\ call neobundle#parser#bundle(
\ substitute(<q-args>, '\s"[^"]\+$', '', ''))
command! -bar NeoBundleCheck
\ call neobundle#check()
command! -nargs=+ NeoBundleLazy
\ call neobundle#parser#lazy(
\ substitute(<q-args>, '\s"[^"]\+$', '', ''))
command! -nargs=+ NeoBundleFetch
\ call neobundle#parser#fetch(
\ substitute(<q-args>, '\s"[^"]\+$', '', ''))
command! -nargs=+ NeoBundleRecipe
\ call neobundle#parser#recipe(
\ substitute(<q-args>, '\s"[^"]\+$', '', ''))
command! -nargs=1 -complete=dir NeoBundleLocal
\ call neobundle#local(<q-args>, {})
command! -nargs=+ NeoBundleDepends
\ call neobundle#parser#depends(
\ substitute(<q-args>, '\s"[^"]\+$', '', ''))
command! -nargs=+ NeoBundleDirectInstall
\ call neobundle#parser#direct(
\ substitute(<q-args>, '\s"[^"]\+$', '', ''))
command! -nargs=* -bar
\ -complete=customlist,neobundle#complete_lazy_bundles
\ NeoBundleSource
\ call neobundle#config#source([<f-args>])
command! -nargs=+ -bar
\ -complete=customlist,neobundle#complete_bundles
\ NeoBundleDisable
\ call neobundle#config#disable(<f-args>)
command! -nargs=? -bang -bar
\ -complete=customlist,neobundle#complete_bundles
\ NeoBundleInstall
\ call neobundle#installer#install('!' == '<bang>', <q-args>)
command! -nargs=? -bang -bar
\ -complete=customlist,neobundle#complete_bundles
\ NeoBundleUpdate
\ call neobundle#installer#install(('!' == '<bang>' ? 2 : 1), <q-args>)
command! -nargs=? -bang -bar
\ -complete=customlist,neobundle#complete_deleted_bundles
\ NeoBundleClean
\ call neobundle#installer#clean('!' == '<bang>', <q-args>)
command! -nargs=+ -bang -bar
\ -complete=customlist,neobundle#complete_bundles
\ NeoBundleReinstall
\ call neobundle#installer#reinstall_names(<q-args>)
command! -nargs=? -bang -bar
\ NeoBundleList
\ echo join(map(neobundle#config#get_neobundles(), 'v:val.name'), "\n")
command! -bar NeoBundleDocs
\ call neobundle#installer#helptags(neobundle#config#get_neobundles())
command! -bar NeoBundleLog
\ echo join(neobundle#installer#get_log(), "\n")
command! -bar NeoBundleUpdatesLog
\ echo join(neobundle#installer#get_updates_log(), "\n")
command! -bar NeoBundleDirectEdit
\ execute 'edit' fnameescape(neobundle#get_neobundle_dir()).'/direct_bundles.vim'
let s:neobundle_runtime_dir = neobundle#util#substitute_path_separator(
\ fnamemodify(expand('<sfile>'), ':p:h:h'))
function! neobundle#rc(...)
if a:0 > 0
let s:neobundle_dir = a:1
endif
let s:neobundle_dir =
\ neobundle#util#substitute_path_separator(
\ neobundle#util#expand(s:neobundle_dir))
if s:neobundle_dir =~ '/$'
let s:neobundle_dir = s:neobundle_dir[: -2]
endif
" Join to the tail in runtimepath.
let rtp = neobundle#get_rtp_dir()
execute 'set rtp-='.fnameescape(rtp)
let rtps = neobundle#util#split_rtp(&runtimepath)
let n = index(rtps, $VIMRUNTIME)
let &runtimepath = neobundle#util#join_rtp(
\ insert(rtps, rtp, n-1), &runtimepath, rtp)
augroup neobundle
autocmd!
augroup END
call neobundle#config#init()
call neobundle#autoload#init()
endfunction
function! neobundle#get_neobundle_dir()
return s:neobundle_dir
endfunction
function! neobundle#get_runtime_dir()
return s:neobundle_runtime_dir
endfunction
function! neobundle#get_tags_dir()
let dir = neobundle#get_neobundle_dir() . '/.neobundle/doc'
if !isdirectory(dir)
call mkdir(dir, 'p')
endif
return dir
endfunction
function! neobundle#get_rtp_dir()
return s:neobundle_dir . '/.neobundle'
endfunction
function! neobundle#source(bundle_names)
return neobundle#config#source(a:bundle_names)
endfunction
function! neobundle#complete_bundles(arglead, cmdline, cursorpos)
return filter(map(neobundle#config#get_neobundles(), 'v:val.name'),
\ 'stridx(tolower(v:val), tolower(a:arglead)) >= 0')
endfunction
function! neobundle#complete_lazy_bundles(arglead, cmdline, cursorpos)
return filter(map(filter(neobundle#config#get_neobundles(),
\ "!neobundle#config#is_sourced(v:val.name) && v:val.rtp != ''"), 'v:val.name'),
\ 'stridx(tolower(v:val), tolower(a:arglead)) == 0')
endfunction
function! neobundle#complete_deleted_bundles(arglead, cmdline, cursorpos)
let bundle_dirs = map(copy(neobundle#config#get_neobundles()), 'v:val.path')
let all_dirs = split(neobundle#util#substitute_path_separator(
\ globpath(neobundle#get_neobundle_dir(), '*', 1)), "\n")
let x_dirs = filter(all_dirs, 'index(bundle_dirs, v:val) < 0')
return filter(map(x_dirs, "fnamemodify(v:val, ':t')"),
\ 'stridx(v:val, a:arglead) == 0')
endfunction
function! neobundle#local(localdir, ...)
let options = get(a:000, 0, {})
return neobundle#parser#local(a:localdir, options)
endfunction
function! neobundle#exists_not_installed_bundles()
return !empty(neobundle#get_not_installed_bundles([]))
endfunction
function! neobundle#is_installed(...)
return type(get(a:000, 0, [])) == type([]) ?
\ !empty(neobundle#_get_installed_bundles(get(a:000, 0, []))) :
\ neobundle#config#is_installed(a:1)
endfunction
function! neobundle#is_sourced(name)
return neobundle#config#is_sourced(a:name)
endfunction
function! neobundle#get_not_installed_bundle_names()
return map(neobundle#get_not_installed_bundles([]), 'v:val.name')
endfunction
function! neobundle#get_not_installed_bundles(bundle_names)
let bundles = empty(a:bundle_names) ?
\ neobundle#config#get_neobundles() :
\ neobundle#config#fuzzy_search(a:bundle_names)
call neobundle#installer#_load_install_info(bundles)
return filter(copy(bundles), "
\ v:val.rtp != '' && !v:val.local
\ && !isdirectory(neobundle#util#expand(v:val.path))
\")
endfunction
function! neobundle#get(name)
return neobundle#config#get(a:name)
endfunction
function! neobundle#get_hooks(name)
return get(neobundle#config#get(a:name), 'hooks', {})
endfunction
function! neobundle#tap(name) "{{{
let g:neobundle#tapped = neobundle#get(a:name)
return !empty(g:neobundle#tapped)
endfunction"}}}
function! neobundle#untap() "{{{
let g:neobundle#tapped = {}
endfunction"}}}
function! neobundle#config(arg, ...)
" Use neobundle#tapped or name.
return type(a:arg) == type({}) ?
\ neobundle#config#set(g:neobundle#tapped.name, a:arg) :
\ neobundle#config#set(a:arg, a:1)
endfunction
function! neobundle#call_hook(hook_name, ...)
let bundles = neobundle#util#convert2list(
\ (empty(a:000) ? neobundle#config#get_neobundles() : a:1))
let bundles = filter(copy(bundles),
\ 'has_key(v:val.hooks, a:hook_name) &&
\ !has_key(v:val.called_hooks, a:hook_name)')
if a:hook_name ==# 'on_source' || a:hook_name ==# 'on_post_source'
let bundles = filter(neobundle#config#tsort(filter(bundles,
\ 'neobundle#config#is_sourced(v:val.name) &&
\ neobundle#config#is_installed(v:val.name)')),
\ 'has_key(v:val.hooks, a:hook_name)
\ && !has_key(v:val.called_hooks, a:hook_name)')
endif
for bundle in bundles
call call(bundle.hooks[a:hook_name], [bundle], bundle)
let bundle.called_hooks[a:hook_name] = 1
endfor
endfunction
function! neobundle#check()
if neobundle#installer#get_tags_info() !=#
\ sort(map(neobundle#config#get_neobundles(), 'v:val.name'))
" Recache automatically.
NeoBundleDocs
endif
if !neobundle#exists_not_installed_bundles()
return
endif
if has('gui_running') && has('vim_starting')
" Note: :NeoBundleCheck cannot work in GUI startup.
autocmd neobundle VimEnter * NeoBundleCheck
else
echomsg 'Not installed bundles: '
\ string(neobundle#get_not_installed_bundle_names())
if confirm('Install bundles now?', "yes\nNo", 2) == 1
call neobundle#installer#install(0, '')
endif
echo ''
endif
endfunction
function! neobundle#_get_installed_bundles(bundle_names)
let bundles = empty(a:bundle_names) ?
\ neobundle#config#get_neobundles() :
\ neobundle#config#search(a:bundle_names)
return filter(copy(bundles),
\ 'neobundle#config#is_installed(v:val.name)')
endfunction
function! neobundle#get_unite_sources()
return neobundle#autoload#get_unite_sources()
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/autoload.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
"=============================================================================
" FILE: autoload.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
" Last Modified: 26 Nov 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! neobundle#autoload#init()
augroup neobundle
autocmd FileType *
\ call neobundle#autoload#filetype()
autocmd FuncUndefined *
\ call neobundle#autoload#function()
autocmd InsertEnter *
\ call neobundle#autoload#insert()
autocmd BufCreate
\ * call neobundle#autoload#explorer(
\ expand('<amatch>'), 'BufCreate')
autocmd BufEnter
\ * call neobundle#autoload#explorer(
\ expand('<amatch>'), 'BufEnter')
autocmd BufWinEnter
\ * call neobundle#autoload#explorer(
\ expand('<amatch>'), 'BufWinEnter')
augroup END
endfunction
function! neobundle#autoload#filetype()
let bundles = filter(neobundle#config#get_autoload_bundles(),
\ "has_key(v:val.autoload, 'filetypes')")
for filetype in neobundle#util#get_filetypes()
call neobundle#config#source_bundles(filter(copy(bundles),"
\ index(neobundle#util#convert2list(
\ v:val.autoload.filetypes), filetype) >= 0"))
endfor
endfunction
function! neobundle#autoload#insert()
let bundles = filter(neobundle#config#get_autoload_bundles(),
\ "get(v:val.autoload, 'insert', 0)")
if !empty(bundles)
call neobundle#config#source_bundles(bundles)
doautocmd InsertEnter
endif
endfunction
function! neobundle#autoload#function()
let function = expand('<amatch>')
let function_prefix = get(split(function, '#'), 0, '') . '#'
let bundles = filter(neobundle#config#get_autoload_bundles(),
\ "get(v:val.autoload, 'function_prefix', '').'#' ==# function_prefix ||
\ (has_key(v:val.autoload, 'functions') &&
\ index(neobundle#util#convert2list(
\ v:val.autoload.functions), function) >= 0)")
call neobundle#config#source_bundles(bundles)
endfunction
function! neobundle#autoload#command(command, name, args, bang, line1, line2)
" Delete dummy commands.
silent! execute 'delcommand' a:command
call neobundle#config#source(a:name)
let range = (a:line1 != a:line2 || a:line1 != line('.')) ?
\ '' : (a:line1.','.a:line2)
try
execute range.a:command.a:bang a:args
catch /^Vim\%((\a\+)\)\=:E481/
" E481: No range allowed
execute a:command.a:bang a:args
endtry
endfunction
function! neobundle#autoload#mapping(mapping, name, mode)
let cnt = v:count > 0 ? v:count : ''
" Delete dummy mappings.
let input = s:get_input()
call neobundle#config#source(a:name)
if a:mode ==# 'v' || a:mode ==# 'x'
call feedkeys('gv', 'n')
elseif a:mode ==# 'o'
" TODO: omap
" v:prevcount?
" Cancel waiting operator mode.
" call feedkeys("\<C-\\>\<C-n>", 'n')
call feedkeys("\<Esc>", 'n')
call feedkeys(v:operator, 'm')
endif
call feedkeys(cnt, 'n')
let mapping = substitute(a:mapping, '<Plug>', "\<Plug>", 'g')
call feedkeys(mapping . input, 'm')
endfunction
function! neobundle#autoload#explorer(path, event)
if bufnr('%') != expand('<abuf>') || a:path == ''
return
endif
let path = a:path
" For ":edit ~".
if fnamemodify(path, ':t') ==# '~'
let path = '~'
endif
let path = s:expand(path)
if !(isdirectory(path) || (!filereadable(path) && path =~ '^\h\w\+://'))
return
endif
let bundles = filter(neobundle#config#get_autoload_bundles(),
\ "get(v:val.autoload, 'explorer', 0)")
if !empty(bundles)
call neobundle#config#source_bundles(bundles)
execute 'doautocmd' a:event
endif
endfunction
function! neobundle#autoload#unite_sources(sources)
let bundles = []
let sources_bundles = filter(neobundle#config#get_autoload_bundles(),
\ "has_key(v:val.autoload, 'unite_sources')")
for source_name in a:sources
if source_name ==# 'source'
" In source source, load all sources.
let bundles += copy(sources_bundles)
else
let bundles += filter(copy(sources_bundles),
\ "index(neobundle#util#convert2list(
\ v:val.autoload.unite_sources), source_name) >= 0")
endif
endfor
call neobundle#config#source_bundles(neobundle#util#uniq(bundles))
endfunction
function! neobundle#autoload#get_unite_sources()
let _ = []
let sources_bundles = filter(neobundle#config#get_autoload_bundles(),
\ "has_key(v:val.autoload, 'unite_sources')")
for bundle in sources_bundles
let _ += neobundle#util#convert2list(
\ bundle.autoload.unite_sources)
endfor
return _
endfunction
function! neobundle#autoload#source(bundle_name)
let bundles = filter(neobundle#config#get_autoload_bundles(),
\ "index(neobundle#util#convert2list(
\ get(v:val.autoload, 'on_source', [])), a:bundle_name) >= 0")
call neobundle#config#source_bundles(bundles)
endfunction
function! s:get_input()
let input = ''
let termstr = "<M-_>"
call feedkeys(termstr, 'n')
while 1
let input .= nr2char(getchar())
let idx = stridx(input, termstr)
if idx >= 1
let input = input[: idx - 1]
break
elseif idx == 0
let input = ''
break
endif
endwhile
return input
endfunction
function! s:expand(path)
return neobundle#util#substitute_path_separator(
\ (a:path =~ '^\~') ? substitute(a:path, '^\~', expand('~'), '') :
\ (a:path =~ '^\$\h\w*') ? substitute(a:path,
\ '^\$\h\w*', '\=eval(submatch(0))', '') :
\ a:path)
endfunction
function! s:get_lazy_bundles()
return filter(neobundle#config#get_neobundles(),
\ "!neobundle#config#is_sourced(v:val.name)
\ && v:val.rtp != '' && v:val.lazy")
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/config.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
"=============================================================================
" FILE: config.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
" Last Modified: 26 Nov 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
if !exists('s:neobundles')
let s:neobundles = {}
let s:sourced_neobundles = {}
let neobundle#tapped = {}
endif
function! neobundle#config#init() "{{{
filetype off
for bundle in values(s:neobundles)
if (!bundle.resettable && !bundle.lazy) ||
\ (bundle.sourced && bundle.lazy
\ && neobundle#is_sourced(bundle.name))
call neobundle#config#rtp_add(bundle)
elseif bundle.resettable
" Reset.
call neobundle#config#rtp_rm(bundle)
call remove(s:neobundles, bundle.name)
endif
endfor
" Load direct installed bundles.
call neobundle#config#load_direct_bundles()
augroup neobundle
autocmd VimEnter * call s:on_vim_enter()
augroup END
endfunction"}}}
function! neobundle#config#get(name) "{{{
return get(s:neobundles, a:name, {})
endfunction"}}}
function! neobundle#config#get_neobundles() "{{{
return values(s:neobundles)
endfunction"}}}
function! neobundle#config#get_autoload_bundles() "{{{
return filter(values(s:neobundles),
\ "!v:val.sourced && v:val.rtp != '' && v:val.lazy")
endfunction"}}}
function! neobundle#config#source_bundles(bundles) "{{{
if !empty(a:bundles)
call neobundle#config#source(map(copy(a:bundles),
\ "type(v:val) == type({}) ? v:val.name : v:val"))
endif
endfunction"}}}
function! neobundle#config#check_not_exists(names, ...) "{{{
" For infinite loop.
let self = get(a:000, 0, [])
let _ = map(neobundle#get_not_installed_bundles(a:names), 'v:val.name')
for bundle in map(filter(copy(a:names),
\ 'index(self, v:val) < 0 && has_key(s:neobundles, v:val)'),
\ 's:neobundles[v:val]')
call add(self, bundle.name)
if !empty(bundle.depends)
let _ += neobundle#config#check_not_exists(
\ map(copy(bundle.depends), 'v:val.name'), self)
endif
endfor
return neobundle#util#uniq(_)
endfunction"}}}
function! neobundle#config#source(names, ...) "{{{
let is_force = get(a:000, 0, 1)
let names = neobundle#util#convert2list(a:names)
let bundles = empty(names) ?
\ neobundle#config#get_neobundles() :
\ neobundle#config#search(names)
let not_exists = neobundle#config#check_not_exists(names)
if !empty(not_exists)
call neobundle#util#print_error(
\ 'Not installed plugin-names are detected : '. string(not_exists))
endif
let rtps = neobundle#util#split_rtp()
let bundles = filter(bundles,
\ "!neobundle#config#is_sourced(v:val.name) ||
\ (v:val.rtp != '' && index(rtps, v:val.rtp) < 0)")
if empty(bundles)
return
endif
let filetype_out = ''
redir => filetype_out
silent filetype
redir END
redir => filetype_before
execute 'silent autocmd FileType' &filetype
redir END
let reset_ftplugin = 0
for bundle in bundles
let bundle.sourced = 1
let bundle.disabled = 0
if !get(s:sourced_neobundles, bundle.name, 0)
" Unmap dummy mappings.
for [mode, mapping] in get(bundle, 'dummy_mappings', [])
silent! execute mode.'unmap' mapping
endfor
" Delete dummy commands.
for command in get(bundle, 'dummy_commands', [])
silent! execute 'delcommand' command
endfor
let s:sourced_neobundles[bundle.name] = 1
endif
let bundle.dummy_mappings = []
let bundle.dummy_commands = []
call neobundle#config#rtp_add(bundle)
call neobundle#autoload#source(bundle.name)
if exists('g:loaded_neobundle') || is_force
call neobundle#call_hook('on_source', bundle)
" Reload script files.
for directory in filter(
\ ['ftdetect', 'after/ftdetect', 'plugin', 'after/plugin'],
\ "isdirectory(bundle.rtp.'/'.v:val)")
for file in split(glob(bundle.rtp.'/'.directory.'/**/*.vim'), '\n')
silent! source `=file`
endfor
endfor
if exists('#'.bundle.augroup.'#VimEnter')
execute 'silent doautocmd' bundle.augroup 'VimEnter'
if has('gui_running') && &term ==# 'builtin_gui'
execute 'silent doautocmd' bundle.augroup 'GUIEnter'
endif
endif
endif
if !reset_ftplugin
for filetype in split(&filetype, '\.')
for directory in ['ftplugin', 'indent', 'syntax',
\ 'after/ftplugin', 'after/indent', 'after/syntax']
let base = bundle.rtp . '/' . directory
if filereadable(base.'/'.filetype.'.vim') ||
\ (directory =~# 'ftplugin$' &&
\ isdirectory(base . '/' . filetype) ||
\ glob(base.'/'.filetype.'_*.vim') != '')
let reset_ftplugin = 1
break
endif
endfor
endfor
endif
endfor
redir => filetype_after
execute 'silent autocmd FileType' &filetype
redir END
if reset_ftplugin
filetype off
if filetype_out =~# 'detection:ON'
silent! filetype on
endif
if filetype_out =~# 'plugin:ON'
silent! filetype plugin on
endif
if filetype_out =~# 'indent:ON'
silent! filetype indent on
endif
" Reload filetype plugins.
let &l:filetype = &l:filetype
elseif filetype_before !=# filetype_after
execute 'doautocmd FileType' &filetype
endif
if exists('g:loaded_neobundle')
call neobundle#call_hook('on_post_source', bundles)
endif
endfunction"}}}
function! neobundle#config#disable(arg) "{{{
let bundle_names = neobundle#config#search(split(a:arg))
if empty(bundle_names)
return
endif
for bundle in bundle_names
call neobundle#config#rtp_rm(bundle)
let bundle.sourced = 0
let bundle.disabled = 1
endfor
endfunction"}}}
function! neobundle#config#is_sourced(name) "{{{
return get(neobundle#config#get(a:name), 'sourced', 0)
endfunction"}}}
function! neobundle#config#is_installed(name) "{{{
return isdirectory(get(neobundle#config#get(a:name), 'path', ''))
endfunction"}}}
function! neobundle#config#rm(path) "{{{
for bundle in filter(neobundle#config#get_neobundles(),
\ 'v:val.path ==# a:path')
call neobundle#config#rtp_rm(bundle)
call remove(s:neobundles, bundle.name)
endfor
endfunction"}}}
function! neobundle#config#get_types(...) "{{{
if !exists('s:neobundle_types')
" Load neobundle types.
let s:neobundle_types = []
for define in map(split(globpath(&runtimepath,
\ 'autoload/neobundle/types/*.vim', 1), '\n'),
\ "neobundle#types#{fnamemodify(v:val, ':t:r')}#define()")
for dict in neobundle#util#convert2list(define)
if !empty(dict)
call add(s:neobundle_types, dict)
endif
endfor
unlet define
endfor
let s:neobundle_types = neobundle#util#uniq(
\ s:neobundle_types, 'v:val.name')
endif
let type = get(a:000, 0, '')
return (type == '') ? s:neobundle_types :
\ get(filter(copy(s:neobundle_types), 'v:val.name ==# type'), 0, {})
endfunction"}}}
function! neobundle#config#rtp_rm_all_bundles() "{{{
call filter(values(s:neobundles), 'neobundle#config#rtp_rm(v:val)')
endfunction"}}}
function! neobundle#config#rtp_rm(bundle) "{{{
execute 'set rtp-='.fnameescape(a:bundle.rtp)
if isdirectory(a:bundle.rtp.'/after')
execute 'set rtp-='.fnameescape(a:bundle.rtp.'/after')
endif
endfunction"}}}
function! neobundle#config#rtp_add(bundle) abort "{{{
if has_key(s:neobundles, a:bundle.name)
call neobundle#config#rtp_rm(s:neobundles[a:bundle.name])
endif
let rtp = a:bundle.rtp
if isdirectory(rtp)
" Join to the tail in runtimepath.
let rtps = neobundle#util#split_rtp(&runtimepath)
let &runtimepath = neobundle#util#join_rtp(
\ insert(rtps, rtp,
\ (a:bundle.lazy ? 0 : index(rtps, neobundle#get_rtp_dir()))),
\ &runtimepath, rtp)
endif
if isdirectory(rtp.'/after')
execute 'set rtp+='.fnameescape(rtp.'/after')
endif
endfunction"}}}
function! neobundle#config#search(bundle_names, ...) "{{{
" For infinite loop.
let self = get(a:000, 0, [])
let _ = []
for bundle in copy(filter(neobundle#config#get_neobundles(),
\ 'index(self, v:val.name) < 0 &&
\ index(a:bundle_names, v:val.name) >= 0'))
call add(self, bundle.name)
let _ += neobundle#config#search(
\ map(copy(bundle.depends), 'v:val.name'), self)
call add(_, bundle)
endfor
return neobundle#util#uniq(_)
endfunction"}}}
function! neobundle#config#search_simple(bundle_names) "{{{
return filter(neobundle#config#get_neobundles(),
\ 'index(a:bundle_names, v:val.name) >= 0')
endfunction"}}}
function! neobundle#config#fuzzy_search(bundle_names) "{{{
let bundles = []
for name in a:bundle_names
let bundles += filter(neobundle#config#get_neobundles(),
\ 'stridx(v:val.name, name) >= 0')
endfor
let _ = []
for bundle in bundles
let _ += neobundle#config#search(
\ map(copy(bundle.depends), 'v:val.name'))
call add(_, bundle)
endfor
return neobundle#util#uniq(_)
endfunction"}}}
function! neobundle#config#load_direct_bundles() "{{{
let path = neobundle#get_neobundle_dir() . '/direct_bundles.vim'
if filereadable(path)
source `=path`
endif
endfunction"}}}
function! neobundle#config#save_direct(arg) "{{{
if neobundle#util#is_sudo()
call neobundle#util#print_error(
\ '"sudo vim" is detected. This feature is disabled.')
return
endif
let path = neobundle#get_neobundle_dir() . '/direct_bundles.vim'
let bundles = filereadable(path) ? readfile(path) : []
call writefile(add(bundles, 'NeoBundle ' . a:arg), path)
endfunction"}}}
function! neobundle#config#set(name, dict) "{{{
let bundle = neobundle#config#get(a:name)
if empty(bundle)
return
endif
let bundle = neobundle#init#_bundle(extend(bundle, a:dict))
if bundle.lazy && bundle.sourced &&
\ !get(s:sourced_neobundles, bundle.name, 0)
" Remove from runtimepath.
call neobundle#config#rtp_rm(bundle)
let bundle.sourced = 0
endif
call neobundle#config#add(bundle, 1)
endfunction"}}}
function! neobundle#config#add(bundle, ...) "{{{
let bundle = a:bundle
let is_force = get(a:000, 0, bundle.local)
if (!is_force && !bundle.overwrite &&
\ has_key(s:neobundles, bundle.name))
return
endif
let prev_bundle = get(s:neobundles, bundle.name, {})
if get(prev_bundle, 'local', 0) && !bundle.local
return
endif
if !empty(prev_bundle)
call neobundle#config#rtp_rm(prev_bundle)
endif
let s:neobundles[bundle.name] = bundle
if bundle.disabled
\ || (bundle.gui && !has('gui_running'))
\ || (bundle.terminal && has('gui_running'))
\ || (bundle.vim_version != ''
\ && s:check_version(bundle.vim_version))
\ || (!empty(bundle.external_commands)
\ && s:check_external_commands(bundle))
" Ignore load.
return
endif
" Add depends.
for depend in a:bundle.depends
if !has_key(s:neobundles, depend.name)
call neobundle#config#add(depend)
elseif !depend.lazy
" Load automatically.
call neobundle#config#source(depend.name)
endif
endfor
if !bundle.lazy && bundle.rtp != ''
if !has('vim_starting')
" Load automatically.
call neobundle#config#source(bundle.name)
else
let bundle.sourced = 1
call neobundle#config#rtp_add(bundle)
endif
elseif bundle.lazy
if neobundle#config#is_sourced(bundle.name)
" Already sourced.
call neobundle#config#rtp_add(bundle)
else
let bundle.dummy_commands = []
for item in neobundle#util#convert2list(
\ get(bundle.autoload, 'commands', []))
let command = type(item) == type('') ?
\ { 'name' : item } : item
" Define dummy commands.
silent! execute 'command ' . (get(command, 'complete', '') != '' ?
\ ('-complete=' . command.complete) : '')
\ . ' -bang -range -nargs=*' command.name printf(
\ "call neobundle#autoload#command(%s, %s, <q-args>,
\ expand('<bang>'), expand('<line1>'), expand('<line2>'))",
\ string(command.name), string(bundle.name))
unlet item
call add(bundle.dummy_commands, command.name)
endfor
let bundle.dummy_mappings = []
for item in neobundle#util#convert2list(
\ get(bundle.autoload, 'mappings', []))
if type(item) == type([])
let [modes, mappings] = [item[0], item[1:]]
else
let [modes, mappings] = ['nxo', [item]]
endif
for mapping in mappings
" Define dummy mappings.
for mode in filter(split(modes, '\zs'),
\ "index(['n', 'v', 'x', 'o', 'i'], v:val) >= 0")
silent! execute mode.'noremap <unique><silent>' mapping printf(
\ (mode ==# 'i' ? "\<C-o>:" : ":\<C-u>").
\ "call neobundle#autoload#mapping(%s, %s, %s)<CR>",
\ string(mapping), string(bundle.name), string(mode))
call add(bundle.dummy_mappings, [mode, mapping])
endfor
endfor
unlet item
endfor
" Load ftdetect.
for directory in filter(['ftdetect', 'after/ftdetect'],
\ "isdirectory(bundle.rtp.'/'.v:val)")
for file in split(glob(bundle.rtp.'/'.directory.'/**/*.vim'), '\n')
silent! source `=file`
endfor
endfor
endif
endif
if !is_force && bundle.overwrite &&
\ !empty(prev_bundle) && prev_bundle.overwrite &&
\ bundle.orig_arg !=# prev_bundle.orig_arg &&
\ prev_bundle.resettable && prev_bundle.overwrite
" echomsg string(bundle.orig_arg)
" echomsg string(prev_bundle.orig_arg)
" Warning.
call neobundle#util#print_error(
\ 'Overwrite previous neobundle configuration in ' . bundle.name)
endif
endfunction"}}}
function! neobundle#config#tsort(bundles) "{{{
let sorted = []
let mark = {}
for target in a:bundles
call s:tsort_impl(target, a:bundles, mark, sorted)
endfor
return sorted
endfunction"}}}
function! s:tsort_impl(target, bundles, mark, sorted) "{{{
if has_key(a:mark, a:target.name)
return
endif
let a:mark[a:target.name] = 1
for depend in get(a:target, 'depends', [])
call s:tsort_impl(get(s:neobundles, depend.name, depend),
\ a:bundles, a:mark, a:sorted)
endfor
call add(a:sorted, a:target)
endfunction"}}}
function! s:on_vim_enter() "{{{
" Call hooks.
call neobundle#call_hook('on_source')
call neobundle#call_hook('on_post_source')
endfunction"}}}
function! s:check_version(min_version) "{{{
let versions = split(a:min_version, '\.')
let major = get(versions, 0, 0)
let minor = get(versions, 1, 0)
let patch = get(versions, 2, 0)
let min_version = major * 100 + minor
return v:version < min_version ||
\ (patch != 0 && v:version == min_version && !has('patch'.patch))
endfunction"}}}
function! s:check_external_commands(bundle) "{{{
" Environment check.
let external_commands = a:bundle.external_commands
if type(external_commands) == type([])
\ || type(external_commands) == type('')
let commands = external_commands
elseif neobundle#util#is_windows() && has_key(external_commands, 'windows')
let commands = external_commands.windows
elseif neobundle#util#is_mac() && has_key(external_commands, 'mac')
let commands = external_commands.mac
elseif neobundle#util#is_cygwin() && has_key(external_commands, 'cygwin')
let commands = external_commands.cygwin
elseif !neobundle#util#is_windows() && has_key(external_commands, 'unix')
let commands = external_commands.unix
elseif has_key(external_commands, 'others')
let commands = external_commands.others
else
" Invalid.
return 0
endif
for command in neobundle#util#convert2list(commands)
if !executable(command)
return 1
endif
endfor
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/init.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
"=============================================================================
" FILE: init.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
" Last Modified: 22 Oct 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! neobundle#init#_bundle(bundle) "{{{
let bundle = a:bundle
if !has_key(bundle, 'type') && get(bundle, 'local', 0)
" Default type.
let bundle.type = 'nosync'
endif
if !has_key(bundle, 'type')
call neobundle#installer#error(
\ printf('Failed parse name "%s" and args %s',
\ a:bundle.orig_name, string(a:bundle.orig_opts)))
return {}
endif
let bundle = extend(bundle, s:get_default(), 'keep')
if !has_key(bundle, 'name')
let bundle.name = neobundle#util#name_conversion(bundle.orig_name)
endif
if !has_key(bundle, 'normalized_name')
let normalized_name = fnamemodify(bundle.name, ':r')
let normalized_name = substitute(normalized_name,
\ '^vim-', '', '')
let normalized_name = substitute(normalized_name,
\ '-vim$', '', '')
let bundle.normalized_name = normalized_name
endif
if !has_key(bundle.orig_opts, 'name') &&
\ g:neobundle#enable_name_conversion
" Use normalized name.
let bundle.name = bundle.normalized_name
endif
if !has_key(bundle, 'directory')
let bundle.directory = bundle.name
endif
let bundle.base = s:expand_path(bundle.base)
if bundle.base =~ '[/\\]$'
" Chomp.
let bundle.base = substitute(bundle.base, '[/\\]\+$', '', '')
endif
if bundle.rev != ''
let bundle.directory .= '_' . substitute(bundle.rev,
\ '[^[:alnum:]_.-]', '', 'g')
endif
let bundle.path = isdirectory(bundle.uri) ?
\ bundle.uri : bundle.base.'/'.bundle.directory
let rtp = bundle.rtp
" Check relative path.
let bundle.rtp = (rtp =~ '^\%([~/]\|\a\+:\)') ?
\ s:expand_path(rtp) : (bundle.path.'/'.rtp)
if bundle.rtp =~ '[/\\]$'
" Chomp.
let bundle.rtp = substitute(bundle.rtp, '[/\\]\+$', '', '')
endif
if bundle.normalized_name ==# 'neobundle'
" Do not add runtimepath.
let bundle.rtp = ''
endif
if bundle.script_type != ''
" Add script_type.
" Note: To check by neobundle#config#is_installed().
let bundle.path .= '/' . bundle.script_type
endif
if !has_key(bundle, 'resettable')
let bundle.resettable = !bundle.lazy
endif
if !has_key(bundle.autoload, 'function_prefix')
\ && isdirectory(bundle.rtp . '/autoload')
let bundle.autoload.function_prefix =
\ neobundle#parser#_function_prefix(bundle.name)
endif
if !has_key(bundle, 'augroup')
let bundle.augroup = bundle.name
endif
" Parse depends.
let _ = []
for depend in neobundle#util#convert2list(bundle.depends)
if type(depend) == type('')
let depend = string(depend)
endif
let depend_bundle = type(depend) == type({}) ?
\ depend : neobundle#parser#bundle(depend, 1)
let depend_bundle.lazy = bundle.lazy
let depend_bundle.resettable = bundle.resettable
let depend_bundle.overwrite = 0
call add(_, depend_bundle)
unlet depend
endfor
let bundle.depends = _
if neobundle#config#is_sourced(bundle.name)
let bundle.sourced = 1
endif
return bundle
endfunction"}}}
if neobundle#util#is_windows()
function! s:expand_path(path)
return neobundle#util#substitute_path_separator(
\ simplify(expand(escape(a:path, '*?{}'), 1)))
endfunction
else
function! s:expand_path(path)
return simplify(expand(escape(a:path, '*?{}'), 1))
endfunction
endif
function! s:get_default() "{{{
if !exists('s:default_bundle')
let s:default_bundle = {
\ 'uri' : '',
\ 'script_type' : '',
\ 'rev' : '',
\ 'rtp' : '',
\ 'depends' : [],
\ 'lazy' : 0,
\ 'gui' : 0,
\ 'terminal' : 0,
\ 'overwrite' : 1,
\ 'stay_same' : 0,
\ 'hooks' : {},
\ 'called_hooks' : {},
\ 'external_commands' : {},
\ 'autoload' : {},
\ 'description' : '',
\ 'dummy_commands' : [],
\ 'dummy_mappings' : [],
\ 'sourced' : 0,
\ 'disabled' : 0,
\ 'local' : 0,
\ 'orig_name' : '',
\ 'vim_version' : '',
\ 'orig_opts' : {},
\ 'recipe' : '',
\ }
endif
let s:default_bundle.base = neobundle#get_neobundle_dir()
return deepcopy(s:default_bundle)
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/installer.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 |
"=============================================================================
" FILE: installer.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
" Last Modified: 29 Nov 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
" Version: 0.1, for Vim 7.2
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
call neobundle#util#set_default(
\ 'g:neobundle#rm_command',
\ (neobundle#util#is_windows() ? 'rmdir /S /Q' : 'rm -rf'),
\ 'g:neobundle_rm_command')
call neobundle#util#set_default(
\ 'g:neobundle#install_max_processes', 4,
\ 'g:unite_source_neobundle_install_max_processes')
call neobundle#util#set_default(
\ 'g:neobundle#install_process_timeout', 60)
let s:log = []
let s:updates_log = []
function! neobundle#installer#install(bang, bundle_names)
if neobundle#util#is_sudo()
call neobundle#util#print_error(
\ '"sudo vim" is detected. This feature is disabled.')
return
endif
let bundle_dir = neobundle#get_neobundle_dir()
if !isdirectory(bundle_dir)
call mkdir(bundle_dir, 'p')
endif
let bundle_names = split(a:bundle_names)
let bundles = !a:bang ?
\ neobundle#get_not_installed_bundles(bundle_names) :
\ empty(bundle_names) ?
\ neobundle#config#get_neobundles() :
\ neobundle#config#fuzzy_search(bundle_names)
if empty(bundles)
call neobundle#installer#error(
\ '[neobundle/install] Target bundles not found.')
call neobundle#installer#error(
\ '[neobundle/install] You may use wrong bundle name'.
\ ' or all bundles are already installed.')
return
endif
call neobundle#installer#_load_install_info(bundles)
call neobundle#installer#clear_log()
let reinstall_bundles =
\ neobundle#installer#get_reinstall_bundles(bundles)
if !empty(reinstall_bundles)
call neobundle#installer#reinstall(reinstall_bundles)
endif
let more_save = &more
try
setlocal nomore
let [installed, errored] = s:install(a:bang, bundles)
if !has('vim_starting')
redraw!
endif
finally
let &more = more_save
endtry
call neobundle#installer#update(installed)
call neobundle#installer#log(
\ "[neobundle/install] Installed/Updated bundles:\n".
\ join((empty(installed) ?
\ ['no new bundles installed'] :
\ map(copy(installed), 'v:val.name')),"\n"))
if !empty(errored)
call neobundle#installer#log(
\ "[neobundle/install] Errored bundles:\n".join(
\ map(copy(errored), 'v:val.name')), "\n")
call neobundle#installer#log(
\ 'Please read error message log by :message command.')
endif
if !empty(installed)
call s:update_ftdetect()
endif
endfunction
function! neobundle#installer#update(bundles)
if neobundle#util#is_sudo()
call neobundle#util#print_error(
\ '"sudo vim" is detected. This feature is disabled.')
return
endif
call neobundle#installer#helptags(
\ neobundle#config#get_neobundles())
call s:reload(filter(copy(a:bundles),
\ 'v:val.sourced && !v:val.disabled'))
call s:save_install_info(neobundle#config#get_neobundles())
endfunction
function! neobundle#installer#helptags(bundles)
if neobundle#util#is_sudo()
call neobundle#util#print_error(
\ '"sudo vim" is detected. This feature is disabled.')
return
endif
let help_dirs = filter(copy(a:bundles), 's:has_doc(v:val.rtp)')
if !empty(help_dirs)
call s:update_tags()
if !has('vim_starting')
call neobundle#installer#log(
\ '[neobundle/install] Helptags: done. '
\ .len(help_dirs).' bundles processed')
endif
endif
return help_dirs
endfunction
function! neobundle#installer#build(bundle)
" Environment check.
let build = get(a:bundle, 'build', {})
if neobundle#util#is_windows() && has_key(build, 'windows')
let cmd = build.windows
elseif neobundle#util#is_mac() && has_key(build, 'mac')
let cmd = build.mac
elseif neobundle#util#is_cygwin() && has_key(build, 'cygwin')
let cmd = build.cygwin
elseif !neobundle#util#is_windows() && has_key(build, 'unix')
let cmd = build.unix
elseif has_key(build, 'others')
let cmd = build.others
else
return
endif
call neobundle#installer#log('[neobundle/install] Building...')
let cwd = getcwd()
try
if isdirectory(a:bundle.path)
call neobundle#util#cd(a:bundle.path)
endif
if a:bundle.name ==# 'vimproc' && neobundle#util#is_windows()
\ && neobundle#util#has_vimproc()
let result = s:build_vimproc_dll(cmd)
else
let result = neobundle#util#system(cmd)
endif
finally
if isdirectory(cwd)
call neobundle#util#cd(cwd)
endif
endtry
if neobundle#util#get_last_status()
call neobundle#installer#error(result)
else
call neobundle#installer#log('[neobundle/install] ' . result)
endif
return neobundle#util#get_last_status()
endfunction
function! s:build_vimproc_dll(cmd)
" Build vimproc in Windows.
" Save dll name.
let dll_path = exists('g:vimproc#dll_path') ?
\ g:vimproc#dll_path : g:vimproc_dll_path
" Rename dll.
let temp = tempname()
call rename(dll_path, temp)
" Note: Can't use vimproc function.
let result = system(a:cmd)
if filereadable(dll_path)
" Updated. Delete previous dll.
call delete(temp)
else
" Didn't updated. Restore it.
call rename(temp, dll_path)
endif
return result
endfunction
function! neobundle#installer#clean(bang, ...)
if neobundle#util#is_sudo()
call neobundle#util#print_error('"sudo vim" is detected. This feature is disabled.')
return
endif
if get(a:000, 0, '') == ''
let all_dirs = filter(split(neobundle#util#substitute_path_separator(
\ globpath(neobundle#get_neobundle_dir(), '*', 1)), "\n"),
\ 'isdirectory(v:val)')
let bundle_dirs = map(copy(neobundle#config#get_neobundles()),
\ "(v:val.script_type != '') ?
\ v:val.base . '/' . v:val.directory : v:val.path")
let x_dirs = filter(all_dirs,
\ "!neobundle#config#is_installed(fnamemodify(v:val, ':t'))
\ && index(bundle_dirs, v:val) < 0 && v:val !~ '/neobundle.vim$'")
else
let x_dirs = map(neobundle#config#search_simple(a:000), 'v:val.path')
if len(x_dirs) > len(a:000)
" Check bug.
call neobundle#util#print_error('Bug: x_dirs = %s but arguments is %s',
\ string(x_dirs), map(copy(a:000), 'v:val.path'))
return
endif
endif
if empty(x_dirs)
call neobundle#installer#log('[neobundle/install] All clean!')
return
end
if a:bang || s:check_really_clean(x_dirs)
if !has('vim_starting')
redraw
endif
let result = system(g:neobundle#rm_command . ' ' .
\ join(map(copy(x_dirs), '"\"" . v:val . "\""'), ' '))
if neobundle#util#get_last_status()
call neobundle#installer#error(result)
endif
for dir in x_dirs
call neobundle#config#rm(dir)
endfor
call s:update_tags()
endif
endfunction
function! neobundle#installer#reinstall_names(bundle_names)
let bundles = neobundle#config#search_simple(split(a:bundle_names))
if empty(bundles)
call neobundle#installer#error(
\ '[neobundle/install] Target bundles not found.')
call neobundle#installer#error(
\ '[neobundle/install] You may use wrong bundle name.')
return
endif
call neobundle#installer#reinstall(bundles)
endfunction
function! neobundle#installer#reinstall(bundles)
for bundle in a:bundles
" Reinstall.
call neobundle#installer#log(
\ printf('[neobundle/install] |%s| Reinstalling...', bundle.name))
" Save info.
let arg = copy(bundle.orig_arg)
" Remove.
call neobundle#installer#clean(1, bundle.name)
call call('neobundle#parser#bundle', [arg])
endfor
" Install.
call neobundle#installer#install(0, '')
call neobundle#installer#update(a:bundles)
endfunction
function! neobundle#installer#get_reinstall_bundles(bundles)
let reinstall_bundles = filter(copy(a:bundles),
\ "neobundle#config#is_installed(v:val.name)
\ && v:val.normalized_name !=# 'neobundle' &&
\ v:val.normalized_name !=# 'unite'
\ && v:val.type !=# 'nosync'
\ && !v:val.local &&
\ v:val.path ==# v:val.installed_path &&
\ v:val.uri !=# v:val.installed_uri")
if !empty(reinstall_bundles)
echomsg 'Reinstall bundles detected: '
\ string(map(copy(reinstall_bundles), 'v:val.name'))
let ret = confirm('Reinstall bundles now?', "yes\nNo", 2)
redraw
if ret != 1
return []
endif
endif
return reinstall_bundles
endfunction
function! neobundle#installer#get_sync_command(bang, bundle, number, max)
let type = neobundle#config#get_types(a:bundle.type)
if empty(type)
return ['', printf('(%'.len(a:max).'d/%d): |%s| %s',
\ a:number, a:max, a:bundle.name, 'Unknown Type')]
endif
let is_directory = isdirectory(a:bundle.path)
let cmd = type.get_sync_command(a:bundle)
if cmd == ''
return ['', 'Not supported sync action.']
elseif (is_directory && !a:bang)
return ['', 'Already installed.']
endif
let message = printf('(%'.len(a:max).'d/%d): |%s| %s',
\ a:number, a:max, a:bundle.name, cmd)
return [cmd, message]
endfunction
function! neobundle#installer#get_revision_lock_command(bang, bundle, number, max)
let repo_dir = neobundle#util#substitute_path_separator(
\ neobundle#util#expand(a:bundle.path.'/.'.a:bundle.type.'/'))
let type = neobundle#config#get_types(a:bundle.type)
if empty(type)
return ['', printf('(%'.len(a:max).'d/%d): |%s| %s',
\ a:number, a:max, a:bundle.name, 'Unknown Type')]
endif
let cmd = type.get_revision_lock_command(a:bundle)
if cmd == ''
return ['', '']
endif
let message = printf('(%'.len(a:max).'d/%d): |%s| %s',
\ a:number, a:max, a:bundle.name, cmd)
return [cmd, message]
endfunction
function! neobundle#installer#get_revision_number(bundle)
let cwd = getcwd()
try
let type = neobundle#config#get_types(a:bundle.type)
if !isdirectory(a:bundle.path)
return ''
endif
call neobundle#util#cd(a:bundle.path)
return neobundle#util#system(
\ type.get_revision_number_command(a:bundle))
finally
if isdirectory(cwd)
call neobundle#util#cd(cwd)
endif
endtry
return ''
endfunction
function! s:get_commit_date(bundle)
let cwd = getcwd()
try
let type = neobundle#config#get_types(a:bundle.type)
if !isdirectory(a:bundle.path) ||
\ !has_key(type, 'get_commit_date_command')
return 0
endif
call neobundle#util#cd(a:bundle.path)
return neobundle#util#system(
\ type.get_commit_date_command(a:bundle))
finally
if isdirectory(cwd)
call neobundle#util#cd(cwd)
endif
endtry
return ''
endfunction
function! neobundle#installer#get_updated_log_message(bundle, new_rev, old_rev)
let cwd = getcwd()
try
let type = neobundle#config#get_types(a:bundle.type)
if isdirectory(a:bundle.path)
call neobundle#util#cd(a:bundle.path)
endif
let log_command = has_key(type, 'get_log_command') ?
\ type.get_log_command(a:bundle, a:new_rev, a:old_rev) : ''
let log = (log_command != '' ?
\ neobundle#util#system(log_command) : '')
return log != '' ? log : printf('%s -> %s', a:old_rev, a:new_rev)
finally
if isdirectory(cwd)
call neobundle#util#cd(cwd)
endif
endtry
endfunction
function! neobundle#installer#sync(bundle, context, is_unite)
let a:context.source__number += 1
let num = a:context.source__number
let max = a:context.source__max_bundles
let before_one_day = localtime() - 60 * 60 * 24
let before_one_week = localtime() - 60 * 60 * 24 * 7
if a:context.source__bang == 1 &&
\ a:bundle.stay_same
let [cmd, message] = ['', 'has "stay_same" attribute.']
elseif a:context.source__bang == 1 &&
\ a:bundle.uri ==# a:bundle.installed_uri &&
\ a:bundle.updated_time < before_one_week
\ && a:bundle.checked_time >= before_one_day
let [cmd, message] = ['', 'Outdated plugin.']
else
let [cmd, message] =
\ neobundle#installer#get_sync_command(
\ a:context.source__bang, a:bundle,
\ a:context.source__number, a:context.source__max_bundles)
endif
if cmd == ''
" Skipped.
call neobundle#installer#log(s:get_skipped_message(
\ num, max, a:bundle, '[neobundle/install]', message), a:is_unite)
return
elseif cmd =~# '^E: '
" Errored.
call neobundle#installer#log(
\ printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
\ num, max, a:bundle.name, 'Error'), a:is_unite)
call neobundle#installer#error(cmd[3:], a:is_unite)
call add(a:context.source__errored_bundles,
\ a:bundle)
return
endif
call neobundle#installer#log(
\ '[neobundle/install] ' . message, a:is_unite)
let cwd = getcwd()
try
if isdirectory(a:bundle.path)
" Cd to bundle path.
call neobundle#util#cd(a:bundle.path)
endif
let rev = neobundle#installer#get_revision_number(a:bundle)
let process = {
\ 'number' : num,
\ 'rev' : rev,
\ 'bundle' : a:bundle,
\ 'output' : '',
\ 'status' : -1,
\ 'eof' : 0,
\ 'start_time' : localtime(),
\ }
if neobundle#util#has_vimproc()
let process.proc = vimproc#pgroup_open(vimproc#util#iconv(
\ cmd, &encoding, 'char'), 0, 2)
" Close handles.
call process.proc.stdin.close()
call process.proc.stderr.close()
else
let process.output = neobundle#util#system(cmd)
let process.status = neobundle#util#get_last_status()
endif
finally
if isdirectory(cwd)
call neobundle#util#cd(cwd)
endif
endtry
call add(a:context.source__processes, process)
endfunction
function! neobundle#installer#check_output(context, process, is_unite)
if neobundle#util#has_vimproc()
let is_timeout = (localtime() - a:process.start_time)
\ >= g:neobundle#install_process_timeout
let a:process.output .= vimproc#util#iconv(
\ a:process.proc.stdout.read(-1, 300), 'char', &encoding)
if !a:process.proc.stdout.eof && !is_timeout
return
endif
call a:process.proc.stdout.close()
let [_, status] = a:process.proc.waitpid()
else
let is_timeout = 0
let status = a:process.status
endif
let num = a:process.number
let max = a:context.source__max_bundles
let bundle = a:process.bundle
" Lock revision.
call neobundle#installer#lock_revision(
\ a:process, a:context, a:is_unite)
let cwd = getcwd()
let rev = neobundle#installer#get_revision_number(bundle)
let updated_time = s:get_commit_date(bundle)
let bundle.checked_time = localtime()
if is_timeout
\ || (status && a:process.rev ==# rev
\ && (bundle.type !=# 'git' ||
\ a:process.output !~# 'up-to-date\|up to date'))
let message = printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
\ num, max, bundle.name, 'Error')
call neobundle#installer#log(message, a:is_unite)
call neobundle#installer#error(bundle.path, a:is_unite)
call neobundle#installer#error(
\ (is_timeout ? 'Process timeout.' :
\ split(a:process.output, '\n')), a:is_unite)
call add(a:context.source__errored_bundles,
\ bundle)
elseif a:process.rev ==# rev
if updated_time != 0
let bundle.updated_time = updated_time
endif
call neobundle#installer#log(s:get_skipped_message(
\ num, max, bundle, '[neobundle/install]',
\ 'Same revision.'), a:is_unite)
else
call neobundle#installer#update_log(
\ printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
\ num, max, bundle.name, 'Updated'), a:is_unite)
let message = neobundle#installer#get_updated_log_message(
\ bundle, rev, a:process.rev)
call neobundle#installer#update_log(
\ map(split(message, '\n'),
\ "printf('[neobundle/install] |%s| ' .
\ substitute(v:val, '%', '%%', 'g'), bundle.name)"),
\ a:is_unite)
if updated_time == 0
let updated_time = bundle.checked_time
endif
let bundle.updated_time = updated_time
let bundle.installed_uri = bundle.uri
call neobundle#installer#build(bundle)
call add(a:context.source__synced_bundles,
\ bundle)
endif
let a:process.eof = 1
endfunction
function! neobundle#installer#lock_revision(process, context, is_unite)
let num = a:process.number
let max = a:context.source__max_bundles
let bundle = a:process.bundle
if bundle.rev == ''
" Skipped.
return 0
endif
let bundle.new_rev = neobundle#installer#get_revision_number(bundle)
let [cmd, message] =
\ neobundle#installer#get_revision_lock_command(
\ a:context.source__bang, bundle, num, max)
if cmd == ''
" Skipped.
return 0
elseif cmd =~# '^E: '
" Errored.
call neobundle#installer#error(bundle.path, a:is_unite)
call neobundle#installer#error(cmd[3:], a:is_unite)
return -1
endif
call neobundle#installer#log(
\ printf('[neobundle/install] (%'.len(max).'d/%d): |%s| %s',
\ num, max, bundle.name, 'Locked'), a:is_unite)
call neobundle#installer#log(
\ '[neobundle/install] ' . message, a:is_unite)
let cwd = getcwd()
try
if isdirectory(bundle.path)
" Cd to bundle path.
call neobundle#util#cd(bundle.path)
endif
let result = neobundle#util#system(cmd)
let status = neobundle#util#get_last_status()
finally
if isdirectory(cwd)
call neobundle#util#cd(cwd)
endif
endtry
if status
call neobundle#installer#error(bundle.path, a:is_unite)
call neobundle#installer#error(result, a:is_unite)
return -1
endif
endfunction
function! s:install(bang, bundles)
" Set context.
let context = {}
let context.source__bang = a:bang
let context.source__synced_bundles = []
let context.source__errored_bundles = []
let context.source__processes = []
let context.source__number = 0
let context.source__bundles = a:bundles
let context.source__max_bundles =
\ len(context.source__bundles)
while 1
while context.source__number < context.source__max_bundles
\ && len(context.source__processes) <
\ g:neobundle#install_max_processes
call neobundle#installer#sync(
\ context.source__bundles[context.source__number],
\ context, 0)
endwhile
for process in context.source__processes
call neobundle#installer#check_output(context, process, 0)
endfor
" Filter eof processes.
call filter(context.source__processes, '!v:val.eof')
if empty(context.source__processes)
\ && context.source__number == context.source__max_bundles
break
endif
endwhile
return [context.source__synced_bundles,
\ context.source__errored_bundles]
endfunction
function! s:has_doc(path)
return a:path != '' &&
\ isdirectory(a:path.'/doc')
\ && (!filereadable(a:path.'/doc/tags')
\ || filewritable(a:path.'/doc/tags'))
\ && (!filereadable(a:path.'/doc/tags-??')
\ || filewritable(a:path.'/doc/tags-??'))
\ && (glob(a:path.'/doc/*.txt') != ''
\ || glob(a:path.'/doc/*.??x') != '')
endfunction
function! s:update_tags()
let bundles = [{ 'rtp' : neobundle#get_runtime_dir()}]
\ + neobundle#config#get_neobundles()
call s:copy_bundle_files(bundles, 'doc')
call s:writefile('tags_info',
\ sort(map(neobundle#config#get_neobundles(), 'v:val.name')))
try
execute 'helptags' fnameescape(neobundle#get_tags_dir())
catch
call neobundle#installer#error('Error generating helptags:')
call neobundle#installer#error(v:exception)
endtry
endfunction
function! s:update_ftdetect()
" Delete old files.
call s:cleandir('ftdetect')
call s:cleandir('after/ftdetect')
endfunction
function! s:copy_bundle_files(bundles, directory)
" Delete old files.
call s:cleandir(a:directory)
let files = {}
for bundle in a:bundles
for file in filter(split(globpath(
\ bundle.rtp, a:directory.'/*', 1), '\n'),
\ '!isdirectory(v:val)')
let filename = fnamemodify(file, ':t')
let files[filename] = readfile(file)
endfor
endfor
for [filename, list] in items(files)
if filename =~# '^tags\%(-.*\)\?$'
call sort(list)
endif
call s:writefile(a:directory . '/' . filename, list)
endfor
endfunction
function! s:check_really_clean(dirs)
echo join(a:dirs, "\n")
return input('Are you sure you want to remove '
\ .len(a:dirs).' bundles? [y/n] : ') =~? 'y'
endfunction
function! s:save_install_info(bundles)
let s:install_info = {}
for bundle in filter(copy(a:bundles),
\ "!v:val.local && has_key(v:val, 'updated_time')")
" Note: Don't save local repository.
let s:install_info[bundle.name] = {
\ 'checked_time' : bundle.checked_time,
\ 'updated_time' : bundle.updated_time,
\ 'installed_uri' : bundle.installed_uri,
\ 'installed_path' : bundle.path,
\ }
endfor
call s:writefile('install_info',
\ ['2.0', string(s:install_info)])
endfunction
function! neobundle#installer#_load_install_info(bundles)
let install_info_path =
\ neobundle#get_neobundle_dir() . '/.neobundle/install_info'
if !exists('s:install_info')
let s:install_info = {}
if filereadable(install_info_path)
try
let list = readfile(install_info_path)
let ver = list[0]
sandbox let s:install_info = eval(list[1])
if ver !=# '2.0' || type(s:install_info) != type({})
let s:install_info = {}
endif
catch
endtry
endif
endif
call map(a:bundles, "extend(v:val, get(s:install_info, v:val.name, {
\ 'checked_time' : localtime(),
\ 'updated_time' : localtime(),
\ 'installed_uri' : v:val.uri,
\ 'installed_path' : v:val.path,
\}))")
return s:install_info
endfunction
function! s:get_skipped_message(number, max, bundle, prefix, message)
let messages = [a:prefix . printf(' (%'.len(a:max).'d/%d): |%s| %s',
\ a:number, a:max, a:bundle.name, 'Skipped')]
if a:message != ''
call add(messages, a:prefix . ' ' . a:message)
endif
return messages
endfunction
function! neobundle#installer#log(msg, ...)
let is_unite = get(a:000, 0, 0)
let msg = type(a:msg) == type([]) ?
\ a:msg : split(a:msg, '\n')
call extend(s:log, msg)
if !(&filetype == 'unite' || is_unite)
call neobundle#util#redraw_echo(msg)
endif
call s:append_log_file(msg)
endfunction
function! neobundle#installer#update_log(msg, ...)
let msgs = []
for msg in type(a:msg) == type([]) ?
\ a:msg : [a:msg]
let source_name = matchstr(msg, '^\[.\{-}\] ')
let msg_nrs = split(msg, '\n')
let msgs += [msg_nrs[0]] +
\ map(msg_nrs[1:], "source_name . v:val")
endfor
call call('neobundle#installer#log', [msgs] + a:000)
let s:updates_log += msgs
endfunction
function! neobundle#installer#error(msg, ...)
let is_unite = get(a:000, 0, 0)
let msg = type(a:msg) == type([]) ?
\ a:msg : split(a:msg, '\r\?\n')
call extend(s:log, msg)
call extend(s:updates_log, msg)
if &filetype == 'unite' || is_unite
call unite#print_error(msg)
else
call neobundle#util#print_error(msg)
endif
call s:append_log_file(msg)
endfunction
function! s:append_log_file(msg)
if g:neobundle#log_filename == ''
return
endif
let msg = a:msg
" Appends to log file.
if filereadable(g:neobundle#log_filename)
let msg = readfile(g:neobundle#log_filename) + msg
endif
call writefile(msg, g:neobundle#log_filename)
endfunction
function! neobundle#installer#get_log()
return s:log
endfunction
function! neobundle#installer#get_updates_log()
return s:updates_log
endfunction
function! neobundle#installer#clear_log()
let s:log = []
let s:updates_log = []
endfunction
function! neobundle#installer#get_tags_info()
let path = neobundle#get_neobundle_dir() . '/.neobundle/tags_info'
if !filereadable(path)
return []
endif
return readfile(path)
endfunction
function! s:writefile(path, list)
let path = neobundle#get_neobundle_dir() . '/.neobundle/' . a:path
let dir = fnamemodify(path, ':h')
if !isdirectory(dir)
call mkdir(dir, 'p')
endif
return writefile(a:list, path)
endfunction
function! s:cleandir(path)
let path = neobundle#get_neobundle_dir() . '/.neobundle/' . a:path
for file in filter(split(globpath(path, '*', 1), '\n'),
\ '!isdirectory(v:val)')
call delete(file)
endfor
endfunction
function! s:reload(bundles) "{{{
if empty(a:bundles)
return
endif
call filter(copy(a:bundles), 'neobundle#config#rtp_add(v:val)')
" Call hooks.
call neobundle#call_hook('on_source', a:bundles)
silent! runtime! ftdetect/**/*.vim
silent! runtime! after/ftdetect/**/*.vim
silent! runtime! plugin/**/*.vim
silent! runtime! after/plugin/**/*.vim
" Call hooks.
call neobundle#call_hook('on_post_source', a:bundles)
endfunction"}}}
function! s:redir(cmd) "{{{
redir => res
silent! execute a:cmd
redir END
return res
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/parser.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
"=============================================================================
" FILE: parser.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
" Last Modified: 22 Oct 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! neobundle#parser#bundle(arg, ...) "{{{
let bundle = s:parse_arg(a:arg)
let is_parse_only = get(a:000, 0, 0)
if empty(bundle) || is_parse_only
return bundle
endif
call neobundle#config#add(bundle)
return bundle
endfunction"}}}
function! neobundle#parser#lazy(arg) "{{{
let bundle = s:parse_arg(a:arg)
if empty(bundle)
return {}
endif
" Update lazy flag.
let bundle.lazy = 1
let bundle.resettable = 0
for depend in bundle.depends
let depend.lazy = bundle.lazy
let depend.resettable = 0
endfor
call neobundle#config#add(bundle)
return bundle
endfunction"}}}
function! neobundle#parser#fetch(arg) "{{{
let bundle = s:parse_arg(a:arg)
if empty(bundle)
return {}
endif
" Clear runtimepath.
let bundle.rtp = ''
call neobundle#config#add(bundle)
return bundle
endfunction"}}}
function! neobundle#parser#recipe(arg) "{{{
" Parse args.
let arg = type(a:arg) == type([]) ?
\ string(a:arg) : '[' . a:arg . ']'
sandbox let args = eval(arg)
if empty(args)
return {}
endif
let recipe = args[0]
let recipe_bundle = neobundle#parser#_parse_recipe(recipe)
if empty(recipe_bundle)
return {}
endif
let bundle = neobundle#parser#_init_bundle(
\ recipe_bundle.path,
\ [extend(recipe_bundle, get(args, 1, {}))])
if empty(bundle)
return {}
endif
let bundle.orig_arg = copy(a:arg)
call neobundle#config#add(bundle)
return bundle
endfunction"}}}
function! neobundle#parser#depends(arg) "{{{
let bundle = s:parse_arg(a:arg)
if empty(bundle)
return {}
endif
if !neobundle#config#is_installed(bundle.name)
let bundle.overwrite = 0
let bundle.resettable = 0
call neobundle#config#add(bundle)
" Install bundle automatically.
silent call neobundle#installer#install(0, bundle.name)
endif
" Load scripts.
call neobundle#config#source(bundle.name)
return bundle
endfunction"}}}
function! neobundle#parser#direct(arg) "{{{
let bundle = neobundle#parser#bundle(a:arg, 1)
if empty(bundle)
return {}
endif
if !empty(neobundle#get(bundle.name))
call neobundle#util#print_error(
\ bundle.name . ' is already installed.')
return {}
endif
call neobundle#config#add(bundle)
call neobundle#config#save_direct(a:arg)
" Direct install.
call neobundle#installer#install(0, bundle.name)
return bundle
endfunction"}}}
function! s:parse_arg(arg) "{{{
let arg = type(a:arg) == type([]) ?
\ string(a:arg) : '[' . a:arg . ']'
sandbox let args = eval(arg)
if empty(args)
return {}
endif
let bundle = neobundle#parser#_init_bundle(
\ args[0], args[1:])
if empty(bundle)
return {}
endif
let bundle.orig_arg = copy(a:arg)
return bundle
endfunction"}}}
function! neobundle#parser#_init_bundle(name, opts) "{{{
let path = neobundle#util#expand(
\ substitute(a:name, "['".'"]\+', '', 'g'))
let opts = s:parse_options(a:opts)
if !has_key(opts, 'recipe')
let opts.recipe = ''
endif
let bundle = extend(neobundle#parser#path(
\ path, opts), opts)
if bundle.recipe != ''
call extend(bundle,
\ neobundle#parser#_parse_recipe(bundle.recipe), 'keep')
endif
let bundle.orig_name = a:name
let bundle.orig_path = path
let bundle.orig_opts = opts
let bundle = neobundle#init#_bundle(bundle)
return bundle
endfunction"}}}
function! neobundle#parser#local(localdir, options) "{{{
for dir in map(filter(split(glob(fnamemodify(
\ neobundle#util#expand(a:localdir), ':p')
\ . '*'), '\n'), "isdirectory(v:val)"),
\ "neobundle#util#substitute_path_separator(
\ substitute(fnamemodify(v:val, ':p'), '/$', '', ''))")
call neobundle#parser#bundle([dir,
\ extend({
\ 'local' : 1,
\ 'base' : neobundle#util#substitute_path_separator(
\ fnamemodify(a:localdir, ':p')), }, a:options)])
endfor
endfunction"}}}
function! neobundle#parser#path(path, ...) "{{{
let opts = get(a:000, 0, {})
let site = get(opts, 'site', g:neobundle#default_site)
let path = substitute(a:path, '/$', '', '')
if path !~ '^/\|^\a:' && path !~ ':'
" Add default site.
let path = site . ':' . path
endif
if has_key(opts, 'type')
let type = neobundle#config#get_types(opts.type)
if empty(type)
return {}
endif
let types = [type]
else
let types = neobundle#config#get_types()
endif
for type in types
let detect = type.detect(path, opts)
if !empty(detect)
return detect
endif
endfor
if isdirectory(path)
" Detect nosync type.
return { 'name' : split(path, '/')[-1],
\ 'uri' : path, 'type' : 'nosync' }
endif
return {}
endfunction"}}}
function! neobundle#parser#_function_prefix(name) "{{{
let function_prefix = tolower(fnamemodify(a:name, ':r'))
let function_prefix = substitute(function_prefix,
\'^vim-', '','')
let function_prefix = substitute(function_prefix,
\'^unite-', 'unite#sources#','')
let function_prefix = substitute(function_prefix,
\'-', '_', 'g')
return function_prefix
endfunction"}}}
function! s:parse_options(opts) "{{{
if empty(a:opts)
return get(g:neobundle#default_options, '_', {})
endif
if len(a:opts) == 3
" rev, default, options
let [rev, default, options] = a:opts
elseif len(a:opts) == 2 && type(a:opts[-1]) == type('')
" rev, default
let [rev, default, options] = a:opts + [{}]
elseif len(a:opts) == 2 && type(a:opts[-1]) == type({})
" rev, options
let [rev, default, options] = [a:opts[0], '', a:opts[1]]
elseif len(a:opts) == 1 && type(a:opts[-1]) == type('')
" rev
let [rev, default, options] = [a:opts[0], '', {}]
elseif len(a:opts) == 1 && type(a:opts[-1]) == type({})
" options
let [rev, default, options] = ['', '', a:opts[0]]
else
call neobundle#installer#error(
\ printf('Invalid option : "%s".', string(a:opts)))
return {}
endif
if rev != ''
let options.rev = rev
endif
if !has_key(options, 'default')
let options.default = (default == '') ? '_' : default
endif
" Set default options.
if has_key(g:neobundle#default_options, options.default)
call extend(options,
\ g:neobundle#default_options[options.default], 'keep')
endif
return options
endfunction"}}}
function! neobundle#parser#_parse_recipe(recipe) "{{{
let recipe = a:recipe
if recipe !~ '\.vimrecipe$'
let recipe .= '.vimrecipe'
endif
if recipe !~ '^/\|^\w\+:'
" Search from runtimepath.
let path = get(split(globpath(&runtimepath,
\ 'recipes/' . recipe, 1), '\n'), 0, '')
if path == ''
" Use name conversion.
let recipe = neobundle#util#name_conversion(a:recipe)
if recipe !~ '\.vimrecipe$'
let recipe .= '.vimrecipe'
endif
let path = get(split(globpath(&runtimepath,
\ 'recipes/' . recipe, 1), '\n'), 0, '')
endif
else
let path = recipe
endif
if !filereadable(path)
call neobundle#util#print_error(printf(
\ '[neobundle] The recipe file "%s" is not found.', a:recipe))
return {}
endif
sandbox let data = eval(join(filter(readfile(path),
\ "v:val !~ '^\\s*\\%(#.*\\)\\?$'"), ''))
if !has_key(data, 'name') || !has_key(data, 'path')
call neobundle#util#print_error(
\ '[neobundle] ' . path)
call neobundle#util#print_error(
\ '[neobundle] The recipe file format is wrong.')
return {}
endif
let data.receipe_path = path
" Initialize.
let default = {
\ 'options' : {},
\ 'description' : '',
\ 'website' : '',
\ 'script_type' : '',
\ }
let data = extend(data, default, 'keep')
return data
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/sources/github.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
"=============================================================================
" FILE: github.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 02 Mar 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! neobundle#sources#github#define() "{{{
return s:source
endfunction"}}}
let s:source = {
\ 'name' : 'github',
\ 'short_name' : 'github',
\ }
function! s:source.gather_candidates(args, context) "{{{
if !executable('curl') && !executable('wget')
call unite#print_error(
\ '[neobundle/search:github] '.
\ 'curl or wget command is not available!')
return []
endif
let plugins = s:get_github_searches(a:context.source__input)
return map(copy(plugins), "{
\ 'word' : v:val.username.'/'.v:val.name . ' ' . v:val.description,
\ 'source__name' : (v:val.fork ? '| ' : '') .
\ v:val.username.'/'.v:val.name,
\ 'source__path' : v:val.username.'/'.v:val.name,
\ 'source__description' : v:val.description,
\ 'source__options' : [],
\ 'action__uri' : 'https://github.com/' .
\ v:val.username.'/'.v:val.name,
\ }")
endfunction"}}}
" Misc.
function! s:get_github_searches(string) "{{{
let path = 'https://api.github.com/legacy/repos/search/'
\ . a:string . '*?language=VimL'
let temp = neobundle#util#substitute_path_separator(tempname())
let cmd = printf('%s "%s" "%s"', (executable('curl') ?
\ 'curl --fail -s -o' : 'wget -q -O '), temp, path)
call unite#print_message(
\ '[neobundle/search:github] Searching plugins from github...')
redraw
let result = unite#util#system(cmd)
if unite#util#get_last_status()
call unite#print_message('[neobundle/search:github] ' . cmd)
call unite#print_error('[neobundle/search:github] Error occured!')
call unite#print_error(result)
return []
elseif !filereadable(temp)
call unite#print_error('[neobundle/search:github] '.
\ 'Temporary file was not created!')
return []
else
call unite#print_message('[neobundle/search:github] Done!')
endif
let [true, false, null] = [1,0,"''"]
sandbox let data = eval(join(readfile(temp)))
call filter(data.repositories,
\ "stridx(v:val.username.'/'.v:val.name, a:string) >= 0")
call delete(temp)
return data.repositories
endfunction"}}}
function! s:convert_vim_scripts_data(data) "{{{
return map(copy(a:data), "{
\ 'name' : v:val.n,
\ 'raw_type' : v:val.t,
\ 'repository' : v:val.rv,
\ 'description' : printf('%-5s %s', v:val.rv, v:val.s),
\ 'uri' : 'https://github.com/vim-scripts/' . v:val.n,
\ }")
endfunction"}}}
function! s:convert2script_type(type) "{{{
if a:type ==# 'utility'
return 'plugin'
elseif a:type ==# 'color scheme'
return 'colors'
else
return a:type
endif
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/sources/neobundle_vim_recipes.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
"=============================================================================
" FILE: neobundle_vim_recipes.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 22 Oct 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
let s:repository_cache = []
function! neobundle#sources#neobundle_vim_recipes#define() "{{{
return s:source
endfunction"}}}
let s:source = {
\ 'name' : 'neobundle-vim-recipes',
\ 'short_name' : 'neobundle',
\ }
function! s:source.gather_candidates(args, context) "{{{
let plugins = s:get_repository_plugins(a:context)
return map(copy(plugins), "{
\ 'word' : v:val.name . ' ' . v:val.description,
\ 'source__name' : v:val.name,
\ 'source__description' : v:val.description,
\ 'source__script_type' : v:val.script_type,
\ 'source__options' : v:val.options,
\ 'source__path' : v:val.path,
\ 'action__path' : v:val.receipe_path,
\ 'action__uri' : v:val.website,
\ }")
endfunction"}}}
" Misc.
function! s:get_repository_plugins(context) "{{{
if a:context.is_redraw || empty(s:repository_cache)
" Reload cache.
let s:repository_cache = []
for path in split(globpath(&runtimepath,
\ 'recipes/**/*.vimrecipe', 1), '\n')
sandbox let data = eval(join(filter(readfile(path),
\ "v:val !~ '^\\s*\\%(#.*\\)\\?$'"), ''))
if !has_key(data, 'name') || !has_key(data, 'path')
call unite#print_error(
\ '[neobundle/search:neobundle-vim-recipes] ' . path)
call unite#print_error(
\ '[neobundle/search:neobundle-vim-recipes] ' .
\ 'The recipe file format is wrong.')
continue
endif
let data.receipe_path = path
" Initialize.
let default = {
\ 'options' : {},
\ 'description' : '',
\ 'website' : '',
\ 'script_type' : '',
\ }
let data = extend(data, default, 'keep')
" Set options.
for key in ['depends', 'rev', 'type', 'script_type',
\ 'rtp', 'base', 'build', 'external_commands']
if has_key(data, key)
let data.options[key] = data[key]
endif
endfor
call add(s:repository_cache, data)
endfor
endif
return s:repository_cache
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/sources/vim_scripts_org.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
"=============================================================================
" FILE: vim_scripts_org.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 01 Jul 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
let s:Cache = vital#of('unite.vim').import('System.Cache')
let s:repository_cache = []
function! neobundle#sources#vim_scripts_org#define() "{{{
return s:source
endfunction"}}}
let s:source = {
\ 'name' : 'vim-scripts.org',
\ 'short_name' : 'vim.org',
\ }
function! s:source.gather_candidates(args, context) "{{{
if !executable('curl') && !executable('wget')
call unite#print_error(
\ '[neobundle/search:vim-scripts.org] '.
\ 'curl or wget command is not available!')
return []
endif
let repository = 'http://vim-scripts.org/api/scripts_recent.json'
call unite#print_message(
\ '[neobundle/search:vim-scripts.org] repository: ' . repository)
let plugins = s:get_repository_plugins(a:context, repository)
try
return map(copy(plugins), "{
\ 'word' : v:val.name . ' ' . v:val.description,
\ 'source__name' : v:val.name,
\ 'source__path' : v:val.name,
\ 'source__script_type' : s:convert2script_type(v:val.raw_type),
\ 'source__description' : v:val.description,
\ 'source__options' : [],
\ 'action__uri' : v:val.uri,
\ }")
catch
call unite#print_error(
\ '[neobundle/search:vim-scripts.org] '
\ .'Error occured in loading cache.')
call unite#print_error(
\ '[neobundle/search:vim-scripts.org] '
\ .'Please re-make cache by <Plug>(unite_redraw) mapping.')
call neobundle#installer#error(v:exception . ' ' . v:throwpoint)
return []
endtry
endfunction"}}}
" Misc.
function! s:get_repository_plugins(context, path) "{{{
let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle'
if a:context.is_redraw || !s:Cache.filereadable(cache_dir, a:path)
" Reload cache.
let cache_path = s:Cache.getfilename(cache_dir, a:path)
call unite#print_message(
\ '[neobundle/search:vim-scripts.org] Reloading cache from ' . a:path)
redraw
if s:Cache.filereadable(cache_dir, a:path)
call delete(cache_path)
endif
let temp = unite#util#substitute_path_separator(tempname())
if executable('curl')
let cmd = 'curl --fail -s -o "' . temp . '" '. a:path
elseif executable('wget')
let cmd = 'wget -q -O "' . temp . '" ' . a:path
endif
let result = unite#util#system(cmd)
if unite#util#get_last_status()
call unite#print_message('[neobundle/search:vim-scripts.org] ' . cmd)
call unite#print_error('[neobundle/search:vim-scripts.org] Error occured!')
call unite#print_error(result)
return []
elseif !filereadable(temp)
call unite#print_error('[neobundle/search:vim-scripts.org] '.
\ 'Temporary file was not created!')
return []
else
call unite#print_message('[neobundle/search:vim-scripts.org] Done!')
endif
sandbox let data = eval(get(readfile(temp), 0, '[]'))
" Convert cache data.
call s:Cache.writefile(cache_dir, a:path,
\ [string(s:convert_vim_scripts_data(data))])
call delete(temp)
endif
if empty(s:repository_cache)
sandbox let s:repository_cache =
\ eval(get(s:Cache.readfile(cache_dir, a:path), 0, '[]'))
endif
return s:repository_cache
endfunction"}}}
function! s:convert_vim_scripts_data(data) "{{{
return map(copy(a:data), "{
\ 'name' : v:val.n,
\ 'raw_type' : v:val.t,
\ 'repository' : v:val.rv,
\ 'description' : printf('%-5s %s', v:val.rv, v:val.s),
\ 'uri' : 'https://github.com/vim-scripts/' . v:val.n,
\ }")
endfunction"}}}
function! s:convert2script_type(type) "{{{
if a:type ==# 'utility'
return 'plugin'
elseif a:type ==# 'color scheme'
return 'colors'
else
return a:type
endif
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/types/git.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
"=============================================================================
" FILE: git.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 20 Nov 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
" Global options definition. "{{{
call neobundle#util#set_default(
\ 'g:neobundle#types#git#default_protocol', 'https',
\ 'g:neobundle_default_git_protocol')
call neobundle#util#set_default(
\ 'g:neobundle#types#git#enable_submodule', 1)
"}}}
function! neobundle#types#git#define() "{{{
return s:type
endfunction"}}}
let s:type = {
\ 'name' : 'git',
\ }
function! s:type.detect(path, opts) "{{{
if isdirectory(a:path.'/.git')
" Local repository.
return { 'name' : split(a:path, '/')[-1],
\ 'uri' : a:path, 'type' : 'git' }
elseif isdirectory(a:path)
return {}
endif
let type = ''
let protocol = matchstr(a:path, '^.\{-}\ze://')
if protocol == '' || a:path =~#
\'\<\%(gh\|github\|bb\|bitbucket\):\S\+'
\ || has_key(a:opts, 'type__protocol')
let protocol = get(a:opts, 'type__protocol',
\ g:neobundle#types#git#default_protocol)
endif
if a:path =~# '\<gist:\S\+\|://gist.github.com/'
let name = split(a:path, ':')[-1]
let uri = (protocol ==# 'ssh') ?
\ 'git@gist.github.com:' . split(name, '/')[-1] :
\ protocol . '://gist.github.com/'. split(name, '/')[-1]
elseif a:path =~# '\<\%(gh\|github\):\S\+\|://github.com/'
if a:path =~ '/'
let name = substitute(split(a:path, ':')[-1],
\ '^//github.com/', '', '')
let uri = (protocol ==# 'ssh') ?
\ 'git@github.com:' . name :
\ protocol . '://github.com/'. name
else
" www.vim.org Vim scripts.
let name = split(a:path, ':')[-1]
let uri = (protocol ==# 'ssh') ?
\ 'git@github.com:vim-scripts/' :
\ protocol . '://github.com/vim-scripts/'
let uri .= name
endif
elseif a:path =~# '\<\%(git@\|git://\)\S\+'
\ || a:path =~# '\.git\s*$'
\ || get(a:opts, 'type', '') ==# 'git'
if a:path =~# '\<\%(bb\|bitbucket\):\S\+'
let name = substitute(split(a:path, ':')[-1],
\ '^//bitbucket.org/', '', '')
let uri = (protocol ==# 'ssh') ?
\ 'git@bitbucket.org:' . name :
\ protocol . '://bitbucket.org/' . name
else
let uri = a:path
endif
else
return {}
endif
if uri !~ '\.git\s*$'
" Add .git suffix.
let uri .= '.git'
endif
return { 'name': neobundle#util#name_conversion(uri),
\ 'uri': uri, 'type' : 'git' }
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
if !executable('git')
return 'E: "git" command is not installed.'
endif
if !isdirectory(a:bundle.path)
let cmd = 'git clone'
if g:neobundle#types#git#enable_submodule
let cmd .= ' --recursive'
endif
let cmd .= printf(' %s "%s"', a:bundle.uri, a:bundle.path)
else
let cmd = 'git pull --rebase'
if g:neobundle#types#git#enable_submodule
let cmd .= ' && git submodule update --init --recursive'
endif
endif
return cmd
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
if !executable('git')
return ''
endif
let rev = a:bundle.rev
if rev == ''
let rev = 'HEAD'
endif
return 'git rev-parse ' . rev
endfunction"}}}
function! s:type.get_revision_pretty_command(bundle) "{{{
if !executable('git')
return ''
endif
return "git log -1 --pretty=format:'%h [%cr] %s'"
endfunction"}}}
function! s:type.get_commit_date_command(bundle) "{{{
if !executable('git')
return ''
endif
return "git log -1 --pretty=format:'%ct'"
endfunction"}}}
function! s:type.get_log_command(bundle, new_rev, old_rev) "{{{
if !executable('git') || a:new_rev == '' || a:old_rev == ''
return ''
endif
" Note: If the a:old_rev is not the ancestor of two branchs. Then do not use
" %s^. use %s^ will show one commit message which already shown last time.
let is_not_ancestor = neobundle#util#system('git merge-base '
\ . a:old_rev . ' ' . a:new_rev) ==# a:old_rev
return printf("git log %s%s..%s --graph --pretty=format:'%%h [%%cr] %%s'",
\ a:old_rev, (is_not_ancestor ? '' : '^'), a:new_rev)
" Test.
" return "git log HEAD^^^^..HEAD --graph --pretty=format:'%h [%cr] %s'"
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
if !executable('git') || a:bundle.rev == ''
return ''
endif
return 'git checkout ' . a:bundle.rev
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/types/hg.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
"=============================================================================
" FILE: hg.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 22 Jul 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
" Global options definition. "{{{
call neobundle#util#set_default(
\ 'g:neobundle#types#hg#default_protocol', 'https',
\ 'g:neobundle_default_hg_protocol')
"}}}
function! neobundle#types#hg#define() "{{{
return s:type
endfunction"}}}
let s:type = {
\ 'name' : 'hg',
\ }
function! s:type.detect(path, opts) "{{{
if isdirectory(a:path.'/.hg')
" Local repository.
return { 'name' : split(a:path, '/')[-1],
\ 'uri' : a:path, 'type' : 'hg' }
elseif isdirectory(a:path)
return {}
endif
let type = ''
let protocol = matchstr(a:path, '^.\{-}\ze://')
if protocol == '' || a:path =~#
\'\<\%(bb\|bitbucket\):\S\+'
\ || has_key(a:opts, 'type__protocol')
let protocol = get(a:opts, 'type__protocol',
\ g:neobundle#types#hg#default_protocol)
endif
if a:path =~# '\<\%(bb\|bitbucket\):'
let name = substitute(split(a:path, ':')[-1],
\ '^//bitbucket.org/', '', '')
let uri = (protocol ==# 'ssh') ?
\ 'ssh://hg@bitbucket.org/' . name :
\ protocol . '://bitbucket.org/' . name
elseif a:path =~? '[/.]hg[/.@]'
\ || (a:path =~# '\<https\?://bitbucket\.org/'
\ || a:path =~# '\<https://code\.google\.com/'
\ || get(a:opts, 'type', '') ==# 'hg')
let uri = a:path
else
return {}
endif
return { 'name': neobundle#util#name_conversion(uri),
\ 'uri' : uri, 'type' : 'hg' }
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
if !executable('hg')
return 'E: "hg" command is not installed.'
endif
if !isdirectory(a:bundle.path)
let cmd = 'hg clone'
let cmd .= printf(' %s "%s"', a:bundle.uri, a:bundle.path)
else
let cmd = 'hg pull -u'
endif
return cmd
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
if !executable('hg')
return ''
endif
return 'hg heads --quiet --rev default'
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
if !executable('hg') || a:bundle.rev == ''
return ''
endif
return 'hg up ' . a:bundle.rev
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/types/nosync.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
"=============================================================================
" FILE: nosync.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 07 Jun 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! neobundle#types#nosync#define() "{{{
return s:type
endfunction"}}}
let s:type = {
\ 'name' : 'nosync',
\ }
function! s:type.detect(path, opts) "{{{
" No Auto detect.
return {}
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
if isdirectory(a:bundle.path)
return ''
endif
" Try auto install.
let path = a:bundle.orig_path
let site = get(a:bundle, 'site', g:neobundle#default_site)
if path !~ '^/\|^\a:' && path !~ ':'
" Add default site.
let path = site . ':' . path
endif
for type in neobundle#config#get_types()
let detect = type.detect(path, a:bundle.orig_opts)
if !empty(detect)
return type.get_sync_command(
\ extend(copy(a:bundle), detect))
endif
endfor
return 'E: Failed to auto installation.'
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
return ''
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
return ''
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/types/raw.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
"=============================================================================
" FILE: raw.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 02 Apr 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
" Global options definition. "{{{
call neobundle#util#set_default(
\ 'g:neobundle#types#raw#calc_hash_command',
\ executable('sha1sum') ? 'sha1sum' :
\ executable('md5sum') ? 'md5sum' : '')
"}}}
function! neobundle#types#raw#define() "{{{
return s:type
endfunction"}}}
let s:type = {
\ 'name' : 'raw',
\ }
function! s:type.detect(path, opts) "{{{
" No auto detect.
let type = ''
if a:path =~# '^https\?:.*\.vim$'
" HTTP/HTTPS
let name = split(a:path, '/')[-1]
let type = 'raw'
elseif a:path =~# '^https\?://www\.vim\.org/scripts/download_script.php?src_id=\d\+$'
" For www.vim.org
let name = 'vim-scripts-' . matchstr(a:path, '\d\+$')
let type = 'raw'
endif
return type == '' ? {} :
\ { 'name': name, 'uri' : a:path, 'type' : type }
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
if a:bundle.script_type == ''
return 'E: script_type is not found.'
endif
if !executable('curl') && !executable('wget')
return 'E: curl or wget command is not available!'
endif
let path = a:bundle.path
if !isdirectory(path)
" Create script type directory.
call mkdir(path, 'p')
endif
let filename = path . '/' . get(a:bundle,
\ 'type__filename', fnamemodify(a:bundle.uri, ':t'))
let a:bundle.type__filepath = filename
if executable('curl')
let cmd = printf('curl --fail -s -o "%s" "%s"', filename, a:bundle.uri)
elseif executable('wget')
let cmd = printf('wget -q -O "%s" "%s", ', filename, a:bundle.uri)
endif
return cmd
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
if g:neobundle#types#raw#calc_hash_command == ''
return ''
endif
if !filereadable(a:bundle.type__filepath)
" Not Installed.
return ''
endif
" Calc hash.
return g:neobundle#types#raw#calc_hash_command . ' ' . a:bundle.type__filepath
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
let new_rev = matchstr(a:bundle.new_rev, '^\S\+')
if a:bundle.rev != '' && new_rev != '' &&
\ new_rev !=# a:bundle.rev
" Revision check.
return printf('E: revision digest is not matched : "%s"(got) and "%s"(rev).',
\ new_rev, a:bundle.rev)
endif
" Not supported.
return ''
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/types/svn.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
"=============================================================================
" FILE: svn.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 22 Jul 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! neobundle#types#svn#define() "{{{
return s:type
endfunction"}}}
let s:type = {
\ 'name' : 'svn',
\ }
function! s:type.detect(path, opts) "{{{
if isdirectory(a:path)
return {}
endif
let type = ''
if a:path =~# '\<\%(file\|https\?\|svn\)://'
\ && a:path =~? '[/.]svn[/.]'
let uri = a:path
let name = split(uri, '/')[-1]
let type = 'svn'
elseif a:path =~# '\<\%(gh\|github\):\S\+\|://github.com/'
let name = substitute(split(a:path, ':')[-1],
\ '^//github.com/', '', '')
let uri = 'https://github.com/'. name
let uri .= '/trunk'
let name = split(name, '/')[-1]
let type = 'svn'
endif
return type == '' ? {} :
\ { 'name': name, 'uri': uri, 'type' : type }
endfunction"}}}
function! s:type.get_sync_command(bundle) "{{{
if !executable('svn')
return 'E: svn command is not installed.'
endif
if !isdirectory(a:bundle.path)
let cmd = 'svn checkout'
let cmd .= printf(' %s "%s"', a:bundle.uri, a:bundle.path)
else
let cmd = 'svn up'
endif
return cmd
endfunction"}}}
function! s:type.get_revision_number_command(bundle) "{{{
if !executable('svn')
return ''
endif
return 'svn info'
endfunction"}}}
function! s:type.get_revision_lock_command(bundle) "{{{
if !executable('svn') || a:bundle.rev == ''
return ''
endif
return 'svn up -r ' . a:bundle.rev
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/neobundle/util.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 |
"=============================================================================
" FILE: util.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
" Last Modified: 28 Oct 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
let s:is_windows = has('win16') || has('win32') || has('win64')
let s:is_cygwin = has('win32unix')
let s:is_mac = !s:is_windows
\ && (has('mac') || has('macunix') || has('gui_macvim') ||
\ (!isdirectory('/proc') && executable('sw_vers')))
function! neobundle#util#substitute_path_separator(path) "{{{
return (s:is_windows && a:path =~ '\\') ?
\ substitute(a:path, '\\', '/', 'g') : a:path
endfunction"}}}
function! neobundle#util#expand(path) "{{{
let path = expand(escape(a:path, '*?{}'), 1)
return (s:is_windows && path =~ '\\') ?
\ neobundle#util#substitute_path_separator(path) : path
endfunction"}}}
function! neobundle#util#expand2(path) "{{{
return expand(escape(a:path, '*?{}'), 1)
endfunction"}}}
function! neobundle#util#is_windows() "{{{
return s:is_windows
endfunction"}}}
function! neobundle#util#is_mac() "{{{
return s:is_mac
endfunction"}}}
function! neobundle#util#is_cygwin() "{{{
return s:is_cygwin
endfunction"}}}
" Sudo check.
function! neobundle#util#is_sudo() "{{{
return $SUDO_USER != '' && $USER !=# $SUDO_USER
\ && $HOME !=# expand('~'.$USER)
\ && $HOME ==# expand('~'.$SUDO_USER)
endfunction"}}}
" Check vimproc. "{{{
function! neobundle#util#has_vimproc() "{{{
if !exists('s:exists_vimproc')
try
call vimproc#version()
catch
endtry
let s:exists_vimproc =
\ (exists('g:vimproc_dll_path') && filereadable(g:vimproc_dll_path))
\ || (exists('g:vimproc#dll_path') && filereadable(g:vimproc#dll_path))
endif
return s:exists_vimproc
endfunction"}}}
"}}}
" iconv() wrapper for safety.
function! s:iconv(expr, from, to) "{{{
if a:from == '' || a:to == '' || a:from ==? a:to
return a:expr
endif
let result = iconv(a:expr, a:from, a:to)
return result != '' ? result : a:expr
endfunction"}}}
function! neobundle#util#system(str, ...) "{{{
let command = a:str
let input = a:0 >= 1 ? a:1 : ''
let command = s:iconv(command, &encoding, 'char')
let input = s:iconv(input, &encoding, 'char')
if a:0 == 0
let output = neobundle#util#has_vimproc() ?
\ vimproc#system(command) : system(command, "\<C-d>")
elseif a:0 == 1
let output = neobundle#util#has_vimproc() ?
\ vimproc#system(command, input) : system(command, input)
else
" ignores 3rd argument unless you have vimproc.
let output = neobundle#util#has_vimproc() ?
\ vimproc#system(command, input, a:2) : system(command, input)
endif
let output = s:iconv(output, 'char', &encoding)
return substitute(output, '\n$', '', '')
endfunction"}}}
function! neobundle#util#get_last_status() "{{{
return neobundle#util#has_vimproc() ?
\ vimproc#get_last_status() : v:shell_error
endfunction"}}}
" Split a comma separated string to a list.
function! neobundle#util#split_rtp(...) "{{{
let rtp = a:0 ? a:1 : &runtimepath
if type(rtp) == type([])
return rtp
endif
if rtp !~ '\\'
return split(rtp, ',')
endif
let split = split(rtp, '\\\@<!\%(\\\\\)*\zs,')
return map(split,'substitute(v:val, ''\\\([\\,]\)'', "\\1", "g")')
endfunction"}}}
function! neobundle#util#join_rtp(list, runtimepath, rtp) "{{{
return (a:runtimepath !~ '\\' && a:rtp !~ ',') ?
\ join(a:list, ',') : join(map(copy(a:list), 's:escape(v:val)'), ',')
endfunction"}}}
" Removes duplicates from a list.
function! neobundle#util#uniq(list, ...) "{{{
let list = a:0 ? map(copy(a:list), printf('[v:val, %s]', a:1)) : copy(a:list)
let i = 0
let seen = {}
while i < len(list)
let key = string(a:0 ? list[i][1] : list[i])
if has_key(seen, key)
call remove(list, i)
else
let seen[key] = 1
let i += 1
endif
endwhile
return a:0 ? map(list, 'v:val[0]') : list
endfunction"}}}
function! neobundle#util#set_default(var, val, ...) "{{{
if !exists(a:var) || type({a:var}) != type(a:val)
let alternate_var = get(a:000, 0, '')
let {a:var} = exists(alternate_var) ?
\ {alternate_var} : a:val
endif
endfunction"}}}
function! neobundle#util#set_dictionary_helper(variable, keys, pattern) "{{{
for key in split(a:keys, '\s*,\s*')
if !has_key(a:variable, key)
let a:variable[key] = a:pattern
endif
endfor
endfunction"}}}
function! neobundle#util#get_filetypes() "{{{
let filetype = exists('b:neocomplcache.context_filetype') ?
\ b:neocomplcache.context_filetype : &filetype
return split(filetype, '\.')
endfunction"}}}
function! neobundle#util#convert2list(expr) "{{{
return type(a:expr) ==# type([]) ? a:expr : [a:expr]
endfunction"}}}
function! neobundle#util#print_error(expr) "{{{
let msg = neobundle#util#convert2list(a:expr)
echohl WarningMsg | echomsg join(msg, "\n") | echohl None
endfunction"}}}
function! neobundle#util#redraw_echo(expr) "{{{
if has('vim_starting')
echo join(neobundle#util#convert2list(a:expr), "\n")
return
endif
let msg = neobundle#util#convert2list(a:expr)
let height = max([1, &cmdheight])
for i in range(0, len(msg)-1, height)
redraw!
echo join(msg[i : i+height-1], "\n")
endfor
endfunction"}}}
function! neobundle#util#name_conversion(path) "{{{
return fnamemodify(a:path, ':s?/$??:t:s?\c\.git\s*$??')
endfunction"}}}
" Escape a path for runtimepath.
function! s:escape(path)"{{{
return substitute(a:path, ',\|\\,\@=', '\\\0', 'g')
endfunction"}}}
function! neobundle#util#unify_path(path) "{{{
return fnamemodify(resolve(a:path), ':p:gs?\\\+?/?')
endfunction"}}}
function! neobundle#util#cd(path) "{{{
execute 'lcd' fnameescape(a:path)
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/unite/kinds/neobundle.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
"=============================================================================
" FILE: neobundle.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 20 May 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! unite#kinds#neobundle#define() "{{{
return s:kind
endfunction"}}}
let s:kind = {
\ 'name' : 'neobundle',
\ 'action_table': {},
\ 'parents' : ['uri', 'directory'],
\ 'default_action' : 'update',
\}
" Actions "{{{
let s:kind.action_table.update = {
\ 'description' : 'update bundles',
\ 'is_selectable' : 1,
\ 'is_start' : 1,
\ }
function! s:kind.action_table.update.func(candidates) "{{{
call unite#start_temporary([['neobundle/update', '!']
\ + map(copy(a:candidates), 'v:val.action__bundle_name')],
\ { 'log' : 1, 'script' : 1 })
endfunction"}}}
let s:kind.action_table.delete = {
\ 'description' : 'delete bundles',
\ 'is_invalidate_cache' : 1,
\ 'is_quit' : 0,
\ 'is_selectable' : 1,
\ }
function! s:kind.action_table.delete.func(candidates) "{{{
call call('neobundle#installer#clean', insert(map(copy(a:candidates),
\ 'v:val.action__bundle_name'), 0))
endfunction"}}}
let s:kind.action_table.reinstall = {
\ 'description' : 'reinstall bundles',
\ 'is_selectable' : 1,
\ }
function! s:kind.action_table.reinstall.func(candidates) "{{{
call neobundle#installer#reinstall(
\ map(copy(a:candidates), 'v:val.action__bundle'))
endfunction"}}}
let s:kind.action_table.preview = {
\ 'description' : 'view the plugin documentation',
\ 'is_quit' : 0,
\ }
function! s:kind.action_table.preview.func(candidate) "{{{
" Search help files.
let readme = get(split(globpath(
\ a:candidate.action__path, 'doc/*.?*', 1), '\n'), 0, '')
if readme == ''
" Search README files.
let readme = get(split(globpath(
\ a:candidate.action__path, 'README*', 1), '\n'), 0, '')
if readme == ''
return
endif
endif
let buflisted = buflisted(
\ unite#util#escape_file_searching(readme))
pedit `=readme`
" Open folds.
normal! zv
normal! zt
if !buflisted
call unite#add_previewed_buffer_list(
\ bufnr(unite#util#escape_file_searching(readme)))
endif
endfunction"}}}
"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/unite/sources/neobundle.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
"=============================================================================
" FILE: neobundle.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 04 Aug 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! unite#sources#neobundle#define() "{{{
return s:source
endfunction"}}}
let s:source = {
\ 'name' : 'neobundle',
\ 'description' : 'candidates from bundles',
\ 'hooks' : {},
\ }
function! s:source.hooks.on_init(args, context) "{{{
let bundle_names = filter(copy(a:args), 'v:val != "!"')
let a:context.source__bang =
\ index(a:args, '!') >= 0
let a:context.source__bundles = empty(bundle_names) ?
\ neobundle#config#get_neobundles() :
\ neobundle#config#search(bundle_names)
endfunction"}}}
" Filters "{{{
function! s:source.source__converter(candidates, context) "{{{
for candidate in a:candidates
if candidate.source__uri =~
\ '^\%(https\?\|git\)://github.com/'
let candidate.action__uri = candidate.source__uri
let candidate.action__uri =
\ substitute(candidate.action__uri, '^git://', 'https://', '')
let candidate.action__uri =
\ substitute(candidate.action__uri, '.git$', '', '')
endif
endfor
return a:candidates
endfunction"}}}
let s:source.filters =
\ ['matcher_default', 'sorter_default',
\ s:source.source__converter]
"}}}
function! s:source.gather_candidates(args, context) "{{{
let _ = map(copy(a:context.source__bundles), "{
\ 'word' : substitute(v:val.orig_name,
\ '^\%(https\?\|git\)://\%(github.com/\)\?', '', ''),
\ 'kind' : 'neobundle',
\ 'action__path' : v:val.path,
\ 'action__directory' : v:val.path,
\ 'action__bundle' : v:val,
\ 'action__bundle_name' : v:val.name,
\ 'source__uri' : v:val.uri,
\ 'source__description' : v:val.description,
\ 'is_multiline' : 1,
\ }
\")
let max = max(map(copy(_), 'len(v:val.word)'))
for candidate in _
let candidate.abbr = unite#util#truncate(candidate.word, max)
if candidate.source__description != ''
let candidate.abbr .= ' : ' . candidate.source__description
endif
let status = s:get_commit_status(
\ a:context.source__bang, candidate.action__bundle)
if status != ''
let candidate.abbr .= "\n " . status
endif
let candidate.word .= candidate.source__description
endfor
return _
endfunction"}}}
function! s:get_commit_status(bang, bundle) "{{{
if !isdirectory(a:bundle.path)
return 'Not installed'
endif
if a:bang && !neobundle#util#is_windows()
\ || !a:bang && neobundle#util#is_windows()
return neobundle#util#substitute_path_separator(
\ fnamemodify(a:bundle.path, ':~'))
endif
let type = neobundle#config#get_types(a:bundle.type)
let cmd = has_key(type, 'get_revision_pretty_command') ?
\ type.get_revision_pretty_command(a:bundle) :
\ type.get_revision_number_command(a:bundle)
if cmd == ''
return ''
endif
let cwd = getcwd()
call neobundle#util#cd(a:bundle.path)
let output = neobundle#util#system(cmd)
call neobundle#util#cd(cwd)
if neobundle#util#get_last_status()
return printf('Error(%d) occured when executing "%s"',
\ neobundle#util#get_last_status(), cmd)
endif
return output
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/unite/sources/neobundle_install.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
"=============================================================================
" FILE: neobundle/install.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 26 Jun 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! unite#sources#neobundle_install#define() "{{{
return [s:source_install, s:source_update]
endfunction"}}}
let s:source_install = {
\ 'name' : 'neobundle/install',
\ 'description' : 'install bundles',
\ 'hooks' : {},
\ 'default_kind' : 'word',
\ 'syntax' : 'uniteSource__NeoBundleInstall',
\ }
function! s:source_install.hooks.on_init(args, context) "{{{
let bundle_names = filter(copy(a:args), "v:val != '!'")
let a:context.source__bang =
\ index(a:args, '!') >= 0 || !empty(bundle_names)
let a:context.source__not_fuzzy = 0
call s:init(a:context, bundle_names)
if empty(a:context.source__bundles)
let a:context.is_async = 0
call neobundle#installer#log(
\ '[neobundle/install] Bundles not found.', 1)
call neobundle#installer#log(
\ '[neobundle/install] You may use wrong bundle name.', 1)
endif
endfunction"}}}
function! s:source_install.hooks.on_syntax(args, context) "{{{
syntax match uniteSource__NeoBundleInstall_Progress /(.\{-}):\s*.*/
\ contained containedin=uniteSource__NeoBundleInstall
highlight default link uniteSource__NeoBundleInstall_Progress String
syntax match uniteSource__NeoBundleInstall_Source /|.\{-}|/
\ contained containedin=uniteSource__NeoBundleInstall_Progress
highlight default link uniteSource__NeoBundleInstall_Source Type
endfunction"}}}
function! s:source_install.hooks.on_close(args, context) "{{{
if !empty(a:context.source__processes)
for process in a:context.source__processes
call process.proc.waitpid()
endfor
endif
endfunction"}}}
function! s:source_install.async_gather_candidates(args, context) "{{{
let old_msgs = copy(neobundle#installer#get_log())
if a:context.source__number < a:context.source__max_bundles
while a:context.source__number < a:context.source__max_bundles
\ && len(a:context.source__processes) <
\ g:neobundle#install_max_processes
call neobundle#installer#sync(
\ a:context.source__bundles[a:context.source__number],
\ a:context, 1)
endwhile
endif
if !empty(a:context.source__processes)
for process in a:context.source__processes
call neobundle#installer#check_output(a:context, process, 1)
endfor
" Filter eof processes.
call filter(a:context.source__processes, '!v:val.eof')
else
let messages = []
if empty(a:context.source__synced_bundles)
let messages += ['[neobundle/install] No new bundles installed.']
else
let messages += ['[neobundle/install] Installed/Updated bundles:']
\ + map(copy(a:context.source__synced_bundles),
\ 'v:val.name')
endif
if !empty(a:context.source__errored_bundles)
let messages += ['[neobundle/install] Errored bundles:']
\ + map(copy(a:context.source__errored_bundles),
\ 'v:val.name')
call neobundle#installer#log(
\ 'Please read error message log by :message command.')
endif
call neobundle#installer#log(messages, 1)
call neobundle#installer#update(
\ a:context.source__synced_bundles)
" Finish.
call neobundle#installer#log('[neobundle/install] Completed.', 1)
let a:context.is_async = 0
endif
return map(neobundle#installer#get_log()[len(old_msgs) :], "{
\ 'word' : substitute(v:val, '^\\[.\\{-}\\]\\s*', '', ''),
\ 'is_multiline' : 1,
\}")
endfunction"}}}
function! s:source_install.complete(args, context, arglead, cmdline, cursorpos) "{{{
return ['!'] +
\ neobundle#complete_bundles(a:arglead, a:cmdline, a:cursorpos)
endfunction"}}}
let s:source_update = deepcopy(s:source_install)
let s:source_update.name = 'neobundle/update'
let s:source_update.description = 'update bundles'
function! s:source_update.hooks.on_init(args, context) "{{{
let a:context.source__bang =
\ index(a:args, 'all') >= 0 ? 2 : 1
let a:context.source__not_fuzzy = index(a:args, '!') >= 0
let bundle_names = filter(copy(a:args),
\ "v:val !=# 'all' && v:val !=# '!'")
call s:init(a:context, bundle_names)
endfunction"}}}
function! s:init(context, bundle_names)
let a:context.source__synced_bundles = []
let a:context.source__errored_bundles = []
let a:context.source__processes = []
let a:context.source__number = 0
let a:context.source__bundles = !a:context.source__bang ?
\ neobundle#get_not_installed_bundles(a:bundle_names) :
\ empty(a:bundle_names) ?
\ neobundle#config#get_neobundles() :
\ a:context.source__not_fuzzy ?
\ neobundle#config#search(a:bundle_names) :
\ neobundle#config#fuzzy_search(a:bundle_names)
call neobundle#installer#_load_install_info(
\ a:context.source__bundles)
let reinstall_bundles =
\ neobundle#installer#get_reinstall_bundles(a:context.source__bundles)
if !empty(reinstall_bundles)
call neobundle#installer#reinstall(reinstall_bundles)
endif
let a:context.source__max_bundles =
\ len(a:context.source__bundles)
call neobundle#installer#clear_log()
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/unite/sources/neobundle_lazy.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
"=============================================================================
" FILE: neobundle_lazy.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 30 Aug 2012.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! unite#sources#neobundle_lazy#define() "{{{
return s:source
endfunction"}}}
let s:source = {
\ 'name' : 'neobundle/lazy',
\ 'description' : 'candidates from lazy bundles',
\ 'action_table' : {},
\ 'default_action' : 'source',
\ }
function! s:source.gather_candidates(args, context) "{{{
let _ = []
for bundle in filter(copy(neobundle#config#get_neobundles()),
\ '!neobundle#config#is_sourced(v:val.name)')
let name = substitute(bundle.orig_name,
\ '^\%(https\?\|git\)://\%(github.com/\)\?', '', '')
let dict = {
\ 'word' : name,
\ 'kind' : 'neobundle',
\ 'action__path' : bundle.path,
\ 'action__directory' : bundle.path,
\ 'action__bundle' : bundle,
\ 'action__bundle_name' : bundle.name,
\ 'source__uri' : bundle.uri,
\ }
call add(_, dict)
endfor
return _
endfunction"}}}
" Actions "{{{
let s:source.action_table.source = {
\ 'description' : 'source bundles',
\ 'is_selectable' : 1,
\ 'is_invalidate_cache' : 1,
\ }
function! s:source.action_table.source.func(candidates) "{{{
call call('neobundle#config#source',
\ map(copy(a:candidates), 'v:val.action__bundle_name'))
endfunction"}}}
"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/unite/sources/neobundle_log.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
"=============================================================================
" FILE: neobundle/log.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 12 May 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
function! unite#sources#neobundle_log#define() "{{{
return s:source
endfunction"}}}
let s:source = {
\ 'name' : 'neobundle/log',
\ 'description' : 'print previous neobundle install logs',
\ 'syntax' : 'uniteSource__NeoBundleLog',
\ 'hooks' : {},
\ }
function! s:source.hooks.on_syntax(args, context) "{{{
syntax match uniteSource__NeoBundleLog_Message /.*/
\ contained containedin=uniteSource__NeoBundleLog
highlight default link uniteSource__NeoBundleLog_Message Comment
syntax match uniteSource__NeoBundleLog_Progress /(.\{-}):\s*.*/
\ contained containedin=uniteSource__NeoBundleLog
highlight default link uniteSource__NeoBundleLog_Progress String
syntax match uniteSource__NeoBundleLog_Source /|.\{-}|/
\ contained containedin=uniteSource__NeoBundleLog_Progress
highlight default link uniteSource__NeoBundleLog_Source Type
endfunction"}}}
function! s:source.gather_candidates(args, context) "{{{
return map(copy(neobundle#installer#get_log()), "{
\ 'word' : substitute(v:val, '^\\[.\\{-}\\]\\s*', '', ''),
\ }")
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/autoload/unite/sources/neobundle_search.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
"=============================================================================
" FILE: neobundle_search.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 26 Sep 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
let s:Cache = vital#of('unite.vim').import('System.Cache')
function! unite#sources#neobundle_search#define() "{{{
" Init sources.
if !exists('s:neobundle_sources')
let s:neobundle_sources = {}
for define in map(split(globpath(&runtimepath,
\ 'autoload/neobundle/sources/*.vim', 1), '\n'),
\ "neobundle#sources#{fnamemodify(v:val, ':t:r')}#define()")
for dict in (type(define) == type([]) ? define : [define])
if !empty(dict) && !has_key(s:neobundle_sources, dict.name)
let s:neobundle_sources[dict.name] = dict
endif
endfor
unlet define
endfor
endif
return s:source
endfunction"}}}
let s:plugin_names = []
" Source rec.
let s:source = {
\ 'name' : 'neobundle/search',
\ 'description' : 'search plugins for neobundle',
\ 'hooks' : {},
\ 'action_table' : {},
\ 'default_action' : 'yank',
\ 'max_candidates' : 200,
\ 'syntax' : 'uniteSource__NeoBundleSearch',
\ 'parents' : ['uri'],
\ }
function! s:source.hooks.on_init(args, context) "{{{
let a:context.source__sources = copy(s:neobundle_sources)
if !empty(a:args)
let a:context.source__sources = filter(
\ a:context.source__sources,
\ 'index(a:args, v:key) >= 0')
endif
let a:context.source__input = a:context.input
if a:context.source__input == ''
let a:context.source__input =
\ unite#util#input('Please input search word: ', '',
\ 'customlist,unite#sources#neobundle_search#complete_plugin_names')
endif
endfunction"}}}
function! s:source.gather_candidates(args, context) "{{{
if neobundle#util#is_sudo()
call neobundle#util#print_error(
\ '"sudo vim" is detected. This feature is disabled.')
return []
endif
call unite#print_source_message('Search word: '
\ . a:context.source__input, s:source.name)
let candidates = []
let a:context.source__source_names = []
let s:plugin_names = []
for source in values(a:context.source__sources)
let source_candidates = source.gather_candidates(a:args, a:context)
let source_name = get(source, 'short_name', source.name)
for candidate in source_candidates
let candidate.source__source = source_name
if !has_key(candidate, 'source__script_type')
let candidate.source__script_type = ''
endif
if !has_key(candidate, 'source__description')
let candidate.source__description = ''
endif
endfor
let candidates += source_candidates
call add(a:context.source__source_names, source_name)
let s:plugin_names += map(copy(source_candidates), 'v:val.source__name')
endfor
call s:initialize_plugin_names(a:context)
return filter(candidates,
\ 'stridx(v:val.word, a:context.source__input) >= 0')
endfunction"}}}
function! s:source.complete(args, context, arglead, cmdline, cursorpos) "{{{
let arglead = get(a:args, -1, '')
return filter(keys(s:neobundle_sources),
\ "stridx(v:val, arglead) == 0")
endfunction"}}}
function! s:source.hooks.on_syntax(args, context) "{{{
syntax match uniteSource__NeoBundleSearch_DescriptionLine
\ / -- .*$/
\ contained containedin=uniteSource__NeoBundleSearch
syntax match uniteSource__NeoBundleSearch_Description
\ /.*$/
\ contained containedin=uniteSource__NeoBundleSearch_DescriptionLine
syntax match uniteSource__NeoBundleSearch_Marker
\ / -- /
\ contained containedin=uniteSource__NeoBundleSearch_DescriptionLine
syntax match uniteSource__NeoBundleSearch_Install
\ / Installed /
\ contained containedin=uniteSource__NeoBundleSearch
highlight default link uniteSource__NeoBundleSearch_Install Statement
highlight default link uniteSource__NeoBundleSearch_Marker Special
highlight default link uniteSource__NeoBundleSearch_Description Comment
endfunction"}}}
" Actions "{{{
let s:source.action_table.yank = {
\ 'description' : 'yank plugin settings',
\ 'is_selectable' : 1,
\ }
function! s:source.action_table.yank.func(candidates) "{{{
let @" = join(map(a:candidates,
\ "'NeoBundle ' . s:get_neobundle_args(v:val)"), "\n")
if has('clipboard')
let @* = @"
endif
echo 'Yanked plugin settings!'
endfunction"}}}
let s:source.action_table.install = {
\ 'description' : 'direct install plugins',
\ 'is_selectable' : 1,
\ 'is_quit' : 0,
\ }
function! s:source.action_table.install.func(candidates) "{{{
for candidate in a:candidates
execute 'NeoBundleDirectInstall' s:get_neobundle_args(candidate)
endfor
endfunction"}}}
"}}}
" Filters "{{{
function! s:source.source__sorter(candidates, context) "{{{
return s:sort_by(a:candidates, 'v:val.source__name')
endfunction"}}}
function! s:source.source__converter(candidates, context) "{{{
let max_plugin_name = max(map(copy(a:candidates),
\ 'len(v:val.source__name)'))
let max_script_type = max(map(copy(a:candidates),
\ 'len(v:val.source__script_type)'))
let max_source_name = max(map(copy(a:context.source__source_names),
\ 'len(v:val)'))
let format = '%-'. max_plugin_name .'s %-'.
\ max_source_name .'s %-'. max_script_type .'s -- %s'
for candidate in a:candidates
let candidate.abbr = printf(format,
\ candidate.source__name, candidate.source__source,
\ candidate.source__script_type,
\ (neobundle#is_installed(candidate.source__name) ?
\ 'Installed' : candidate.source__description))
let candidate.is_multiline = 1
let candidate.kind =
\ get(candidate, 'action__path', '') != '' ?
\ 'file' : 'common'
endfor
return a:candidates
endfunction"}}}
let s:source.filters =
\ ['matcher_default', s:source.source__sorter,
\ s:source.source__converter]
"}}}
" Misc. "{{{
function! s:sort_by(list, expr)
let pairs = map(a:list, printf('[v:val, %s]', a:expr))
return map(s:sort(pairs,
\ 'a:a[1] == a:b[1] ? 0 : a:a[1] > a:b[1] ? 1 : -1'), 'v:val[0]')
endfunction
" Sorts a list with expression to compare each two values.
" a:a and a:b can be used in {expr}.
function! s:sort(list, expr)
if type(a:expr) == type(function('function'))
return sort(a:list, a:expr)
endif
let s:expr = a:expr
return sort(a:list, 's:_compare')
endfunction
function! s:_compare(a, b)
return eval(s:expr)
endfunction
function! s:get_neobundle_args(candidate)
return string(a:candidate.source__path)
\ . (empty(a:candidate.source__options) ?
\ '' : ', ' . string(a:candidate.source__options))
\ . (a:candidate.source__description == '' ? '' :
\ ' " ' . a:candidate.source__description)
endfunction
function! unite#sources#neobundle_search#complete_plugin_names(arglead, cmdline, cursorpos) "{{{
return filter(s:get_plugin_names(), "stridx(v:val, a:arglead) == 0")
endfunction"}}}
function! s:initialize_plugin_names(context) "{{{
let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle'
let path = 'plugin_names'
if a:context.is_redraw || !s:Cache.filereadable(cache_dir, path)
" Convert cache data.
call s:Cache.writefile(cache_dir, path, [string(s:plugin_names)])
endif
return s:get_plugin_names()
endfunction"}}}
function! s:get_plugin_names() "{{{
let cache_dir = neobundle#get_neobundle_dir() . '/.neobundle'
let path = 'plugin_names'
if empty(s:plugin_names) && s:Cache.filereadable(cache_dir, path)
sandbox let s:plugin_names =
\ eval(get(s:Cache.readfile(cache_dir, path), 0, '[]'))
endif
return neobundle#util#uniq(s:plugin_names)
endfunction"}}}
"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/bin/neoinstall.
> > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 |
#!/bin/bash
# Detect .vimrc path.
VIMRC=$HOME/.vimrc
if [[ ! -e $VIMRC ]]; then
VIMRC=$HOME/.vim/vimrc
fi
vim -N -u $VIMRC -c "try | NeoBundleUpdate | finally | qall! | endtry" \
-U NONE -i NONE -V1 -e -s
echo ''
|
Added .vim/bundle/neobundle.vim/doc/neobundle.txt.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 |
*neobundle.txt* Ultimate Vim package manager
Version: 3.0
Author : Shougo <Shougo.Matsu at gmail.com>
License: MIT license {{{
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
}}}
CONTENTS *neobundle-contents*
Introduction |neobundle-introduction|
Usage |neobundle-usage|
Install |neobundle-install|
Interface |neobundle-interface|
Functions |neobundle-functions|
Commands |neobundle-commands|
Variables |neobundle-variables|
Options |neobundle-options|
Configuration Examples |neobundle-examples|
Unite sources |neobundle-unite-sources|
Recipe |neobundle-recipe|
FAQ |neobundle-faq|
==============================================================================
INTRODUCTION *neobundle-introduction*
*neobundle* is the ultimate Vim package manager. This plugin is inspired by
Vundle.vim (https://github.com/gmarik/vundle), but I added tons of features.
For example:
* Uses |vimproc| if available
* |unite.vim| interface
* Revision lock
* Supports svn/Mercurial repositories besides Git
* Can use a different base path
* Vundle like syntax
==============================================================================
USAGE *neobundle-usage*
Refer to the example:
|neobundle-examples|
Run this command to update your bundled plugins:
>
:NeoBundleUpdate
<
Note: To use the unite.vim interface, run this command (requires |unite.vim|):
>
:Unite neobundle/update
<
Settings for this plugin are compatible with Vundle.vim :-)
You can search popular plugins and add neobundle settings at Vimpusher
(registration required):
http://www.vimpusher.com/
Or at vim-scripts.org:
http://vim-scripts.org/
Neobundle now features a plugin search for vim.org scripts (requires
|unite.vim|)
>
:Unite neobundle/search
<
==============================================================================
INSTALL *neobundle-install*
Requirements: Vim 7.2.051 or above.
First of all, git clone the repository.
Note: You need to have git installed.
>
$ mkdir -p ~/.vim/bundle
$ git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
<
And set up a path to the repository directory.
>
set runtimepath+={path to neobundle directory}
<
Example:
>
set runtimepath+=~/.vim/bundle/neobundle.vim
<
Now configure your neobundles. (Refer to |neobundle-examples|)
Run the |:NeoBundleInstall| command to install your plugins.
>
$ vim +NeoBundleInstall +q
or
$ . ~/.vim/bundle/neobundle.vim/bin/neoinstall
==============================================================================
INTERFACE *neobundle-interface*
------------------------------------------------------------------------------
FUNCTIONS *neobundle-functions*
neobundle#rc([{base-path}]) *neobundle#rc()*
Initializes neobundle.vim. {base-path} is where your
downloaded plugins will be placed.
If {base-path} is omitted, neobundle looks for a "bundle"
directory in the default 'runtimepath'.
Note: It executes ":filetype off" automatically.
Note: You must not call the function inner
"has('vim_starting')".
>
if has('vim_starting')
set nocompatible
set runtimepath+={path to neobundle directory}
endif
call neobundle#rc(expand('~/.vim/bundle'))
NeoBundle 'git://github.com/Shougo/neocomplcache.git'
...
filetype plugin indent on
<
neobundle#source({bundle-names}) *neobundle#source()*
Same as |:NeoBundleSource|.
{bundle-names} is a list of bundle names.
*neobundle#exists_not_installed_bundles()*
neobundle#exists_not_installed_bundles()
Checks if there are any bundles that are not installed.
*neobundle#get_not_installed_bundle_names()*
neobundle#get_not_installed_bundle_names()
Returns the names of bundles that are not installed.
*neobundle#is_installed()*
neobundle#is_installed({bundle-name})
Checks if bundle {bundle-name} is installed.
*neobundle#is_sourced()*
neobundle#is_sourced({bundle-name})
Checks if bundle {bundle-name} is loaded.
neobundle#local({directory}, [{options}]) *neobundle#local()*
Adds the subdirectories in {directory} to
runtimepath, like |pathogen| does. See |neobundle-options| for
keys to set in {options}.
Note: |:NeoBundleLocal| is a shortcut for this function.
Note: Unlike |:NeoBundleLocal|, all plugins in {directory}
get loaded.
>
" Load plugin from "~/.vim/bundle".
call neobundle#local("~/.vim/bundle", {})
<
neobundle#get({bundle-name}) *neobundle#get()*
Get the neobundle options dictionary for {bundle-name}.
Useful for setting hooks.
Example:
>
NeoBundleLazy 'tyru/open-browser.vim', '', 'same', { 'autoload' : {
\ 'mappings' : '<Plug>(open-browser-wwwsearch)',
\ }}
nmap gs <Plug>(open-browser-wwwsearch)
let bundle = neobundle#get('open-browser.vim')
function! bundle.hooks.on_source(bundle)
nnoremap <Plug>(open-browser-wwwsearch)
\ :<C-u>call <SID>www_search()<CR>
function! s:www_search()
let search_word = input('Please input search word: ', '',
\ 'customlist,wwwsearch#cmd_Wwwsearch_complete')
if search_word != ''
execute 'OpenBrowserSearch' escape(search_word, '"')
endif
endfunction
endfunction
<
neobundle#get_hooks({bundle-name}) *neobundle#get_hooks()*
Get the neobundle "hooks" dictionary for {bundle-name}.
Useful for setting hooks.
neobundle#call_hook({hook-name}) *neobundle#call_hook()*
Calls the hook {hook-name}.
Note: If {hook-name} is "on_source", neobundle will call
"on_source" hooks in sourced bundles.
neobundle#config({bundle-name}, {dict}) *neobundle#config()*
neobundle#config({dict})
Change plugin options for {bundle-name}.
Note: To lazy-load a plugin, you can set the "lazy" flag after
calling |:NeoBundle| or |:NeoBundleLocal|.
It you omit {bundle-name}, it uses |neobundle#tapped|
variable.
>
NeoBundle 'Shougo/neocomplcache'
call neobundle#config('neocomplcache', {
\ 'lazy' : 1,
\ 'autoload' : {
\ 'insert' : 1,
\ }})
" Use neobundle#tap()
NeoBundle 'Shougo/neocomplete'
if neobundle#tap('neocomplete')
" Some settings...
function! neobundle#tapped.hooks.on_source(bundle)
" Some settings...
endfunction
call neobundle#untap()
endif
<
neobundle#tap({bundle-name}) *neobundle#tap()*
Initialize |neobundle#tapped| variable as {bundle-name}
bundle.
It returns non-zero if {bundle-name} is exists.
neobundle#untap() *neobundle#untap()*
Clear current |neobundle#tapped| variable.
------------------------------------------------------------------------------
COMMANDS *neobundle-commands*
*:NeoBundle*
:NeoBundle {repository} [[,{revision}] [,{options}]]
:NeoBundle {repository} ,{revision}, {default} [,{options}]]
Configures a bundle.
{repository} is the repository URI. {revision} is the desired
revision or branch name. If omitted, the current latest
revision will be used. {default} is a "default options
name" (See |g:neobundle#default_options|).
Note: Don't set neobundle setting in .gvimrc!
Note: If you omit the protocol (ex: git or https) for a git
repo, |g:neobundle_default_git_protocol| is used.
Note: If you manage bundle by neobundle, it may be error
occurred when update bundles.
See |neobundle-options| for what to set in {options}.
:NeoBundleInstall [{name}...] *:NeoBundleInstall*
Installs plugins specified by {name}. {name} is
fuzzy-searched. If {name} is omitted, all configured plugins
are installed. Note: {name}s are plugin names like
"neobundle.vim", not "Shougo/neobundle.vim".
:NeoBundleInstall! [{name}...] *:NeoBundleInstall!*
Same as |:NeoBundleUpdate|.
:NeoBundleUpdate [{name}...] *:NeoBundleUpdate*
Installs and updates plugins specified by {name}. {name} is
fuzzy-searched. If {name} is omitted, all configured plugins
are installed and updated, except if they are outdated or have
the "stay_same" option set.
Note: {name}s are plugin names like "neobundle.vim", not
"Shougo/neobundle.vim".
:NeoBundleUpdate! [{name}...] *:NeoBundleUpdate!*
Same as |:NeoBundleUpdate|, except that it disregards the
"stay_same" option.
:NeoBundleClean [{bang} [{name}...]] *:NeoBundleClean*
Removes non-configured bundles that still exist in the bundle
path from the filesystem. If {bang} is added, force remove
them. If {name}s are added, remove bundles specified by
{name}s.
:NeoBundleReinstall [{name}...] *:NeoBundleReinstall*
Reinstalls the bundles specified by {name}.
:NeoBundleList *:NeoBundleList*
Prints a list of configured bundles.
:NeoBundleLog *:NeoBundleLog*
Prints all previous install logs.
:NeoBundleUpdatesLog *:NeoBundleUpdatesLog*
Prints previous update logs.
:NeoBundleLocal {base-directory-path} *:NeoBundleLocal*
Registers a bundle from the directories in
{base-directory-path} like pathogen does.
Note: If you want to use neobundle like pathogen.vim, you
should set a different base path from the standard neobundle
bundles path.
>
NeoBundleLocal ~/.vim/bundle
<
*:NeoBundleLazy*
:NeoBundleLazy {repository} [[,{revision}] [,{options}]]
:NeoBundleLazy {repository} ,{revision}, {default} [,{options}]]
Registers a bundle, but doesn't add it to 'runtimepath'.
>
NeoBundleLazy 'The-NERD-tree', {'augroup' : 'NERDTree'}
NeoBundleSource The-NERD-tree
<
You can use it to load plugins for specific filetypes.
>
NeoBundleLazy 'Rip-Rip/clang_complete'
autocmd FileType c,cpp NeoBundleSource clang_complete
<
:NeoBundleSource [{name}...] *:NeoBundleSource*
|:source| the bundles specified by {name}.
If {name} is omitted, |:source| all lazy bundles.
Note: This command is used to load the neobundles configured
with |:NeoBundleLazy|.
:NeoBundleFetch {repository} [, {options}] *:NeoBundleFetch*
Registers a bundle, but doesn't add it to 'runtimepath'.
Unlike |:NeoBundleLazy|, you cannot load the bundle with
|:NeoBundleSource|. This command is useful for managing
non-Vim plugins using neobundle.
>
NeoBundleFetch 'davidhalter/jedi'
<
:NeoBundleDocs *:NeoBundleDocs*
Execute |:helptags| for all bundles manually.
*:NeoBundleDepends*
:NeoBundleDepends {repository} [, {options}]
Registers a bundle and installs the plugin. This command is
useful for defining Vim plugin dependencies.
Note: This command does not overwrite user neobundle
configuration.
>
if exists(':NeoBundleDepends') == 2
NeoBundleDepends 'Shougo/unite.vim.git'
endif
<
*:NeoBundleDirectInstall*
:NeoBundleDirectInstall {repository} [, {options}]
Registers a bundle, and installs it directly.
Note: The settings are saved in "direct_bundles.vim" in
|neobundle#rc()| directory.
Note: To uninstall direct installed bundles, you must delete
plugin settings manually in "direct_bundles.vim" in
|neobundle#rc()| directory and execute |:NeoBundleClean|
command.
>
NeoBundleDirectInstall 'Shougo/neocomplcache'
<
*:NeoBundleDirectEdit*
:NeoBundleDirectEdit
Edit direct installed bundles easily.
:NeoBundleDisable {name}... *:NeoBundleDisable*
Disables bundles specified by {name}. If a bundle is
disabled, its path will be removed from 'runtimepath'.
Note: This command must be executed before neobundle loads
the plugins.
:NeoBundleCheck *:NeoBundleCheck*
Check plugins installation. If plugins are not installed, it
will execute |:NeoBundleInstall| automatically. This command
also check documentation directories and will execute
|:NeoBundleDocs| automatically.
*:NeoBundleRecipe*
:NeoBundleRecipe {recipe-name} [, {options}]
Registers a bundle from "recipes/{recipe-name}.vimrecipe" file
in 'runtimepath'. This command is useful if you don't want to
set bundle options.
Note: You must install recipes(|neobundle-recipe|) before
executing it.
>
NeoBundleRecipe 'vimproc'
<
------------------------------------------------------------------------------
VARIABLES *neobundle-variables*
neobundle#tapped *neobundle#tapped*
Current bundle variable set by |neobundle#tap()|.
g:neobundle#default_site *g:neobundle#default_site*
The default repository site if "site" option is omitted.
*g:neobundle_default_site*
Note: |g:neobundle_default_site| is obsolete.
Defaults to "github".
g:neobundle#log_filename *g:neobundle#log_filename*
The log filename. Set it to "" to disable logging.
*g:neobundle_log_filename*
Note: |g:neobundle_log_filename| is obsolete.
Defaults to "".
*g:neobundle#enable_name_conversion*
g:neobundle#enable_name_conversion
If you set to 1 and omit bundle name,
|neobundle-options-regular_name| is used as bundle name.
It is useful for absorbing difference of repository name.
g:neobundle#rm_command *g:neobundle#rm_command*
The command used to remove files for |:NeoBundleClean|.
*g:neobundle_rm_command*
Note: |g:neobundle_rm_command| is obsolete.
Defaults to "rmdir /S /Q" on Windows or "rm -rf" in
others.
*g:neobundle#install_max_processes*
g:neobundle#install_max_processes
The max number of processes used for neobundle/install source
asynchronous update.
*g:unite_source_neobundle_install_max_processes*
Note: |g:unite_source_neobundle_install_max_processes| is
obsolete.
Defaults to "4".
*g:neobundle#install_process_timeout*
g:neobundle#install_process_timeout
The time of timeout seconds when updating/installing bundles.
Note: This feature is available if you installed |vimproc|.
Defaults to "60".
g:neobundle#default_options *g:neobundle#default_options*
A dictionary of preconfigured sets of options to use when
options are omitted for individual commands or functions.
Keys are arbitrary names for the option sets, and values are
dictionaries themselves that store option keys and values.
Use the special key "_" to store a "default default options".
Example:
>
let g:neobundle#default_options =
\ { 'rev' : {'rev' : 'ver.8'} }
NeoBundle 'Shougo/neocomplcache', '', 'rev'
<
Defaults to "{}".
*g:neobundle#types#raw#calc_hash_command*
g:neobundle#types#raw#calc_hash_command
The hash command to use in raw repositories.
Defaults to "sha1sum" or "md5sum".
*g:neobundle#types#git#default_protocol*
g:neobundle#types#git#default_protocol
The default protocol used for git (github).
Note: If you need to use neobundle in proxy or firewall, you
must use it in "https".
*g:neobundle_default_git_protocol*
Note: |g:neobundle_default_git_protocol| is obsolete.
Defaults to "https".
*g:neobundle#types#git#enable_submodule*
g:neobundle#types#git#enable_submodule
If it is non-zero, neobundle enables git submodule support.
But it may be slow in Windows environment.
Defaults to 1.
*g:neobundle#types#hg#default_protocol*
g:neobundle#types#hg#default_protocol
The default protocol used for hg (bitbucket).
*g:neobundle_default_hg_protocol*
Note: |g:neobundle_default_git_protocol| is obsolete.
Defaults to "https".
------------------------------------------------------------------------------
OPTIONS *neobundle-options*
The {options} in neobundle commands accept the following keys:
*neobundle-options-name*
name (String)
Specify the name of the bundle. This is used for neobundle
management and other commands (like |:NeoBundleUpdate|). If
omitted, the tail of the repository name will be used.
Note: Must be unique across all bundles. If a bundle name
conflicts with another bundle, neobundle will overwrite the
previous settings with the new one. If a repo tail is bound to
conflict, you can set the "name" option manually to prevent
overwriting an existing bundle setting.
Example:
>
NeoBundle 'git://github.com/Shougo/unite.vim.git',
\ {'name' : 'unite'}
NeoBundle 'git://github.com/foo/foo.git',
\ {'name' : 'foo-foo'}
NeoBundle 'git://github.com/bar/foo.git',
\ {'name' : 'bar-foo'}
NeoBundle 'git://git.code.sf.net/p/atp-vim/code',
\ {'name': 'atp-vim'}
<
*neobundle-options-regular_name*
regular_name (String)
Specify the normalized name of the bundle. This is used for
neobundle management for detect depends. If omitted, neobundle
will normalize the tail of the repository name.
Note: Must be unique across all bundles.
Normalized name example:
name : normalized name
>
unite.vim unite
vim-quickrun quickrun
<
description (String)
Plugin description.
rev (String)
Specify a revision number or branch/tag name.
Note: If the type is "raw", rev is hash number.
Example:
>
NeoBundle 'Shougo/vimshell', { 'rev' : '3787e5' }
<
*neobundle-options-default*
default (String)
Specify a default option name. (See |g:neobundle#default_options|).
directory (String)
Specify relative directory path from the base directory (set
by |neobundle#rc()| or "base" option). If omitted, the "name"
option will be used.
Note: If you set rev "foo" when the name key is "neobundle",
the directory key is "neobundle_foo".
Example:
>
NeoBundle 'git://github.com/Shougo/unite.vim.git',
\ {'directory' : 'unite'}
<
*neobundle-options-recipe*
recipe (String)
Use default options from the "recipes/{recipe-name}.vimrecipe"
file in 'runtimepath'. (See |:NeoBundleRecipe|).
Example:
>
NeoBundle 'Shougo/unite.vim', {'recipe' : 'unite'}
<
*neobundle-options-base_path*
base (String)
Directory base path to use. If omitted, the path specified
with |neobundle#rc()| will be used. It is useful for loading
scripts from a different path.
Example:
*neobundle-options-type*
type (String)
Specify the repository type. If omitted, a guess is made
based on {repository}.
Available types:
"nosync" : No synchronous
"raw" : Raw plugin file ("script_type" attribute is
needed)
"git" : Git
"hg" : Mercurial
"svn" : Subversion
Example:
>
NeoBundle 'git://host/path/repo.git', {'type': 'hg'}
NeoBundle 'thinca/vim-localrc', {'type' : 'svn'}
<
*neobundle-options-script_type*
script_type (String)
Specify the script type. It is useful for non-official
categorized plugins.
For example: "indent", "plugin", "ftplugin", ...
Example:
>
NeoBundle 'bronzehedwick/impactjs-colorscheme', {'script_type' : 'colors'}
<
*neobundle-options-site*
site (String)
Specify the repository site. If you omit both the repository
URL and the "site" option, |g:neobundle#default_site| will be
used.
Note: You can specify site by "{site-name}:{path}".
For example: "github:Shougo/vimshell"
Available sites:
"github" or "gh" : github.com (git)
"bitbucket" or "bb" : bitbucket.org (hg)
"gist" : gist.github.com (git)
*neobundle-options-rtp*
rtp (String)
Specify runtime path.
Use this option when the repository has the Vim plugin
in a subdirectory.
For example: https://github.com/rstacruz/sparkup
Example:
>
NeoBundle 'rstacruz/sparkup', {'rtp': 'vim'}
NeoBundle 'https://code.google.com/p/vimwiki/', {
\ 'rtp': "~/.vim/bundle/vimwiki/src",
\ }
<
*neobundle-options-depends*
depends (List or String)
Specify a list of plugins a plugin depends on.
List items are '{plugin-name}' or ['{plugin-name}', {args}].
Those specified in the list are installed automatically. If
the {plugin-name} needs options, specify them with {args}.
Note: Type String is syntax sugar for List of {plugin-name}.
Example:
>
NeoBundle 'Shougo/vimfiler', {'depends' : 'Shougo/unite.vim' }
NeoBundle 'Shougo/neocomplcache', {'depends' :
\ [ 'Shougo/neosnippet.git',
\ ['rstacruz/sparkup', {'rtp': 'vim'}],
\ ]}
<
*neobundle-options-build*
build (Dictionary)
Specify the build script.
You may use this option if the plugin has to be built before
use.
This command is executed by |system()| or |vimproc#system()|
in plugin runtimepath.
For example: |vimproc|
This dictionary accepts the following keys:
windows (String)
Specify Windows environment build script.
mac (String)
Specify Mac OS X environment build script.
cygwin (String)
Specify Cygwin environment build script.
unix (String)
Specify Unix environment build script.
others (String)
Specify others environment build script.
Example:
>
NeoBundle 'Shougo/vimproc', {
\ 'build' : {
\ 'windows' : 'make -f make_mingw32.mak',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'unix' : 'make -f make_unix.mak',
\ },
\ }
<
*neobundle-options-augroup*
augroup (String)
Specify an augroup name that the plugin uses for |VimEnter| or
|GUIEnter| autocmd events.
Neobundle will call their |VimEnter| or |GUIEnter| autocmds
automatically when |:NeoBundleSource| is executed.
Note: You'll want to set this option because some plugins
rely on autocmds defined for |VimEnter| or |GUIEnter|, but by
using |:NeoBundleSource| after loading .vimrc, those autocmds
may get skipped. Some examples are, "fugitive", "NERDTree",
and "session.vim".
Examples:
>
" NERDTree uses augroup NERDTreeHijackNetrw.
NeoBundle 'scrooloose/nerdtree', { 'augroup' : 'NERDTreeHijackNetrw'}
" fugitive uses augroup fugitive.
NeoBundle 'tpope/vim-fugitive', { 'augroup' : 'fugitive'}
<
This option is also valid in |:NeoBundleLazy|.
*neobundle-options-external_commands*
external_commands (Dictionary or List or String)
Specify a list of external commands that the plugin depends
on. List items are '{command-name}' or ['{command-name}',
...] or { {dictionary} }.
The commands are checked when loading the plugin.
Note: Type String is syntax sugar for list of {command-name}s.
The {dictionary} has following keys:
windows (String)
Specify Windows environment external commands.
mac (String)
Specify Mac OS X environment external commands.
cygwin (String)
Specify Cygwin environment external commands.
unix (String)
Specify Unix environment external commands.
others (String)
Specify others environment external commands.
Example:
>
NeoBundle 'ujihisa/neco-ghc', { 'external_commands' : 'ghc-mod' }
<
*neobundle-options-stay_same*
stay_same (Number)
If set to 1, neobundle doesn't update it automatically when
|:NeoBundleUpdate| or ":Unite neobundle/update" is called with
no arguments. It is useful for outdated plugins that can no
longer be updated.
>
NeoBundle 'Shougo/neobundle', { 'stay_same' : 1 }
<
*neobundle-options-lazy*
lazy (Number)
If set to 1, neobundle doesn't add the path to user
runtimepath.
*neobundle-options-autoload*
autoload (Dictionary)
Specify autoload conditions.
If you set it, neobundle will execute |:NeoBundleSource|
automatically when the conditions are met.
This dictionary accepts the following keys:
filetypes (List) or (String)
Filetype list.
commands (List) or (String)
Command list. The item can be following dictionary.
name (String)
Command name.
complete (String)
The type of completion supported for the
input. Refer to |:command-completion| for
information.
Example:
functions (List) or (String)
Functions list.
function_prefix (String)
Autoload function prefix in functions.
{function_prefix}#...
If the prefix is set, functions were loaded
automatically.
If omitted it, automatically generated prefix is used.
Example: If you use "unite.vim", "unite" function
prefix is used.
mappings (List) or (String)
Mappings list. The items are {mapping} or
[{mode}, {mapping1}, [{mapping2}, ...]]. If {mode} is
omitted, "nxo" is used.
Note: You can use plugin prefix mappings.
For example, you can use "<Plug>(ref-" instead of
"<Plug>(ref-back)" and so on.
Note: But you cannot use lazy <Plug> mappings twice.
For example: >
NeoBundleLazy 'osyo-manga/vim-anzu', {'autoload': {'mappings': '<Plug>(anzu-'}}
" Not working!!
nmap n <Plug>(anzu-jump-n)<Plug>(anzu-echo-search-status)zv
nmap N <Plug>(anzu-jump-N)<Plug>(anzu-echo-search-status)zv
<
unite_sources (List) or (String)
Unite source name list.
Note: To use this feature, you must install latest
|unite.vim|.
insert (Number)
If set to non-zero, neobundle will |:NeoBundleSource|
on |InsertEnter| autocmd.
explorer (Number)
If set to non-zero, neobundle will |:NeoBundleSource|
on editing non-file.
Note: It is useful for explorer behavior plugins.
Ex: vimfiler, metarw...
Note: To autoload vimfiler, you must disable netrw in
.vimrc. >
" Disable netrw.vim
let g:loaded_netrwPlugin = 1
<
on_source (List) or (String)
Load the bundle when the list bundles are loaded.
For example: >
if neobundle#tap('plugin-B.vim')
call neobundle#config({
\ 'autoload' : {
\ 'on_source' : [ 'plugin-A.vim' ]
\ }
\ })
call neobundle#untap()
endif
<
plugin-B is loaded before plugin-A is loaded.
Examples:
>
NeoBundleLazy 'Rip-Rip/clang_complete', {
\ 'autoload' : {
\ 'filetypes' : ['c', 'cpp'],
\ },
\ }
NeoBundleLazy 'basyura/TweetVim', { 'depends' :
\ ['basyura/twibill.vim', 'tyru/open-browser.vim'],
\ 'autoload' : { 'commands' : 'TweetVimHomeTimeline' }}
NeoBundleLazy 'kana/vim-smartword', { 'autoload' : {
\ 'mappings' : [
\ '<Plug>(smartword-'']
\ }}
NeoBundleLazy 'Shougo/vim-vcs', {
\ 'depends' : 'thinca/vim-openbuf',
\ 'autoload' : {'functions' : 'vcs#info', 'commands' : 'Vcs'},
\ }
NeoBundleLazy 'Shougo/vimshell',{
\ 'depends' : 'Shougo/vimproc',
\ 'autoload' : {
\ 'commands' : [{ 'name' : 'VimShell',
\ 'complete' : 'customlist,vimshell#complete'},
\ 'VimShellExecute', 'VimShellInteractive',
\ 'VimShellTerminal', 'VimShellPop'],
\ 'mappings' : ['<Plug>(vimshell_']
\ }})
NeoBundleLazy 'Shougo/vimfiler', {
\ 'depends' : 'Shougo/unite.vim',
\ 'autoload' : {
\ 'commands' : [{ 'name' : 'VimFiler',
\ 'complete' : 'customlist,vimfiler#complete' },
\ 'VimFilerExplorer',
\ 'Edit', 'Read', 'Source', 'Write'],
\ 'mappings' : ['<Plug>(vimfiler_'],
\ 'explorer' : 1,
\ }
\ }
NeoBundleLazy 'Shougo/junkfile.vim', {
\ 'autoload' : {
\ 'commands' : 'JunkfileOpen',
\ 'unite_sources' : ['junkfile', 'junkfile/new'],
\ }}
NeoBundleLazy 'tyru/winmove.vim', { 'autoload' : {
\ 'gui' : 1,
\ 'mappings' : [
\ ['n', '<Plug>(winmove-']],
\ },
\ 'augroup' : 'winmove',
\ }
<
*neobundle-options-overwrite*
overwrite (Number)
If set to 1, neobundle doesn't overwrite the path to user
runtimepath.
*neobundle-options-resettable*
resettable (Number)
If set to 0, neobundle doesn't reset the path in
|neobundle#rc()|.
*neobundle-options-gui*
gui (Number)
If set 1, neobundle will only load the plugin in GUI Vim.
Example: >
NeoBundleLazy 'tyru/restart.vim', '', 'same', {
\ 'gui' : 1,
\ 'autoload' : {
\ 'commands' : 'Restart'
\ }}
<
*neobundle-options-terminal*
terminal (Number)
If set to 1, neobundle will only load the plugin in Terminal
Vim.
*neobundle-options-vim_version*
vim_version (String)
Minimal vim version of the plugin supported.
It accepts some version formats such as "7" and "7.3" and
"7.3.885".
*neobundle-options-disabled*
disabled (Number)
If set to 1, neobundle will disable the plugin.
Example: >
" neocomplete requires vim 7.3.885 or above.
NeoBundle 'Shougo/neocomplete', {
\ 'depends' : 'Shougo/context_filetype.vim',
\ 'disabled' : !has('lua'),
\ 'vim_version' : '7.3.885'
\ }
<
*neobundle-options-hooks*
hooks (Dictionary)
Specify hook functions. The following hook functions are
defined:
*neobundle-hooks-on_source*
on_source
Called before scripts are sourced. It is useful for
plugin initialization in lazy bundles.
Note: In Vim initializing, calling the hooks are
delayed until |VimEnter|.
Note: To re-call on_source hook when reloading .vimrc,
you must call the hook in end of .vimrc.
*neobundle-hooks-on_post_source*
on_post_source
Called after scripts are sourced.
Note: In Vim initializing, calling the hooks are
delayed until |VimEnter|.
Note: To re-call on_source hook when reloading .vimrc,
you must call the hook in end of .vimrc.
*neobundle-options-type__protocol*
type__protocol (String)
The protocol used for types.
"https" and "git" and "ssh" are available for git type.
"https" is available for hg type.
If omitted, |g:neobundle#types#git#default_protocol|
or |g:neobundle#types#hg#default_protocol| is used.
Note: This attribute is available in git and hg types only.
Examples:
>
NeoBundle 'ujihisa/neco-ghc', { 'type__protocol' : 'ssh' }
<
*neobundle-options-type__filename*
type__filename (String)
The downloaded filename.
If omitted, uri filename will be used.
It is useful for downloading vim.org scripts.
Note: This attribute is available in raw type only.
Examples:
>
NeoBundle 'http://www.vim.org/scripts/download_script.php?src_id=19619',
\ { 'type__filename' : 'python.vim', 'script_type' : 'syntax' }
<
Examples: |:NeoBundle-examples|
>
NeoBundle 'git_repository_uri'
NeoBundle 'script_name'
NeoBundle 'http://github.com/tpope/vim-fugitive.git'
NeoBundle 'Shougo/neocomplcache', {'depends' :
\ [ 'Shougo/neosnippet.git',
\ ['rstacruz/sparkup', {'rtp': 'vim'}],
\ ]}
NeoBundle 'github:Shougo/vimshell'
" Pushable github repository.
NeoBundle 'git@github.com:Shougo/neocomplcache.git'
" For bitbucket svn repository.
NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'
" For bitbucket hg repository.
NeoBundle 'bitbucket:ns9tks/vim-fuzzyfinder'
NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'
" For bitbucket git repository(.git is needed).
NeoBundle 'bitbucket:kh3phr3n/vim-qt-syntax.git'
NeoBundle 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git'
" For raw repository.
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ {'script_type' : 'plugin'}
" For gist repository.
NeoBundle 'gist:Shougo/656148', {
\ 'name': 'everything.vim',
\ 'script_type': 'plugin'}
NeoBundle 'gist:355360', {
\ 'name': 'ambicmd.vim',
\ 'script_type': 'plugin'}
<
Neobundle supports revision (or branch) lock.
Note: The revision (or branch) is checked out in
install/update.
Note: You can either specify the revision manually or set the
to revision "master" to restore a plugin.
>
NeoBundle 'Shougo/vimshell', '3787e5'
NeoBundle 'Shougo/vimshell', 'master'
<
If type is "nosync", neobundle does not update
automatically (like pathogen.vim). Refer to |NeoBundleLocal|.
>
NeoBundle 'muttator', {'type' : 'nosync', 'base' : '~/.vim/bundle'}
<
Note: To use hg commands for git repository, please use this.
>
NeoBundle 'git://github.com/Shougo/neobundle.vim.git', {'type': 'hg'}
<
==============================================================================
EXAMPLES *neobundle-examples*
>
if has('vim_starting')
set nocompatible " Recommend
set runtimepath+={path to neobundle directory}
endif
" Use git protocol.
" let g:neobundle#types#git#default_protocol = 'git'
call neobundle#rc(expand('~/.vim/bundle'))
" Let neobundle manage neobundle
NeoBundleFetch 'Shougo/neobundle.vim'
" Use neobundle standard recipes.
NeoBundle 'Shougo/neobundle-vim-recipes'
" My Bundles here:
" Refer to |:NeoBundle-examples|.
" Note: You don't set neobundle setting in .gvimrc!
" ...
filetype plugin indent on " Required!
" Installation check.
NeoBundleCheck
"...
if !has('vim_starting')
" Call on_source hook when reloading .vimrc.
call neobundle#call_hook('on_source')
endif
<
==============================================================================
UNITE SOURCES *neobundle-unite-sources*
Here let me explain about a source for |unite| provided in neobundle.
*neobundle-unite-source-neobundle*
neobundle
Nominates bundles as a candidate.
Note: On windows
If argument is bang(!), print plugins path instead of plugins
status.
Note: Other platforms
If argument is bang(!), print plugins status instead of plugins
path.
http://github.com/Shougo/vimproc
*neobundle-unite-source-neobundle-install*
neobundle/install
Install configured plugins asynchronously.
Note: To install |vimproc| plugin is recommended.
http://github.com/Shougo/vimproc
If argument is bang(!), it will install and update all plugins.
Source arguments:
bundle names (fuzzy searched).
Example:
>
:Unite neobundle/install:!
:Unite neobundle/install:neocomplcache
:Unite neobundle/install:neocomplcache:unite.vim
<
If you use the source with "-auto-quit" option, the unite
buffer will close automatically.
>
:Unite neobundle/install -auto-quit
<
*neobundle-unite-source-neobundle-log*
neobundle/log
Print previous neobundle install logs.
*neobundle-unite-source-neobundle-update*
neobundle/update
Install and update configured plugins asynchronously, except
for outdated ones or those with the "stay_same" option.
Note: This source is the same as "neobundle/install:!".
Note: Installing the |vimproc| plugin is recommended.
If argument is bang(!), it will not be with fuzzy search.
If argument is "all", it will update all plugins.
If you use the source with "-auto-quit" option, the unite
buffer will close automatically.
>
:Unite neobundle/update -log -wrap -auto-quit
<
*neobundle-unite-source-neobundle-search*
neobundle/search
Search plugin settings from sources.
Note: This source requires "curl" or "wget" command.
Note: If you get errors in this source, please refresh the
cache file by |<Plug>(unite_redraw)|.
Source arguments:
source names.
Following source names are available:
"vim-script.org" :
Search plugins settings from "http://vim-scripts.org/".
"neobundle-vim-recipes" :
Search plugins settings from the |neobundle-recipe|.
"github" :
Search plugins settings from "http://github.org/".
*neobundle-unite-source-neobundle-lazy*
neobundle/lazy
List lazy configured plugins(not sourced by
|:NeoBundleSource|).
*unite-kind-neobundle*
neobundle An interface for neobundle bundles. It is used in
neobundle source and neobundle/lazy sources.
update Update bundles(Default action)
delete Delete bundles
preview view the plugin documentation
reinstall Reinstall bundles
narrow Narrow bundle files
edit Browse bundle directory
start Browse github plugin page
Actions for each of the sources
neobundle/search *unite-action-neobundle-search*
yank Yank plugin settings (Default action).
install Direct install plugins from repository.
Note: The settings is saved in ".direct_bundles" in
bundle directory.
start Browse github plugin page.
open Open the recipe file.
Note: If you use the install action, you cannot customize the bundle
settings.
neobundle/lazy *unite-action-neobundle-lazy*
source Source plugin files (Default action)
==============================================================================
RECIPE *neobundle-recipe*
neobundle/search source loads recipes from "recipes/*.vimrecipe" files in
'runtimepath'.
The standard recipes are in "neobundle-vim-recipes".
https://github.com/Shougo/neobundle-vim-recipes
You can use the recipes with the following command in .vimrc.
>
NeoBundle 'Shougo/neobundle-vim-recipes'
<
The recipe files are in json format, like this:
>
# Vim recipe file for neobundle.
{
'name' : 'neobundle',
'path' : 'Shougo/neobundle',
'description' : 'Ultimate Vim package manager',
'author' : 'Shougo',
'website' : 'https://github.com/Shougo/neobundle.vim'
}
<
A recipe has the following keys. Most of keys are the same as
those used in the neobundle configuration
dictionary(|neobundle-options|).
"#" starts a comment string, but they must start at the
beginning of the line.
name (String) (Required)
Specify plugin name.
path (String) (Required)
The repository URI.
Note: You can abbreviate long complete path, such as
"Shougo/neobundle.vim" instead of
"git://github.com/Shougo/neobundle.vim.git"
description (String) (Optional)
Plugin description to show in neobundle/search.
author (String) (Optional)
The script author name to show in neobundle/search.
base (String) (Optional)
Directory base path.
type (String) (Optional)
Specify repository type.
script_type (String) (Optional)
Specify script type.
site (String) (Optional)
Repository site.
rtp (String) (Optional)
Runtime path. Some plugin repositories contain the
vim plugins in a subdirectory, whose name is usually
"vim".
autoload (Dictionary) (Optional)
Autoload rules. See |neobundle-options-autoload|.
depends (List or String) (Optional)
Dependency plugins list.
build (Dictionary) (Optional)
Build script. e.g. make
external_commands
(Dictionary or List or String) (Optional)
Dependency external commands.
==============================================================================
FAQ *neobundle-faq*
Q: What's the neobundle advantage for Vundle or other plugin management
system?
A:
1. improved command name(:Bundle vs :NeoBundle).
2. neobundle works if you set 'shellslash' in your .vimrc.
3. neobundle supports vimproc(asynchronous update/install).
4. neobundle supports unite.vim interface(update/install/search).
5. neobundle supports revision lock feature.
6. neobundle supports other VCS(Subversion/Git).
7. neobundle supports lazy initialization for optimizing startup time.
8. and so on...
Q: I want to manage the rsense Vim plugin using neobundle.
A: Use |neocomplcache-rsense|. Installation and settings can be found in the
neocomplcache-rsense docs.
Note: neocomplcache-rsense depends |neocomplcache| plugin.
https://github.com/Shougo/neocomplcache-rsense
Q: I want to use "https" protocol instead of "git" (over proxy).
A: Change |g:neobundle#types#git#default_protocol|.
>
let g:neobundle#types#git#default_protocol = 'https'
<
Q: Vim freezes when a NeoBundle command is run with a typo in the repo name.
A: It's a git feature. Git awaits user input when the repo name is
wrong. You can install |vimproc| to keep your Vim from freezing:
https://github.com/Shougo/vimproc
Q: Duplicated error was printed when sourcing .vimrc.
A: Your .vimrc was wrong. You must reset neobundle setting by |neobundle#rc()|
in .vimrc.
Note: You must not call |neobundle#rc()| inner "has('vim_starting')".
>
if has('vim_starting')
set runtimepath+={path to neobundle directory}
" This is wrong neobundle#rc().
"call neobundle#rc(expand('~/.vim/bundle'))
endif
" This is OK.
call neobundle#rc(expand('~/.vim/bundle'))
<
Q: I want to compile vimproc automatically.
A:
>
NeoBundle 'Shougo/vimproc', {
\ 'build' : {
\ 'windows' : 'make -f make_mingw32.mak',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'unix' : 'make -f make_unix.mak',
\ },
\ }
<
Q: What's the "outdated" plugin?
A: Last update time is older than one week -> Automatic updates are disabled
until one day from the last update.
Last update time is older within one week -> Automatic updates are every time.
Note: If you use update with name or use "all" argument in neobundle/update
source or use "!" in |:NeoBundleUpdate| command, this feature will be
disabled; it forces updates them.
Q: I want to update messages in unite buffer.
A:
>
Unite -log -wrap neobundle/update
<
Q: neobundle.vim is not worked in debian/Ubuntu Linux...
A: Did you use "debian.vim"? "debian.vim" changes 'runtimepath'.
So it conflicts with neobundle. You should not use "debian.vim".
Q: neobundle.vim fails update in submodule repository.
A: neobundle.vim supports submodule repository. But I think the repository was
changed recently from non-use submodule to use submodule. You must reinstall
the repository.
Q: I want to install github plugins with Subversion.
A:
>
NeoBundle 'thinca/vim-localrc', {'type' : 'svn'}
<
Q: Why change git default protocol to "https" from "git"?
After update, neobundle asks me to update all of my plugins. It's a kind of
nightmare.
A: Because, github changed default protocol "git" to "https".
https://help.github.com/articles/which-remote-url-should-i-use
In above page, git protocol description is not found.
I think git protocol is default protocol for git and it is fast.
But in proxy or firewall environment, git protocol cannot be used.
I responded the firewall problem recently.
If you don't want to change default protocol, you can set
|g:neobundle#types#git#default_protocol| manually. I don't change the default
value.
Q: I want to add absolute path in runtimepath with |:NeoBundle| and
|:NeoBundleLazy|.
https://github.com/Shougo/neobundle.vim/issues/136
A: You can use "nosync" type. >
NeoBundle '/absolute/path/to/plugin', { 'type' : 'nosync' }
Q: For example, I would like to register the IR_Black colorscheme from it's
original URL, without cloning one of the many mirror repo.
https://github.com/Shougo/neobundle.vim/issues/140
A: This feature is already implemented. >
NeoBundle 'http://blog.toddwerth.com/entry_files/8/ir_black.vim', {
\ 'name': 'ir_black.vim',
\ 'script_type': 'colors'}
Q: Problem with lazy loading of matchit plugin.
https://github.com/Shougo/neobundle.vim/issues/153
A:
>
NeoBundleLazy 'matchit.zip', { 'autoload' : {
\ 'mappings' : ['%', 'g%']
\ }}
let bundle = neobundle#get('matchit.zip')
function! bundle.hooks.on_post_source(bundle)
silent! execute 'doautocmd Filetype' &filetype
endfunction
<
Q: Cannot load colorscheme when reloading .vimrc.
https://github.com/Shougo/neobundle.vim/issues/157
A: You must write :NeoBundle lines before filetype plugin indent on and syntax
enable.
>
filetype plugin indent on
NeoBundle 'tomasr/molokai'
...
syntax enable
colorscheme molokai
<
Q: Error was printed when sourcing .vimrc.
A: You must not call |neobundle#rc()| inner "has('vim_starting')".
>
if has('vim_starting')
set runtimepath+={path to neobundle directory}
endif
" OK!
call neobundle#rc(expand('~/.vim/bundle'))
>
Q: Timeout on github makes Vim terribly slow if the repository is not found in
console Vim.
https://github.com/Shougo/neobundle.vim/issues/175
A: |vimproc| and |system()| uses input redirection. But git ignores it when
you used https protocol in console Vim. So it freezes. I think it is bad
feature in git. I cannot fix it. You should change
|g:neobundle#types#git#default_protocol| to "git".
==============================================================================
vim:tw=78:ts=8:ft=help:norl:noet:fen:
|
Added .vim/bundle/neobundle.vim/ftdetect/vimrecipe.vim.
> > | 1 2 | " Detect syntax file. autocmd BufNewFile,BufRead *.vimrecipe set filetype=vimrecipe |
Added .vim/bundle/neobundle.vim/plugin/neobundle.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
"=============================================================================
" FILE: neobundle.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 26 Aug 2013.
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
if exists('g:loaded_neobundle')
finish
elseif v:version < 702 || (v:version == 702 && !has('patch51'))
" Neobundle uses glob()/globpath() another parameter.
" It is implemented in Vim 7.2.051.
echoerr 'neobundle does not work this version of Vim "' . v:version . '".'
\ .' You must use Vim 7.2.051 or later.'
finish
endif
let s:save_cpo = &cpo
set cpo&vim
let g:loaded_neobundle = 1
let &cpo = s:save_cpo
unlet s:save_cpo
" __END__
" vim: foldmethod=marker
|
Added .vim/bundle/neobundle.vim/syntax/vimrecipe.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
"=============================================================================
" FILE: syntax/recipe.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 15 Sep 2010
" License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the
" "Software"), to deal in the Software without restriction, including
" without limitation the rights to use, copy, modify, merge, publish,
" distribute, sublicense, and/or sell copies of the Software, and to
" permit persons to whom the Software is furnished to do so, subject to
" the following conditions:
"
" The above copyright notice and this permission notice shall be included
" in all copies or substantial portions of the Software.
"
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
" }}}
"=============================================================================
let s:save_cpo = &cpo
set cpo&vim
if version < 700
syntax clear
elseif exists('b:current_syntax')
finish
endif
syntax region recipeString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=recipeEscape
syntax region recipeString start=+'+ skip=+\\\\\|\\"+ end=+'+
syntax match recipeEscape '\\["\\/bfnrt]' contained
syntax match recipeEscape '\\u\x\{4}' contained
syntax match recipeNumber '-\?\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\?\>'
syntax match recipeBraces '[{}\[\]]'
syntax match recipeComment '^\s*#.*$'
highlight def link recipeString String
highlight def link recipeEscape Special
highlight def link recipeNumber Number
highlight def link recipeBraces Operator
highlight def link recipeComment Comment
let b:current_syntax = 'recipe'
let &cpo = s:save_cpo
unlet s:save_cpo
|
Added .vim/bundle/neobundle.vim/test/readme.md.
> > > > | 1 2 3 4 |
To execute neobundle test:
cd # {neobundle.vim path}
vim -u test/vimrc -U NONE --noplugin
|
Added .vim/bundle/neobundle.vim/test/vimrc.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
if has('vim_starting')
set nocompatible " recommend
execute 'set' 'runtimepath+='.getcwd()
endif
let testdir = expand('~/neobundle-test/bundles', 1)
call neobundle#rc(expand(testdir, 1))
let g:neobundle#types#git#default_protocol = 'https'
" My Bundles here:
"
" Original repositories in github.
NeoBundle 'Shougo/neocomplcache-clang.git'
" Omit suffix.
NeoBundle 'Shougo/vimshell'
" Vim-script repositories.
NeoBundle 'rails.vim'
" Non-github repos.
NeoBundle 'git://git.wincent.com/command-t.git'
" Username with dashes.
NeoBundle 'vim-scripts/ragtag.vim'
" Original repo.
NeoBundle 'altercation/vim-colors-solarized'
" With extension.
" Comment is allowed.
NeoBundle 'nelstrom/vim-mac-classic-theme.git' " Foo, Bar
" Invalid uri.
NeoBundle 'nonexistinguser/hogehoge.git'
" Full uri.
NeoBundle 'https://github.com/vim-scripts/vim-game-of-life'
NeoBundle 'git@github.com:gmarik/ingretu.git'
" Short uri.
NeoBundle 'gh:gmarik/snipmate.vim.git'
NeoBundle 'github:mattn/gist-vim.git'
" Camel case.
NeoBundle 'vim-scripts/RubySinatra'
" Non-git repos.
NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'
" With options.
NeoBundle 'git://github.com/Shougo/unite.vim.git', {'directory' : 'unite'}
NeoBundle 'Shougo/vimshell', '3787e5'
" Nosync repos.
NeoBundle 'muttator', {'type' : 'nosync', 'base' : '~/.vim/bundle'}
" Raw repos.
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ {'script_type' : 'plugin'}
" NeoBundleLocal test.
NeoBundleLocal ~/.vim/bundle/
" Depends repos.
NeoBundle 'Shougo/neocomplcache',
\ {'depends' : [
\ 'Shougo/neocomplcache-snippets-complete.git',
\ ['rstacruz/sparkup', {'rtp': 'vim'}],
\ ]}
NeoBundle 'Shougo/vimfiler',
\ { 'depends' : 'Shougo/unite.vim' }
" Build repos.
NeoBundle 'Shougo/vimproc', {
\ 'build' : {
\ 'windows' : 'echo "Sorry, cannot update vimproc binary file in Windows."',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'unix' : 'make -f make_unix.mak',
\ },
\ }
" Lazy load.
NeoBundleLazy 'c9s/perlomni.vim.git'
NeoBundleSource perlomni.vim
call neobundle#source(['CSApprox'])
NeoBundleLazy 'The-NERD-tree', {'augroup' : 'NERDTree'}
call neobundle#source(['The-NERD-tree'])
NeoBundleLazy 'masudaK/vim-python'
NeoBundleLazy 'klen/python-mode'
autocmd FileType python* NeoBundleSource python-mode
NeoBundleLazy 'Rip-Rip/clang_complete', {
\ 'autoload' : {
\ 'filetypes' : ['c', 'cpp'],
\ },
\ }
" script_type support.
NeoBundle 'bronzehedwick/impactjs-colorscheme', {'script_type' : 'colors'}
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ {'script_type' : 'plugin'}
filetype plugin indent on " required!
" Should not break helptags.
set wildignore+=doc
" Should not break clone.
set wildignore+=.git
set wildignore+=.git/*
set wildignore+=*/.git/*
" Fetch only.
NeoBundleFetch 'Shougo/neobundle.vim'
autocmd VimEnter * NeoBundleCheck
|
Added .vim/bundle/neobundle.vim/test/vimrc2.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
if has('vim_starting')
set nocompatible
execute 'set' 'runtimepath+='.getcwd()
endif
let testdir = expand('~/neobundle-test/bundles', 1)
let neobundle#types#git#default_protocol =
\ exists('$http_proxy') ? 'https' : 'git'
call neobundle#rc(expand(testdir, 1))
" Test dependencies.
" A
NeoBundleLazy 'Shougo/echodoc'
NeoBundle 'Shougo/unite-build', { 'depends' : 'Shougo/echodoc' }
echomsg neobundle#is_sourced('echodoc') == 1
echomsg neobundle#is_sourced('unite-build') == 1
" B
NeoBundle 'Shougo/unite-ssh', { 'depends' : 'Shougo/unite-sudo' }
NeoBundleLazy 'Shougo/unite-sudo'
echomsg neobundle#is_sourced('unite-ssh') == 1
echomsg neobundle#is_sourced('unite-sudo') == 1
" C
NeoBundleLazy 'Shougo/vimproc', { 'depends': 'Shougo/neocomplcache' }
NeoBundle 'Shougo/neocomplcache', 'ver.8'
echomsg neobundle#is_sourced('vimproc') == 0
echomsg neobundle#is_sourced('neocomplcache') == 1
" D
NeoBundleLazy 'Shougo/vimshell', { 'depends': 'Shougo/vinarise' }
NeoBundleLazy 'Shougo/vinarise'
echomsg neobundle#is_sourced('vimshell') == 0
echomsg neobundle#is_sourced('vinarise') == 0
NeoBundle 'Shougo/vimfiler', { 'depends' : 'foo/var' }
echomsg neobundle#config#check_not_exists(['vimfiler']) ==# ['var']
NeoBundleLazy 'Shougo/unite.vim', {
\ 'depends' : ['Shougo/unite-outline', 'basyura/TweetVim'],
\ 'autoload' : { 'commands' : 'Unite' } }
NeoBundleLazy 'Shougo/unite-outline', {
\ 'depends' : 'Shougo/unite.vim' }
echomsg neobundle#get('unite.vim').autoload.commands == 'Unite'
" Dependencies test.
NeoBundleLazy 'basyura/twibill.vim'
NeoBundleLazy 'yomi322/neco-tweetvim'
NeoBundleLazy 'rhysd/tweetvim-advanced-filter'
NeoBundleLazy 'rhysd/TweetVim', {
\ 'depends' :
\ ['basyura/twibill.vim',
\ 'tyru/open-browser.vim',
\ 'yomi322/neco-tweetvim',
\ 'rhysd/tweetvim-advanced-filter'],
\ 'autoload' : {
\ 'commands' :
\ ['TweetVimHomeTimeline',
\ 'TweetVimMentions',
\ 'TweetVimSay',
\ 'TweetVimUserTimeline']
\ }
\ }
" Law.
NeoBundle 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ {'script_type' : 'plugin', 'rev' : '0'}
" NeoBundleReinstall rsense.vim
NeoBundle 'http://www.vim.org/scripts/download_script.php?src_id=19619',
\ { 'type__filename' : 'python.vim', 'script_type' : 'syntax' }
" on_source Test.
NeoBundle 'hoge'
let bundle = neobundle#get('hoge')
function! bundle.hooks.on_source(bundle)
" Should ignore.
echomsg "hoge"
endfunction
unlet bundle
let s:bundle = neobundle#get("TweetVim")
function! s:bundle.hooks.on_source(bundle)
endfunction
unlet s:bundle
NeoBundle 'https://github.com/Shougo/neocomplcache/' " slash is added
filetype plugin indent on " required!
" Should not break helptags.
set wildignore+=doc
" Should not break clone.
set wildignore+=.git
set wildignore+=.git/*
set wildignore+=*/.git/*
autocmd VimEnter * NeoBundleCheck
|
Added .vim/bundle/neobundle.vim/test/vimrc3.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
" Sample installation test.
if has('vim_starting')
set nocompatible " Be iMproved
set runtimepath+=.
endif
call neobundle#rc(expand('~/test-bundle/'))
" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'
" Recommended to install
" After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
NeoBundle 'Shougo/vimproc'
" My Bundles here:
"
" Note: You don't set neobundle setting in .gvimrc!
" Original repos on github
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'Lokaltog/vim-easymotion'
NeoBundle 'rstacruz/sparkup', {'rtp': 'vim/'}
" vim-scripts repos
NeoBundle 'L9'
NeoBundle 'FuzzyFinder'
NeoBundle 'rails.vim'
" Non github repos
NeoBundle 'git://git.wincent.com/command-t.git'
" Non git repos
NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'
NeoBundle 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'
filetype plugin indent on " Required!
|
Added .vim/bundle/neobundle.vim/test/vimrc4.
> > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
" Recipe installation test.
if has('vim_starting')
set nocompatible " Be iMproved
set runtimepath+=.
endif
call neobundle#rc(expand('~/test-bundle/'))
" Let NeoBundle manage NeoBundle
NeoBundleFetch 'Shougo/neobundle.vim'
" Recommended to install
" After install, turn shell ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile
NeoBundle 'Shougo/vimproc'
" Use recipe.
NeoBundle 'Shougo/neobundle-vim-recipes'
NeoBundleRecipe 'vinarise'
NeoBundle 'Shougo/neocomplcache-snippets-complete',
\ { 'recipe' : 'neocomplcache-snippets-complete'}
filetype plugin indent on " Required!
|
Added .vim/bundle/neobundle.vim/vest/test-parse.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
scriptencoding utf-8
" Saving 'cpoptions' {{{
let s:save_cpo = &cpo
set cpo&vim
" }}}
Context types
let g:neobundle#types#git#default_protocol = 'git'
let g:neobundle#types#hg#default_protocol = 'https'
let g:neobundle#enable_name_conversion = 0
It parses github git repos
ShouldEqual neobundle#parser#path(
\ 'Shougo/neocomplcache-clang.git'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/Shougo/neocomplcache-clang.git',
\ 'name' : 'neocomplcache-clang'}
ShouldEqual neobundle#parser#path('Shougo/vimshell'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/Shougo/vimshell.git',
\ 'name' : 'vimshell'}
ShouldEqual neobundle#parser#path('rails.vim'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/vim-scripts/rails.vim.git',
\ 'name' : 'rails.vim'}
ShouldEqual neobundle#parser#path(
\ 'git://git.wincent.com/command-t.git'),
\ {'type' : 'git', 'uri' :
\ 'git://git.wincent.com/command-t.git',
\ 'name' : 'command-t'}
ShouldEqual neobundle#parser#path('vim-scripts/ragtag.vim'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/vim-scripts/ragtag.vim.git',
\ 'name' : 'ragtag.vim'}
ShouldEqual neobundle#parser#path(
\ 'https://github.com/vim-scripts/vim-game-of-life'),
\ {'type' : 'git', 'uri' :
\ 'https://github.com/vim-scripts/vim-game-of-life.git',
\ 'name' : 'vim-game-of-life'}
ShouldEqual neobundle#parser#path(
\ 'git@github.com:gmarik/ingretu.git'),
\ {'type' : 'git', 'uri' :
\ 'git@github.com:gmarik/ingretu.git',
\ 'name' : 'ingretu'}
ShouldEqual neobundle#parser#path(
\ 'gh:gmarik/snipmate.vim.git'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/gmarik/snipmate.vim.git',
\ 'name' : 'snipmate.vim'}
ShouldEqual neobundle#parser#path(
\ 'github:mattn/gist-vim.git'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol .
\ '://github.com/mattn/gist-vim.git',
\ 'name' : 'gist-vim'}
ShouldEqual neobundle#parser#path(
\ 'git@github.com:Shougo/neocomplcache.git'),
\ {'type' : 'git', 'uri' :
\ 'git@github.com:Shougo/neocomplcache.git',
\ 'name' : 'neocomplcache'}
ShouldEqual neobundle#parser#path(
\ 'git://git.wincent.com/command-t.git'),
\ {'type' : 'git', 'uri' :
\ 'git://git.wincent.com/command-t.git',
\ 'name' : 'command-t'}
ShouldEqual neobundle#parser#path(
\ 'https://github.com/Shougo/neocomplcache/'),
\ {'type' : 'git', 'uri' :
\ 'https://github.com/Shougo/neocomplcache.git',
\ 'name' : 'neocomplcache'}
End
It parse svn repos
ShouldEqual neobundle#parser#path(
\ 'http://svn.macports.org/repository/macports/contrib/mpvim/'),
\ {'type' : 'svn', 'uri' :
\ 'http://svn.macports.org/repository/macports/contrib/mpvim',
\ 'name' : 'mpvim'}
ShouldEqual neobundle#parser#path(
\ 'thinca/vim-localrc', {'type' : 'svn'}),
\ {'type' : 'svn', 'uri' :
\ 'https://github.com/thinca/vim-localrc/trunk',
\ 'name' : 'vim-localrc'}
End
It parses bitbucket hg repos
ShouldEqual neobundle#parser#path(
\ 'https://bitbucket.org/ns9tks/vim-fuzzyfinder'),
\ {'type' : 'hg', 'uri' :
\ 'https://bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'}
ShouldEqual neobundle#parser#path(
\ 'bitbucket://bitbucket.org/ns9tks/vim-fuzzyfinder'),
\ {'type' : 'hg', 'uri' :
\ g:neobundle#types#hg#default_protocol.
\ '://bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'}
ShouldEqual neobundle#parser#path(
\ 'bitbucket:ns9tks/vim-fuzzyfinder'),
\ {'type' : 'hg', 'uri' :
\ g:neobundle#types#hg#default_protocol.
\ '://bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'}
ShouldEqual neobundle#parser#path(
\ 'ns9tks/vim-fuzzyfinder', {'site': 'bitbucket'}),
\ {'type' : 'hg', 'uri' :
\ g:neobundle#types#hg#default_protocol.
\ '://bitbucket.org/ns9tks/vim-fuzzyfinder',
\ 'name' : 'vim-fuzzyfinder'}
let bundle = neobundle#parser#_init_bundle(
\ 'git://github.com/Shougo/neobundle.vim.git',
\ [{ 'type' : 'hg'}])
ShouldEqual bundle.name, 'neobundle.vim'
ShouldEqual bundle.type, 'hg'
ShouldEqual bundle.uri, 'git://github.com/Shougo/neobundle.vim.git'
End
It parses bitbucket git repos
ShouldEqual neobundle#parser#path(
\ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git'),
\ {'type' : 'git', 'uri' :
\ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ 'name' : 'vim-qt-syntax'}
ShouldEqual neobundle#parser#path(
\ 'git://bitbucket.org/kh3phr3n/vim-qt-syntax.git'),
\ {'type' : 'git', 'uri' :
\ 'git://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ 'name' : 'vim-qt-syntax'}
ShouldEqual neobundle#parser#path(
\ 'bitbucket:kh3phr3n/vim-qt-syntax.git'),
\ {'type' : 'git', 'uri' :
\ g:neobundle#types#git#default_protocol.
\ '://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ 'name' : 'vim-qt-syntax'}
End
It parses raw repos
let bundle = neobundle#parser#_init_bundle(
\ 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim',
\ [{ 'script_type' : 'plugin'}])
ShouldEqual bundle.name, 'rsense.vim'
ShouldEqual bundle.type, 'raw'
ShouldEqual bundle.uri,
\ 'https://raw.github.com/m2ym/rsense/master/etc/rsense.vim'
End
It parses default options.
let default_options_save = g:neobundle#default_options
let g:neobundle#default_options =
\ { 'rev' : {'type__update_style' : 'current'},
\ '_' : {'type' : 'hg'} }
let bundle = neobundle#parser#_init_bundle(
\ 'Shougo/neocomplcache', ['', 'rev', {}])
ShouldEqual bundle.type__update_style, 'current'
let bundle2 = neobundle#parser#_init_bundle(
\ 'Shougo/neocomplcache', [])
ShouldEqual bundle2.type, 'hg'
let g:neobundle#default_options = default_options_save
End
It parses ssh protocol.
let bundle = neobundle#parser#_init_bundle(
\ 'accountname/reponame', [{
\ 'site' : 'github', 'type' : 'git', 'type__protocol' : 'ssh' }])
ShouldEqual bundle.uri, 'git@github.com:accountname/reponame.git'
let bundle = neobundle#parser#_init_bundle(
\ 'accountname/reponame', [{
\ 'site' : 'bitbucket', 'type' : 'hg', 'type__protocol' : 'ssh' }])
ShouldEqual bundle.uri, 'ssh://hg@bitbucket.org/accountname/reponame'
let bundle = neobundle#parser#_init_bundle(
\ 'accountname/reponame.git', [{
\ 'site' : 'bitbucket', 'type' : 'git', 'type__protocol' : 'ssh' }])
ShouldEqual bundle.uri, 'git@bitbucket.org:accountname/reponame.git'
End
It fetches plugins.
let bundle = neobundle#parser#fetch(
\ string('accountname/reponame.git'))
ShouldEqual bundle.rtp, ''
End
It parses directory
let bundle = neobundle#parser#_init_bundle(
\ 'Shougo/neocomplcache', [])
ShouldEqual bundle.directory, 'neocomplcache'
let bundle = neobundle#parser#_init_bundle(
\ 'Shougo/neocomplcache', ['ver.3'])
ShouldEqual bundle.directory, 'neocomplcache_ver.3'
End
It parses function_prefix
ShouldEqual neobundle#parser#_function_prefix(
\ 'neobundle.vim'), 'neobundle'
ShouldEqual neobundle#parser#_function_prefix(
\ 'unite-tag'), 'unite#sources#tag'
ShouldEqual neobundle#parser#_function_prefix(
\ 'TweetVim'), 'tweetvim'
ShouldEqual neobundle#parser#_function_prefix(
\ 'vim-vcs'), 'vcs'
End
It tests name conversion.
let g:neobundle#enable_name_conversion = 1
let bundle = neobundle#parser#_init_bundle(
\ 'git://github.com/Shougo/neobundle.vim.git',
\ [{ 'type' : 'hg'}])
ShouldEqual bundle.name, 'neobundle'
let bundle = neobundle#parser#_init_bundle(
\ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ [{ 'type' : 'hg'}])
ShouldEqual bundle.name, 'qt-syntax'
let bundle = neobundle#parser#_init_bundle(
\ 'https://bitbucket.org/kh3phr3n/qt-syntax-vim.git',
\ [{ 'type' : 'hg'}])
ShouldEqual bundle.name, 'qt-syntax'
let bundle = neobundle#parser#_init_bundle(
\ 'https://bitbucket.org/kh3phr3n/vim-qt-syntax.git',
\ [{ 'name' : 'vim-qt-syntax'}])
ShouldEqual bundle.name, 'vim-qt-syntax'
let g:neobundle#enable_name_conversion = 0
End
End
Fin
" Restore 'cpoptions' {{{
let &cpo = s:save_cpo
" }}}
" vim:foldmethod=marker:fen:
|
Added .vim/bundle/neobundle.vim/vest/test-tsort.vim.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
scriptencoding utf-8
" Saving 'cpoptions' {{{
let s:save_cpo = &cpo
set cpo&vim
" }}}
function! s:comp_bundle(bundle1, bundle2)
return a:bundle1.name > a:bundle2.name
endfunction
function! s:clear_bundles(names)
for bundle in neobundle#config#search(a:names)
call neobundle#config#rm(bundle.path)
endfor
endfunction
function! s:rotate_bundle(bundles)
return a:bundles[1:-1]+a:bundles[0:0]
endfunction
Context tsort
It tsort no depends
" [a, b, c] => [a, b, c]
let neobundle_test_data = [{'name' : 'a'}, {'name' : 'b'}, {'name' : 'c'},]
ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_data
unlet! neobundle_test_data
End
It tsort normal
" a -> b -> c
" b -> d
" c
" [a, b, c] => [c, b, a]
let neobundle_test_data = [
\ {'name' : 'a', 'depends' : [
\ {'name' : 'b', 'depends' : [
\ {'name' : 'c'},
\ ]},
\ ]},
\ {'name' : 'b', 'skip' : 1, 'depends' : [
\ {'name' : 'd', 'skipped' : 1, },
\ ]},
\ {'name' : 'c', 'skip' : 1},
\ ]
ShouldEqual neobundle#config#tsort(neobundle_test_data), [
\ neobundle_test_data[0].depends[0].depends[0],
\ neobundle_test_data[0].depends[0],
\ neobundle_test_data[0],
\ ]
unlet! neobundle_test_data
" a -> c -> b
" a -> d
" b
" c
" [a, b, c] => [b, c, d, a]
let neobundle_test_data = [
\ {'name' : 'a', 'depends' : [
\ {'name' : 'c', 'depends' : [
\ {'name' : 'b'},
\ ]},
\ {'name' : 'd'},
\ ]},
\ {'name' : 'b', 'skip' : 1},
\ {'name' : 'c', 'skip' : 1},
\ ]
ShouldEqual neobundle#config#tsort(neobundle_test_data),
\ [
\ neobundle_test_data[0].depends[0].depends[0],
\ neobundle_test_data[0].depends[0],
\ neobundle_test_data[0].depends[1],
\ neobundle_test_data[0],
\ ]
unlet! neobundle_test_data
End
It tsort circular reference
" a -> b -> c -> a
" b
" c
" [a, b, c] => [c, b, a]
let neobundle_test_data = [
\ {'name' : 'a', 'depends' : [
\ {'name' : 'b', 'depends' : [
\ {'name' : 'c', 'depends' : [
\ {'name' : 'a', 'skip' : 1},
\ ]},
\ ]},
\ ]},
\ {'name' : 'b', 'skip' : 1},
\ {'name' : 'c', 'skip' : 1},
\ ]
ShouldEqual neobundle#config#tsort(neobundle_test_data),
\ [
\ neobundle_test_data[0].depends[0].depends[0],
\ neobundle_test_data[0].depends[0],
\ neobundle_test_data[0],
\ ]
unlet! neobundle_test_data
End
It tsort bundled no depends
NeoBundleLazy 'a/a'
NeoBundleLazy 'b/b'
NeoBundleLazy 'c/c'
let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
" [a, b, c] => [a, b, c]
ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_data
" [c, b, a] => [c, b, a]
call reverse(neobundle_test_data)
ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_data
unlet! neobundle_test_data
call s:clear_bundles(['a','b','c'])
End
It tsort bundled normal
NeoBundleLazy 'a/a'
NeoBundleLazy 'b/b', {'depends' : 'a/a'}
NeoBundleLazy 'c/c', {'depends' : 'b/b'}
let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
" [a, b, c] => [a, b, c]
ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_data
" [c, b, a] => [a, b, c]
ShouldEqual neobundle#config#tsort(reverse(copy(neobundle_test_data))), neobundle_test_data
unlet! neobundle_test_data
call s:clear_bundles(['a','b','c'])
NeoBundleLazy 'a/a', {'depends' : ['c/c', 'b/b']}
NeoBundleLazy 'b/b'
NeoBundleLazy 'c/c', {'depends' : 'b/b'}
let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
let neobundle_test_rotated = s:rotate_bundle(neobundle_test_data)
" [a, b, c] => [b, c, a]
ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_rotated
" [c, b, a] => [b, c, a]
ShouldEqual neobundle#config#tsort(reverse(copy(neobundle_test_data))), neobundle_test_rotated
unlet! neobundle_test_data neobundle_test_rotated
call s:clear_bundles(['a','b','c'])
End
It tsort bundled circular reference
NeoBundleLazy 'a/a', {'depends' : 'b/b'}
NeoBundleLazy 'b/b', {'depends' : 'c/c'}
NeoBundleLazy 'c/c', {'depends' : 'a/a'}
let neobundle_test_data = sort(filter(neobundle#config#get_neobundles(), "v:val.name =~# '^[abc]$'"), "s:comp_bundle")
" [a, b, c] => [c, b, a]
ShouldEqual neobundle#config#tsort(neobundle_test_data), reverse(copy(neobundle_test_data))
" [c, b, a] => [b, a, c]
call reverse(neobundle_test_data)
let neobundle_test_rotated = s:rotate_bundle(neobundle_test_data)
ShouldEqual neobundle#config#tsort(neobundle_test_data), neobundle_test_rotated
unlet! neobundle_test_data neobundle_test_rotated
call s:clear_bundles(['a','b','c'])
End
End
Fin
delfunction s:comp_bundle
delfunction s:clear_bundles
delfunction s:rotate_bundle
" Restore 'cpoptions' {{{
let &cpo = s:save_cpo
" }}}
|
Added .vimrc.