<commit_before>"=============================================================================
" FILE: neobundle.vim
" AUTHOR:  <NAME> <Shougo.Matsu at gmail.com>
" Last Modified: 18 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.
" }}}
" Version: 2.1, for Vim 7.2
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

if v:version < 702
  echoerr 'neobundle does not work this version of Vim (' . v:version . ').'
  finish
endif

let g:neobundle_default_git_protocol =
      \ get(g:, 'neobundle_default_git_protocol', 'git')

let s:neobundle_dir = get(
      \ filter(split(globpath(&runtimepath, 'bundle', 1), '\n'),
      \ 'isdirectory(v:val)'), 0, '~/.vim/bundle')

command! -nargs=+ NeoBundle
      \ call neobundle#config#bundle(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))

command! -nargs=+
      \ -complete=customlist,neobundle#complete_lazy_bundles
      \ NeoBundleLazy
      \ call neobundle#config#lazy_bundle(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))
command! -nargs=+ NeoExternalBundle NeoBundleLazy <args>

command! -nargs=1 NeoBundleLocal
      \ call s:neobundle_local(<q-args>)

command! -nargs=* -bar
      \ -complete=customlist,neobundle#complete_lazy_bundles
      \ NeoBundleSource
      \ call neobundle#config#source(<f-args>)

command! -nargs=? -bang -bar
      \ -complete=customlist,neobundle#complete_bundles
      \ NeoBundleInstall
      \ call neobundle#installer#install('!' == '<bang>', <q-args>)
command! -nargs=? -bar
      \ -complete=customlist,neobundle#complete_bundles
      \ NeoBundleUpdate
      \ call neobundle#installer#install(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
      \ NeoBundleList
      \ echo join(map(neobundle#config#get_neobundles(), 'v:val.name'), "\n")

command! -nargs=0 -bar
      \ NeoBundleDocs
      \ call neobundle#installer#helptags(neobundle#config#get_neobundles())

command! -nargs=0 -bar
      \ NeoBundleLog
      \ echo join(neobundle#installer#get_log(), "\n")

augroup neobundle
  autocmd!
  autocmd Syntax  vim syntax keyword vimCommand NeoBundle
augroup END

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))
  call neobundle#config#init()
endfunction

function! neobundle#get_neobundle_dir()
  return s:neobundle_dir
endfunction

function! neobundle#source(bundle_names)
  return call('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(v:val, 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.name'),
        \ 'stridx(v:val, 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(), '*')), "\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! s:neobundle_local(localdir)
  for dir in map(split(glob(neobundle#util#expand(a:localdir)
        \ . '/*'), '\n'), "fnamemodify(v:val, ':t')")
    call neobundle#config#bundle([dir,
          \ { 'type' : 'nosync', 'base' : a:localdir, }])
  endfor
endfunction

function! neobundle#exists_not_installed_bundles(...)
  return !empty(call('s:get_not_installed_bundles', a:000))
endfunction

function! s:get_not_installed_bundles(...)
  let bundle_names = get(a:000, 0, [])
  let bundles = empty(bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#search(bundle_names)

  return filter(copy(bundles),
        \ "!isdirectory(neobundle#util#expand(v:val.path))")
endfunction

function! neobundle#get_not_installed_bundle_names(...)
  return map(call('s:get_not_installed_bundles', a:000), 'v:val.name')
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo

<commit_msg>- Fixed installation errors.<commit_after>"=============================================================================
" FILE: neobundle.vim
" AUTHOR:  <NAME> <Shougo.Matsu at gmail.com>
" Last Modified: 18 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.
" }}}
" Version: 2.1, for Vim 7.2
"=============================================================================

let s:save_cpo = &cpo
set cpo&vim

if v:version < 702
  echoerr 'neobundle does not work this version of Vim (' . v:version . ').'
  finish
endif

let g:neobundle_default_git_protocol =
      \ get(g:, 'neobundle_default_git_protocol', 'git')

let s:neobundle_dir = get(
      \ filter(split(globpath(&runtimepath, 'bundle', 1), '\n'),
      \ 'isdirectory(v:val)'), 0, '~/.vim/bundle')

command! -nargs=+ NeoBundle
      \ call neobundle#config#bundle(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))

command! -nargs=+
      \ -complete=customlist,neobundle#complete_lazy_bundles
      \ NeoBundleLazy
      \ call neobundle#config#lazy_bundle(
      \   substitute(<q-args>, '\s"[^"]\+$', '', ''))
command! -nargs=+ NeoExternalBundle NeoBundleLazy <args>

command! -nargs=1 NeoBundleLocal
      \ call s:neobundle_local(<q-args>)

command! -nargs=* -bar
      \ -complete=customlist,neobundle#complete_lazy_bundles
      \ NeoBundleSource
      \ call neobundle#config#source(<f-args>)

command! -nargs=? -bang -bar
      \ -complete=customlist,neobundle#complete_bundles
      \ NeoBundleInstall
      \ call neobundle#installer#install('!' == '<bang>', <q-args>)
command! -nargs=? -bar
      \ -complete=customlist,neobundle#complete_bundles
      \ NeoBundleUpdate
      \ call neobundle#installer#install(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
      \ NeoBundleList
      \ echo join(map(neobundle#config#get_neobundles(), 'v:val.name'), "\n")

command! -nargs=0 -bar
      \ NeoBundleDocs
      \ call neobundle#installer#helptags(neobundle#config#get_neobundles())

command! -nargs=0 -bar
      \ NeoBundleLog
      \ echo join(neobundle#installer#get_log(), "\n")

augroup neobundle
  autocmd!
  autocmd Syntax  vim syntax keyword vimCommand NeoBundle
augroup END

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))
  call neobundle#config#init()
endfunction

function! neobundle#get_neobundle_dir()
  return s:neobundle_dir
endfunction

function! neobundle#source(bundle_names)
  return call('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(v:val, 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.name'),
        \ 'stridx(v:val, 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(), '*')), "\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! s:neobundle_local(localdir)
  for dir in map(split(glob(neobundle#util#expand(a:localdir)
        \ . '/*'), '\n'), "fnamemodify(v:val, ':t')")
    call neobundle#config#bundle([dir,
          \ { 'type' : 'nosync', 'base' : a:localdir, }])
  endfor
endfunction

function! neobundle#exists_not_installed_bundles(...)
  return !empty(call('neobundle#get_not_installed_bundles', a:000))
endfunction

function! neobundle#get_not_installed_bundles(...)
  let bundle_names = get(a:000, 0, [])
  let bundles = empty(bundle_names) ?
        \ neobundle#config#get_neobundles() :
        \ neobundle#config#search(bundle_names)

  return filter(copy(bundles),
        \ "!isdirectory(neobundle#util#expand(v:val.path))")
endfunction

function! neobundle#get_not_installed_bundle_names(...)
  return map(call('neobundle#get_not_installed_bundles', a:000), 'v:val.name')
endfunction

let &cpo = s:save_cpo
unlet s:save_cpo


{'fraction_non_alphanumeric': 0.15526154385350038, 'fraction_numerical': 0.006308595461316043, 'mean_word_length': 4.250229990800368, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5733965', 'n_tokens_mistral': 4001, 'n_tokens_neox': 3815, 'n_words': 881}