Skip to content

Commit

Permalink
feat(bundle#dein): update dein.vim
Browse files Browse the repository at this point in the history
  • Loading branch information
wsdjeg committed Jan 1, 2022
1 parent 5d74df0 commit 7c90584
Show file tree
Hide file tree
Showing 27 changed files with 1,883 additions and 878 deletions.
12 changes: 12 additions & 0 deletions bundle/dein.vim/.github/FUNDING.yml
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: Shougo # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 changes: 0 additions & 13 deletions bundle/dein.vim/.travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions bundle/dein.vim/Makefile
Expand Up @@ -4,21 +4,21 @@ export THEMIS_ARGS := -e -s --headless
export THEMIS_HOME := ./vim-themis


install: vim-themis
install:
pip install --upgrade -r test/requirements.txt

install-user: vim-themis
install-user:
pip install --user --upgrade -r test/requirements.txt

lint:
vint --version
vint autoload

test:
test: vim-themis
themis --version
themis test/

vim-themis:
git clone https://github.com/thinca/vim-themis vim-themis

.PHONY: install lint test
.PHONY: install install-user lint test
60 changes: 37 additions & 23 deletions bundle/dein.vim/README.md
@@ -1,6 +1,6 @@
# dein.vim

[![Join the chat at https://gitter.im/Shougo/dein.vim](https://badges.gitter.im/Shougo/dein.vim.svg)](https://gitter.im/Shougo/dein.vim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/Shougo/dein.vim.svg?branch=master)](https://travis-ci.org/Shougo/dein.vim)
[![Join the chat at https://gitter.im/Shougo/dein.vim](https://badges.gitter.im/Shougo/dein.vim.svg)](https://gitter.im/Shougo/dein.vim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Please read [help](doc/dein.txt) for details.

Expand All @@ -19,11 +19,12 @@ Dein.vim is a dark powered Vim/Neovim plugin manager.

## Requirements

- Vim 8.0 or above or NeoVim.
- "xcopy" command in $PATH (Windows)
- Vim 8.2 or above or NeoVim(0.5.0+).
- "xcopy" command in $PATH or Python3 interface (Windows)
- "git" command in $PATH (if you want to install github or vim.org plugins)

Note: If you use Vim 7.4, please use dein.vim ver.1.5 instead.
Note: If you use below Vim 8.2 or neovim 0.5, please use dein.vim ver.2.2
instead.

If you need vim-plug like install UI, you can use dein-ui.vim.
https://github.com/wsdjeg/dein-ui.vim
Expand Down Expand Up @@ -59,37 +60,50 @@ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
./installer.ps1 ~/.cache/dein
```

2. Edit your .vimrc like this.
2. Edit your .vimrc like in "Examples" section.

3. Open vim and install dein

```vim
:call dein#install()
```

## Examples

```vim
if &compatible
set nocompatible
set nocompatible " Be iMproved
endif
" Add the dein installation directory into runtimepath
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
if dein#load_state('~/.cache/dein')
call dein#begin('~/.cache/dein')
" Required:
" Add the dein installation directory into runtimepath
set runtimepath+={path to dein.vim directory}
call dein#add('~/.cache/dein/repos/github.com/Shougo/dein.vim')
call dein#add('Shougo/deoplete.nvim')
if !has('nvim')
call dein#add('roxma/nvim-yarp')
call dein#add('roxma/vim-hug-neovim-rpc')
endif
" Required:
call dein#begin({path to plugin base path directory})
call dein#end()
call dein#save_state()
" Let dein manage dein
call dein#add({path to dein.vim directory})
if !has('nvim')
call dein#add('roxma/nvim-yarp')
call dein#add('roxma/vim-hug-neovim-rpc')
endif
" Add or remove your plugins here like this:
"call dein#add('Shougo/neosnippet.vim')
"call dein#add('Shougo/neosnippet-snippets')
" Required:
call dein#end()
" Required:
filetype plugin indent on
syntax enable
```
3. Open vim and install dein

```vim
:call dein#install()
" If you want to install not installed plugins on startup.
"if dein#check_install()
" call dein#install()
"endif
```


Expand Down
113 changes: 19 additions & 94 deletions bundle/dein.vim/autoload/dein.vim
Expand Up @@ -4,104 +4,15 @@
" License: MIT license
"=============================================================================

function! dein#_init() abort
let g:dein#name = ''
let g:dein#plugin = {}
let g:dein#_cache_version = 150
let g:dein#_plugins = {}
let g:dein#_base_path = ''
let g:dein#_cache_path = ''
let g:dein#_runtime_path = ''
let g:dein#_hook_add = ''
let g:dein#_ftplugin = {}
let g:dein#_called_lua = {}
let g:dein#_off1 = ''
let g:dein#_off2 = ''
let g:dein#_vimrcs = []
let g:dein#_block_level = 0
let g:dein#_event_plugins = {}
let g:dein#_is_sudo = $SUDO_USER !=# '' && $USER !=# $SUDO_USER
\ && $HOME !=# expand('~'.$USER)
\ && $HOME ==# expand('~'.$SUDO_USER)
let g:dein#_progname = fnamemodify(v:progname, ':r')
let g:dein#_init_runtimepath = &runtimepath
let g:dein#_loaded_rplugins = v:false

if get(g:, 'dein#lazy_rplugins', v:false)
" Disable remote plugin loading
let g:loaded_remote_plugins = 1
endif

augroup dein
autocmd!
autocmd FuncUndefined *
\ if stridx(expand('<afile>'), 'remote#') != 0 |
\ call dein#autoload#_on_func(expand('<afile>')) |
\ endif
autocmd BufRead *? call dein#autoload#_on_default_event('BufRead')
autocmd BufNew,BufNewFile *? call dein#autoload#_on_default_event('BufNew')
autocmd VimEnter *? call dein#autoload#_on_default_event('VimEnter')
autocmd FileType *? call dein#autoload#_on_default_event('FileType')
autocmd BufWritePost *.vim,*.toml,vimrc,.vimrc
\ call dein#util#_check_vimrcs()
augroup END
augroup dein-events | augroup END

if !exists('##CmdUndefined') | return | endif
autocmd dein CmdUndefined *
\ call dein#autoload#_on_pre_cmd(expand('<afile>'))
if has('nvim-0.5')
lua <<END
table.insert(package.loaders, 1, (function()
return function(mod_name)
vim.fn['dein#autoload#_on_lua'](mod_name)
return nil
end
end)())
END
endif
endfunction
function! dein#load_cache_raw(vimrcs) abort
let g:dein#_vimrcs = a:vimrcs
let cache = get(g:, 'dein#cache_directory', g:dein#_base_path)
\ .'/cache_' . g:dein#_progname
let time = getftime(cache)
if !empty(filter(map(copy(g:dein#_vimrcs),
\ 'getftime(expand(v:val))'), 'time < v:val'))
return [{}, {}]
endif
let list = readfile(cache)
if len(list) != 3 || string(g:dein#_vimrcs) !=# list[0]
return [{}, {}]
endif
return [json_decode(list[1]), json_decode(list[2])]
return dein#min#_load_cache_raw(a:vimrcs)
endfunction
function! dein#load_state(path, ...) abort
if !exists('#dein')
call dein#_init()
endif
let sourced = a:0 > 0 ? a:1 : has('vim_starting') &&
\ (!exists('&loadplugins') || &loadplugins)
if (g:dein#_is_sudo || !sourced) | return 1 | endif
let g:dein#_base_path = expand(a:path)

let state = get(g:, 'dein#cache_directory', g:dein#_base_path)
\ . '/state_' . g:dein#_progname . '.vim'
if !filereadable(state) | return 1 | endif
try
execute 'source' fnameescape(state)
catch
if v:exception !=# 'Cache loading error'
call dein#util#_error('Loading state error: ' . v:exception)
endif
call dein#clear_state()
return 1
endtry
return call('dein#min#load_state', [a:path] + a:000)
endfunction

function! dein#tap(name) abort
if !has_key(g:dein#_plugins, a:name)
\ || !isdirectory(g:dein#_plugins[a:name].path) | return 0 | endif
if !dein#is_available(a:name) | return 0 | endif
let g:dein#name = a:name
let g:dein#plugin = g:dein#_plugins[a:name]
return 1
Expand All @@ -111,6 +22,15 @@ function! dein#is_sourced(name) abort
\ && isdirectory(g:dein#_plugins[a:name].path)
\ && g:dein#_plugins[a:name].sourced
endfunction
function! dein#is_available(names) abort
for name in type(a:names) ==# v:t_list ? a:names : [a:names]
if !has_key(g:dein#_plugins, name) | return 0 | endif
let plugin = g:dein#_plugins[name]
if !isdirectory(plugin.path)
\ || (has_key(plugin, 'if') && !eval(plugin.if)) | return 0 | endif
endfor
return 1
endfunction
function! dein#begin(path, ...) abort
return dein#util#_begin(a:path, (empty(a:000) ? [] : a:1))
endfunction
Expand Down Expand Up @@ -209,7 +129,7 @@ endfunction
function! dein#config(arg, ...) abort
return type(a:arg) != v:t_list ?
\ dein#util#_config(a:arg, get(a:000, 0, {})) :
\ map(copy(a:arg), 'dein#util#_config(v:val, a:1)')
\ map(copy(a:arg), { _, val -> dein#util#_config(val, a:1) })
endfunction
function! dein#set_hook(plugins, hook_name, hook) abort
return dein#util#_set_hook(a:plugins, a:hook_name, a:hook)
Expand All @@ -218,5 +138,10 @@ function! dein#save_state() abort
return dein#util#_save_state(has('vim_starting'))
endfunction
function! dein#clear_state() abort
return dein#util#_clear_state()
call dein#util#_clear_state()

if !get(g:, 'dein#auto_recache', v:false) && !empty(g:dein#_ftplugin)
call dein#util#_notify(
\ 'call dein#recache_runtimepath() is needed for ftplugin feature')
endif
endfunction

0 comments on commit 7c90584

Please sign in to comment.