1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 07:10:06 +08:00

feat(github): enable github action

This commit is contained in:
Eric Wong 2024-07-08 17:45:42 +08:00
parent ab666f13f1
commit 13fe60ed2e
26 changed files with 1566 additions and 18 deletions

5
.ci/bootstrap Normal file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# usage: script/bootstrap
#
cd docs && bundle install

6
.ci/build-production Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# usage: script/build-production
#
# Run the jekyll build
cd docs && bundle exec jekyll build

View File

@ -0,0 +1,75 @@
exe 'set nocp'
set rtp+=/build/GitHub.vim
set rtp+=/API
so /build/GitHub.vim/plugin/github.vim
let s:LIST = SpaceVim#api#import('data#list')
let s:log = filereadable('build_log') ? system('cat build_log') : ''
let g:githubapi_verbose = 1
function! s:update_log(log, summary, new_log) abort
let log = split(a:log, "\n")
let begin = -1
let end = -1
for i in range(len(log))
if log[i] =~ a:summary
let begin = i
endif
if begin != -1 && log[i] ==# '</details>'
let end = i
endif
endfor
if begin != -1 && end != -1
return s:LIST.replace(log, begin, end, split(a:new_log, "\n"))
else
return a:log . "\n" . a:new_log
endif
endfunction
if !empty(s:log)
if $LINT ==# 'vader'
let s:summary = $VIM . ' ' . $LINT . ' build log'
else
let s:summary = $LINT . ' build log'
endif
let s:log = '<details><summary>' . s:summary . "</summary>\n" . s:log . "\n</details>"
let s:comments = github#api#issues#List_comments('SpaceVim', 'SpaceVim',$TRAVIS_PULL_REQUEST ,'')
if empty(s:comments)
call github#api#issues#Create_comment('SpaceVim','SpaceVim', $TRAVIS_PULL_REQUEST, {'body': s:log}, 'SpaceVimBot', $BOTSECRET)
else
let s:nr = 0
for s:comment in s:comments
if s:comment.user.login ==# 'SpaceVimBot'
let s:nr = s:comment.id
break
endif
endfor
if s:nr == 0
call github#api#issues#Create_comment('SpaceVim','SpaceVim', $TRAVIS_PULL_REQUEST, {'body': s:log}, 'SpaceVimBot', $BOTSECRET)
else
call github#api#issues#Edit_comment('SpaceVim','SpaceVim', s:nr,
\ {'body': s:update_log(s:comment.body, s:summary, s:log)}, 'SpaceVimBot', $BOTSECRET)
endif
endif
else
if $LINT ==# 'vader'
let s:summary = $VIM . ' ' . $LINT . ' build log'
else
let s:summary = $LINT . ' build log'
endif
let s:log = '<details><summary>' . s:summary . "</summary>\n" . s:log . "\n</details>"
let s:comments = github#api#issues#List_comments('SpaceVim', 'SpaceVim',$TRAVIS_PULL_REQUEST ,'')
if !empty(s:comments)
let s:nr = 0
for s:comment in s:comments
if s:comment.user.login ==# 'SpaceVimBot'
let s:nr = s:comment.id
break
endif
endfor
if s:nr != 0
call github#api#issues#Edit_comment('SpaceVim','SpaceVim', s:nr,
\ {'body': s:update_log(s:comment.body, s:summary, s:log)}, 'SpaceVimBot', $BOTSECRET)
endif
endif
endif
echom v:shell_error
quit

455
.ci/detach_plugin.sh Normal file
View File

@ -0,0 +1,455 @@
#!/usr/bin/env bash
_detact () {
cp -f ../../$1 $1
}
_detact_bundle () {
cp -f ../../bundle/$1/$2 $2
}
_checkdir () {
if [[ ! -d "$1" ]]; then
mkdir -p $1
fi
}
_default_readme () {
cat <<EOT > README.md
# $1
> $2
This plugin is automatically detach from [SpaceVim](https://github.com/SpaceVim/SpaceVim/). you can use it without SpaceVim.
EOT
}
main () {
case "$1" in
flygrep)
git clone https://github.com/wsdjeg/FlyGrep.vim.git detach/$1
cd detach/$1
_checkdir syntax/
_checkdir autoload/SpaceVim/api
_checkdir autoload/SpaceVim/api/vim
_checkdir autoload/SpaceVim/api/neovim
_checkdir autoload/SpaceVim/api/data
_checkdir autoload/SpaceVim/mapping
_checkdir autoload/SpaceVim/plugins
_detact autoload/SpaceVim/plugins/flygrep.vim
_detact autoload/SpaceVim/api.vim
_detact autoload/SpaceVim/api/logger.vim
_detact autoload/SpaceVim/api/vim/buffer.vim
_detact autoload/SpaceVim/api/vim/regex.vim
_detact autoload/SpaceVim/api/vim/compatible.vim
_detact autoload/SpaceVim/api/vim/floating.vim
_detact autoload/SpaceVim/api/vim/highlight.vim
_detact autoload/SpaceVim/api/vim/statusline.vim
_detact autoload/SpaceVim/api/vim/window.vim
_detact autoload/SpaceVim/api/neovim/floating.vim
_detact autoload/SpaceVim/api/data/dict.vim
_detact autoload/SpaceVim/api/data/list.vim
_detact autoload/SpaceVim/api/data/json.vim
_detact autoload/SpaceVim/api/data/string.vim
_detact autoload/SpaceVim/api/prompt.vim
_detact autoload/SpaceVim/api/job.vim
_detact autoload/SpaceVim/api/vim.vim
_detact autoload/SpaceVim/api/file.vim
_detact autoload/SpaceVim/api/system.vim
_detact autoload/SpaceVim/api/time.vim
_detact autoload/SpaceVim/mapping/search.vim
_detact autoload/SpaceVim/logger.vim
# detach lua version flygrep
_checkdir lua/spacevim/api
_checkdir lua/spacevim/api/vim
_checkdir lua/spacevim/plugin
_detact lua/spacevim/plugin/flygrep.lua
_detact lua/spacevim/plugin/search.lua
_detact lua/spacevim.lua
_detact lua/spacevim/logger.lua
_detact lua/spacevim/api.lua
_detact lua/spacevim/api/logger.lua
_detact lua/spacevim/api/prompt.lua
_detact lua/spacevim/api/notify.lua
_detact lua/spacevim/api/password.lua
_detact lua/spacevim/api/vim.lua
_detact lua/spacevim/api/system.lua
_detact lua/spacevim/api/vim/compatible.lua
_detact lua/spacevim/api/vim/highlight.lua
_detact lua/spacevim/api/vim/regex.lua
_detact lua/spacevim/api/vim/keys.lua
_detact lua/spacevim/api/vim/buffer.lua
_detact lua/spacevim/api/vim/window.lua
_detact lua/spacevim/api/vim/statusline.lua
# detach syntax/ftplugin etc
_detact syntax/SpaceVimFlyGrep.vim
# detach bundle
_checkdir plugin
_detact_bundle FlyGrep plugin/FlyGrep.vim
_detact_bundle FlyGrep README.md
_detact_bundle FlyGrep addon-info.json
_checkdir doc/
_detact_bundle FlyGrep doc/FlyGrep.txt
# detach LICENSE
_detact LICENSE
# detach test vimrc
_checkdir test
_detact_bundle FlyGrep test/vimrc
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_flygrep https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/FlyGrep.vim.git
git push wsdjeg_flygrep master
cd -
rm -rf detach/$1
exit 0
;;
dein-ui)
git clone https://github.com/wsdjeg/dein-ui.vim.git detach/$1
cd detach/$1
_checkdir syntax/
_checkdir autoload/SpaceVim/api
_checkdir autoload/SpaceVim/api/data
_checkdir autoload/SpaceVim/api/vim
_checkdir autoload/SpaceVim/mapping
_checkdir autoload/SpaceVim/plugins
_detact autoload/SpaceVim/plugins/manager.vim
_detact autoload/SpaceVim/api.vim
_detact autoload/SpaceVim/commands.vim
_detact autoload/SpaceVim/logger.vim
_detact autoload/SpaceVim/api/job.vim
_detact autoload/SpaceVim/api/system.vim
_detact autoload/SpaceVim/api/data/list.vim
_detact autoload/SpaceVim/api/vim/compatible.vim
_detact syntax/SpaceVimPlugManager.vim
_detact LICENSE
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_dein_ui https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/dein-ui.vim.git
git push wsdjeg_dein_ui master
cd -
rm -rf detach/$1
exit 0
;;
iedit)
git clone https://github.com/wsdjeg/iedit.vim.git detach/$1
cd detach/$1
_checkdir autoload/SpaceVim/api/vim
_checkdir autoload/SpaceVim/api/data
_checkdir autoload/SpaceVim/plugins
_detact autoload/SpaceVim/api.vim
_detact autoload/SpaceVim/api/vim/compatible.vim
_detact autoload/SpaceVim/api/vim/highlight.vim
_detact autoload/SpaceVim/api/data/string.vim
_detact autoload/SpaceVim/plugins/iedit.vim
_checkdir autoload/plugin
cat <<EOT > autoload/plugin/iedit.vim
"=============================================================================
" iedit.vim --- multiple cursor support for neovim and vim
" Copyright (c) 2016-2022 Shidong Wang & Contributors
" Author: Shidong Wang < wsdjeg@outlook.com >
" URL: https://github.com/wsdjeg/iedit.vim
" License: MIT license
"=============================================================================
""
" @section Introduction, intro
" @stylized iedit.vim
" @library
" @order intro version dicts functions exceptions layers api faq
" multiple cursor in vim, written in pure vim script for MacVim, gvim and vim version
" 8.0+.
"
command! -nargs=0 Iedit call SpaceVim#plugins#iedit#start()
EOT
_detact LICENSE
_default_readme "iedit.vim" "multiple cussor support for Vim/Neovim"
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update"
git remote add wsdjeg_vim_todo https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/iedit.vim.git
git push wsdjeg_vim_todo master
cd -
rm -rf detach/$1
exit 0
;;
vim-todo)
git clone https://github.com/wsdjeg/vim-todo.git detach/$1
cd detach/$1
_checkdir syntax/
_detact syntax/SpaceVimTodoManager.vim
_checkdir autoload/SpaceVim/api/vim
_checkdir autoload/SpaceVim/api/data
_checkdir autoload/SpaceVim/plugins
_checkdir autoload/SpaceVim/mapping
_detact autoload/SpaceVim/api.vim
_detact autoload/SpaceVim/api/logger.vim
_detact autoload/SpaceVim/api/job.vim
_detact autoload/SpaceVim/api/system.vim
_detact autoload/SpaceVim/api/data/string.vim
_detact autoload/SpaceVim/api/file.vim
_detact autoload/SpaceVim/api/vim/buffer.vim
_detact autoload/SpaceVim/api/vim/regex.vim
_detact autoload/SpaceVim/api/vim/compatible.vim
_detact autoload/SpaceVim/logger.vim
_detact autoload/SpaceVim/mapping/search.vim
_detact autoload/SpaceVim/plugins/todo.vim
_checkdir plugin
cat <<EOT > plugin/todo.vim
"=============================================================================
" todo.vim --- todo manager for SpaceVim
" Copyright (c) 2016-2023 Wang Shidong & Contributors
" Author: Wang Shidong < wsdjeg@outlook.com >
" URL: https://spacevim.org
" License: GPLv3
"=============================================================================
command! OpenTodo call todo#open()
EOT
_detact LICENSE
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update"
git remote add wsdjeg_vim_todo https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/vim-todo.git
git push wsdjeg_vim_todo master
cd -
rm -rf detach/$1
exit 0
;;
vim-chat)
git clone https://github.com/wsdjeg/vim-chat.git detach/$1
cd detach/$1
_detact LICENSE
_checkdir autoload/SpaceVim/api
_detact autoload/SpaceVim/api.vim
_detact autoload/SpaceVim/api/job.vim
_checkdir autoload/chat/
_detact_bundle vim-chat autoload/chat.vim
_detact_bundle vim-chat autoload/chat/gitter.vim
_detact_bundle vim-chat autoload/chat/logger.vim
_detact_bundle vim-chat autoload/chat/notify.vim
_detact_bundle vim-chat autoload/chat/qq.vim
_detact_bundle vim-chat autoload/chat/weixin.vim
_checkdir doc/
_detact_bundle vim-chat doc/vim-chat.txt
_checkdir syntax/
_detact_bundle vim-chat syntax/vimchat.vim
_detact_bundle vim-chat addon-info.json
_detact_bundle vim-chat README.md
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_vim_chat https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/vim-chat.git
git push wsdjeg_vim_chat master
cd -
rm -rf detach/$1
exit 0
;;
JavaUnit.vim)
git clone https://github.com/wsdjeg/JavaUnit.vim.git detach/$1
cd detach/$1
# _detact LICENSE
# _checkdir autoload/SpaceVim/api
# _detact autoload/SpaceVim/api.vim
# _detact autoload/SpaceVim/api/job.vim
# _checkdir autoload/chat/
_detact_bundle JavaUnit.vim README.md
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_javaunit_vim https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/JavaUnit.vim.git
git push wsdjeg_javaunit_vim master
cd -
rm -rf detach/$1
exit 0
;;
git.vim)
git clone https://github.com/wsdjeg/git.vim.git detach/$1
cd detach/$1
_checkdir autoload/SpaceVim/api
_detact autoload/SpaceVim/api.vim
_detact autoload/SpaceVim/api/job.vim
_detact_bundle git.vim LICENSE
_detact_bundle git.vim README.md
_detact_bundle git.vim addon-info.json
_checkdir autoload/git/branch
_detact_bundle git.vim autoload/git.vim
_detact_bundle git.vim autoload/git/add.vim
_detact_bundle git.vim autoload/git/blame.vim
_detact_bundle git.vim autoload/git/branch.vim
_detact_bundle git.vim autoload/git/branch/manager.vim
_detact_bundle git.vim autoload/git/checkout.vim
_detact_bundle git.vim autoload/git/cherry_pick.vim
_detact_bundle git.vim autoload/git/clean.vim
_detact_bundle git.vim autoload/git/commit.vim
_detact_bundle git.vim autoload/git/config.vim
_detact_bundle git.vim autoload/git/diff.vim
_detact_bundle git.vim autoload/git/fetch.vim
_detact_bundle git.vim autoload/git/log.vim
_detact_bundle git.vim autoload/git/logger.vim
_detact_bundle git.vim autoload/git/merge.vim
_detact_bundle git.vim autoload/git/mv.vim
_detact_bundle git.vim autoload/git/pull.vim
_detact_bundle git.vim autoload/git/push.vim
_detact_bundle git.vim autoload/git/rebase.vim
_detact_bundle git.vim autoload/git/reflog.vim
_detact_bundle git.vim autoload/git/remote.vim
_detact_bundle git.vim autoload/git/reset.vim
_detact_bundle git.vim autoload/git/rm.vim
_detact_bundle git.vim autoload/git/stash.vim
_detact_bundle git.vim autoload/git/status.vim
_checkdir doc
_detact_bundle git.vim doc/git.txt
_checkdir plugin
_detact_bundle git.vim plugin/git.vim
_checkdir syntax
_detact_bundle git.vim syntax/git-blame.vim
_detact_bundle git.vim syntax/git-commit.vim
_detact_bundle git.vim syntax/git-config.vim
_detact_bundle git.vim syntax/git-log.vim
_detact_bundle git.vim syntax/git-rebase.vim
_detact_bundle git.vim syntax/git-reflog.vim
_checkdir test
_detact_bundle git.vim test/vimrc
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_git_vim https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/git.vim.git
git push wsdjeg_git_vim master
cd -
rm -rf detach/$1
exit 0
;;
vim-cheat)
git clone https://github.com/wsdjeg/vim-cheat.git detach/$1
cd detach/$1
_checkdir plugin/
_checkdir autoload/
_detact LICENSE
_detact_bundle vim-cheat autoload/cheat.vim
_detact_bundle vim-cheat plugin/cheat.vim
_detact_bundle vim-cheat README.md
_detact_bundle vim-cheat .travis.yml
_detact_bundle vim-cheat .vintrc.yaml
_checkdir doc/
_detact_bundle vim-cheat doc/vim-cheat.txt
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_vim_cheat https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/vim-cheat.git
git push wsdjeg_vim_cheat master
cd -
rm -rf detach/$1
exit 0
;;
xmake.vim)
git clone https://github.com/wsdjeg/xmake.vim.git detach/$1
cd detach/$1
_checkdir plugin/
_detact_bundle xmake.vim plugin/xmake.vim
_detact_bundle xmake.vim plugin/xmgen.py
_checkdir autoload/
_detact_bundle xmake.vim autoload/xmake.vim
_detact_bundle xmake.vim autoload/spy.lua
_detact LICENSE
_default_readme "xmake.vim" "xmake support for neovim/vim"
_checkdir autoload/xmake/
_detact_bundle xmake.vim autoload/xmake/log.vim
_checkdir doc/
_detact_bundle xmake.vim doc/xmake.txt
_checkdir UltiSnips/
_detact_bundle xmake.vim UltiSnips/lua.snippets
_checkdir rplugin/python3/deoplete/sources/docs/
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/xmake.py
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_defines
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_defines
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_deps
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_files
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_headers
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_includedirs
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_linkdirs
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_links
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/add_subdirs
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/is_os
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/is_plat
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_basename
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_headerdir
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_kind
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_languages
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_objectdir
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_optimize
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_project
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_strip
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_symbols
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_targetdir
_detact_bundle xmake.vim rplugin/python3/deoplete/sources/docs/set_warnings
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_xmake_vim https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/xmake.vim.git
git push wsdjeg_xmake_vim master
cd -
rm -rf detach/$1
exit 0
;;
scrollbar.vim)
git clone https://github.com/wsdjeg/scrollbar.vim.git detach/$1
cd detach/$1
_checkdir autoload/SpaceVim/api/
_checkdir autoload/SpaceVim/api/vim
_detact autoload/SpaceVim/api.vim
_detact autoload/SpaceVim/api/vim.vim
_detact autoload/SpaceVim/api/vim/buffer.vim
_detact autoload/SpaceVim/api/vim/window.vim
_checkdir autoload/SpaceVim/plugins/
_detact autoload/SpaceVim/plugins/scrollbar.vim
_detact LICENSE
_default_readme "scrollbar.vim" "floating scrollbar support for neovim/vim[wip]"
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_scrollbar https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/scrollbar.vim.git
git push wsdjeg_scrollbar master
cd -
rm -rf detach/$1
exit 0
;;
github.vim)
git clone https://github.com/wsdjeg/GitHub.vim.git detach/$1
cd detach/$1
_checkdir plugin/
_checkdir autoload/
_detact LICENSE
_detact_bundle github.vim autoload/github.vim
_detact_bundle github.vim plugin/github.vim
_default_readme "GitHub.vim" "GitHub API support for neovim/vim[wip]"
_checkdir doc/
_detact_bundle github doc/github.txt
git add .
git config user.email "wsdjeg@qq.com"
git config user.name "SpaceVimBot"
git commit -m "Auto Update based on https://github.com/SpaceVim/SpaceVim/commit/${GITHUB_SHA}"
git remote add wsdjeg_github_vim https://SpaceVimBot:${BOTSECRET}@github.com/wsdjeg/GitHub.vim.git
git push wsdjeg_github_vim master
cd -
rm -rf detach/$1
exit 0
;;
spacevim-theme)
exit 0
esac
}
main $@

64
.ci/install/linux.sh Normal file
View File

@ -0,0 +1,64 @@
#!/usr/bin/env bash
# Fail on unset variables and command errors
set -ue -o pipefail
# Prevent commands misbehaving due to locale differences
export LC_ALL=C
install_vim() {
local URL=https://github.com/vim/vim
local tag=$1
local ext=$([[ $tag == "nightly" ]] && echo "" || echo "-b $tag")
local tmp="$(mktemp -d)"
local out="${DEPS}/_vim/$tag"
mkdir -p $out
git clone --depth 1 --single-branch $ext $URL $tmp
cd $tmp
# Apply Vim patch v8.0.1635 to fix build with Python.
if grep -q _POSIX_THREADS src/if_python3.c; then
sed -i '/#ifdef _POSIX_THREADS/,+2 d' src/if_python3.c
fi
./configure \
--with-features=huge \
--enable-pythoninterp \
--enable-python3interp \
--enable-luainterp \
--prefix=${out}
make
make install
}
install_nvim() {
local URL=https://github.com/neovim/neovim
local tag=$1
local tmp="$(mktemp -d)"
local out="${DEPS}/_neovim/$tag"
mkdir -p $out
curl -o $tmp/nvim-linux64.tar.gz -L "https://github.com/neovim/neovim/releases/download/$tag/nvim-linux64.tar.gz"
tar -xzvf $tmp/nvim-linux64.tar.gz -C $tmp
cp -r $tmp/nvim-linux64/* $out
chmod +x $out/bin/nvim
# fix ModuleNotFoundError: No module named 'setuptools'
python3 -m pip install -U setuptools
python3 -m pip install pynvim
}
install() {
local vim=$1
local tag=$2
if [[ -d "${DEPS}/_$vim/$tag/bin" ]]; then
echo "Use a cached version '$HOME/_$vim/$tag'."
return
fi
if [[ $vim == "nvim" ]]; then
install_nvim $tag
else
install_vim $tag
fi
}
install $@

63
.ci/install/windows.ps1 Normal file
View File

@ -0,0 +1,63 @@
function install_vim($ver)
{
if ($ver -eq "nightly")
{
$url = 'https://github.com/vim/vim-win32-installer/releases/download/v8.2.3361/gvim_8.2.3361_x86.zip'
}
else
{
$ver = $ver -replace "^v", ""
$url = 'https://github.com/vim/vim-win32-installer/releases/download/v' + $ver + '/gvim_' + $ver + '_x86.zip'
}
$Env:VIM_BIN = $Env:DEPS + '\vim\vim82\vim.exe'
$zip = $Env:DEPS + '\vim.zip'
echo "download: $url"
echo "path: $zip"
(New-Object Net.WebClient).DownloadFile($url, $zip)
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null
[System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $Env:DEPS)
}
function install_nvim($ver)
{
if ($ver -eq "nightly")
{
$url = 'https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip'
}
else
{
$url = 'https://github.com/neovim/neovim/releases/download/' + $ver + '/nvim-win64.zip'
}
$zip = $Env:DEPS + '\nvim.zip'
(New-Object Net.WebClient).DownloadFile($url, $zip)
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null
[System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $Env:DEPS)
if (Test-Path '$DEPS\Neovim\bin\nvim.exe') {
$Env:VIM_BIN = $Env:DEPS + '\Neovim\bin\nvim.exe'
}else{
$Env:VIM_BIN = $Env:DEPS + '\nvim-win64\bin\nvim.exe'
}
echo "VIM_BIN is: $Env:VIM_BIN"
}
function download_lua()
{
$url = 'https://github.com/wsdjeg/vim-galore-zh_cn/releases/download/downdows/lua53.zip'
$zip = $Env:DEPS + '\lua53.zip'
(New-Object Net.WebClient).DownloadFile($url, $zip)
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') > $null
[System.IO.Compression.ZipFile]::ExtractToDirectory($zip, $Env:DEPS + '\vim\vim82')
}
if ($Env:VIM_BIN.StartsWith("nvim"))
{
mkdir $Env:DEPS
install_nvim $Env:VIM_TAG
}
elseif ($Env:VIM_BIN.StartsWith("vim"))
{
mkdir $Env:DEPS
install_vim $Env:VIM_TAG
download_lua
}

10
.ci/push_baidu.sh Normal file
View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
date_en=`cat docs/_site/sitemap.xml`
date_cn=`cat docs/_site/cn/sitemap.xml`
echo $date_en | grep -oP 'https://spacevim[^\<]*' > urls_en.txt
echo $date_cn | grep -oP 'https://spacevim[^\<]*' > urls_cn.txt
curl -H 'Content-Type:text/plain' --data-binary @urls_en.txt "http://data.zz.baidu.com/urls?site=spacevim.org&token=4MYgdYW7QHIaM01P"
curl -H 'Content-Type:text/plain' --data-binary @urls_cn.txt "http://data.zz.baidu.com/urls?site=spacevim.org&token=4MYgdYW7QHIaM01P"

89
.ci/script.sh Normal file
View File

@ -0,0 +1,89 @@
#!/usr/bin/env bash
set -ex
export TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}
if [ "$LINT" = "vimlint" ]; then
if [[ -f build_log ]]; then
rm build_log
fi
for file in $(git ls-files | grep SpaceVim.*.vim);
do
/tmp/vimlint/bin/vimlint.sh -l /tmp/vimlint -p /tmp/vimlparser $file >> build_log 2>&1;
done
if [[ -s build_log ]]; then
exit 2
fi
elif [ "$LINT" = "vimlint-errors" ]; then
if [[ -f build_log ]]; then
rm build_log
fi
for file in $(git ls-files | grep SpaceVim.*.vim);
do
/tmp/vimlint/bin/vimlint.sh -E -l /tmp/vimlint -p /tmp/vimlparser $file >> build_log 2>&1;
done
if [[ -s build_log ]]; then
exit 2
fi
elif [ "$LINT" = "file-encoding" ]; then
if [[ -f build_log ]]; then
rm build_log
fi
for file in $(git diff --name-only HEAD master);
do
# get the encoding of a file, based on:
# https://superuser.com/a/351658/618193
# It should be -b instead of -bi
encoding=`file -b --mime-encoding $file`
if [ $encoding != "utf-8" ] && [ $encoding != "us-ascii" ];
then
echo $file " " $encoding >> build_log
fi
done
if [[ -s build_log ]]; then
exit 2
fi
elif [ "$LINT" = "vint" ]; then
if [[ -f build_log ]]; then
rm build_log
fi
for file in $(git ls-files | grep SpaceVim.*.vim);
do
vint --enable-neovim $file >> build_log 2>&1;
done
if [[ -s build_log ]]; then
exit 2
fi
elif [ "$LINT" = "vint-errors" ]; then
if [[ -f build_log ]]; then
rm build_log
fi
for file in $(git ls-files | grep SpaceVim.*.vim);
do
vint --enable-neovim --error $file >> build_log 2>&1;
done
if [[ -s build_log ]]; then
exit 2
fi
elif [ "$LINT" = "vader" ]; then
if [ "$VIM_BIN" = "nvim" ]; then
export PATH="${DEPS}/_neovim/${VIM_TAG}/bin:${PATH}"
export VIM="${DEPS}/_neovim/${VIM_TAG}/share/nvim/runtime"
else
export PATH="${DEPS}/_vim/${VIM_TAG}/bin:${PATH}"
export VIM="${DEPS}/_vim/${VIM_TAG}/share/vim"
fi
echo "\$PATH: \"${PATH}\""
echo "\$VIM: \"${VIM}\""
echo "================= ${VIM_BIN} version ======================"
$VIM_BIN --version
pip install covimerage
pip install codecov
python -c 'import os,sys,fcntl; flags = fcntl.fcntl(sys.stdout, fcntl.F_GETFL); fcntl.fcntl(sys.stdout, fcntl.F_SETFL, flags&~os.O_NONBLOCK);'
make test_coverage
covimerage -vv xml --omit 'build/*'
codecov -X search gcov pycov -f coverage.xml
elif [ "$LINT" = "jekyll" ]; then
.ci/build-production
fi
set +x

46
.ci/update_mirror.sh Normal file
View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
usage () {
echo ".ci/update_remote.sh [option] [target]"
}
push_gitee()
{
git remote add gitee https://SpaceVimBot:${BOTSECRET}@gitee.com/spacevim/SpaceVim.git
git push gitee master -f
}
push_gitlab()
{
git remote add gitlab https://SpaceVimBot:${BOTSECRET}@gitlab.com/SpaceVim/SpaceVim.git
git push gitlab master -f
}
push_coding()
{
git remote add coding https://spacevim%40outlook.com:${CODINGBOTSECRET}@e.coding.net/spacevim/SpaceVim.git
git push coding master -f
}
main () {
case $1 in
--help|-h)
usage
exit 0
;;
gitee)
push_gitee
exit 0
;;
gitlab)
push_gitlab
exit 0
;;
coding)
push_coding
exit 0
;;
esac
}
main $@

22
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1,22 @@
# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @wsdjeg will be requested for review when someone opens a
# pull request.
# Just watching this repo, disable duplicate message
# * @wsdjeg
# lang#julia layer
autoload/SpaceVim/layers/lang/julia.vim @jingpengw
docs/layers/lang/julia.md @jingpengw
docs/cn/layers/lang/julia.md @jingpengw
# lang#javascript layer
autoload/SpaceVim/layers/lang/javascript.vim @zhujinxuan @S1ngS1ng @chemzqm
docs/layers/lang/javascript.md @zhujinxuan @S1ngS1ng @chemzqm
docs/cn/layers/lang/javascript.md @zhujinxuan @S1ngS1ng @chemzqm
# lang#erlang layer
autoload/SpaceVim/layers/lang/erlang.vim @suzuiyuegjy
docs/layers/lang/erlang.md @suzuiyuegjy
docs/cn/layers/lang/erlang.md @suzuiyuegjy

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
custom: https://spacevim.org/sponsors/

29
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Bug Report
description: File a bug report
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior.
description: What is the expected behavior?
validations:
required: true
- type: textarea
id: reproduce-step
attributes:
label: The reproduce ways from Vim starting.
description: The reproduce ways are needed to debug.
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
id: SPDebugInfo
attributes:
label: Output of the `:SPDebugInfo!`
description: Please copy and paste the result of :SPDebugInfo! command.

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Community Support
url: https://app.element.io/#/room/#spacevim:matrix.org
about: Please ask and answer questions here.

View File

@ -0,0 +1,28 @@
name: Feature Request
description: request an new feature
labels: ["feature request"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
- type: textarea
id: feature-description
attributes:
label: Is your feature request related to a problem? Please describe..
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
validations:
required: true
- type: textarea
id: feature-solution
attributes:
label: Describe the solution you'd like.
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.

13
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,13 @@
### PR Prelude
Thank you for working on SpaceVim! :)
Please complete these steps and check these boxes before filing your PR:
- [ ] I have read and understood SpaceVim's [CONTRIBUTING](https://github.com/SpaceVim/SpaceVim/blob/master/CONTRIBUTING.md) document.
- [ ] I have read and understood SpaceVim's [CODE_OF_CONDUCT](https://github.com/SpaceVim/SpaceVim/blob/master/CODE_OF_CONDUCT.md) document.
- [ ] I understand my PR may be closed if it becomes obvious I didn't actually perform all of these steps.
### Why this change is necessary and useful?
[Please explain **in detail** why the changes in this PR are needed.]

15
.github/SUPPORT.md vendored Normal file
View File

@ -0,0 +1,15 @@
SpaceVim is an open source project.
Currently, this project is maintained by [@wsdjeg](https://github.com/wsdjeg),
If you use SpaceVim in your daily work and feel that it has made your life easier,
please consider supporting SpaceVim by:
- [Become a backer on opencollective](https://opencollective.com/spacevim)
- [Become a backer on Bountysource](https://salt.bountysource.com/teams/spacevim)
Also, you can buy me a coffee via ko-fi.com or wechat:
<a href='https://ko-fi.com/SpaceVim' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=f' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>
| wechat | alipay |
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------- |
| <img src="https://spacevim.org/img/weixin.png" height="150" width="150"> | <img src="https://spacevim.org/img/zhifubao.png" height="150" width="150"> |

18
.github/workflows/async.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Detach Plugins
on: [push]
jobs:
check:
strategy:
fail-fast: false
matrix:
detachPlugin: ["flygrep", "dein-ui", "vim-todo", "iedit", "scrollbar.vim", "vim-chat", "vim-cheat", "xmake.vim", "github.vim", "JavaUnit.vim", "git.vim"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Detach ${{ matrix.detachPlugin }}
env:
BOTSECRET: ${{ secrets.BOTSECRET_GITHUB }}
run: .ci/detach_plugin.sh ${{ matrix.detachPlugin }}

201
.github/workflows/check.yml vendored Normal file
View File

@ -0,0 +1,201 @@
name: test
on: [push, pull_request]
jobs:
Linux:
strategy:
fail-fast: false
matrix:
include:
- vimbin: vim
vimtag: v7.4.052
disable_es: true
- vimbin: vim
vimtag: v7.4.629
disable_es: true
- vimbin: vim
vimtag: v7.4.1689
disable_es: true
- vimbin: vim
vimtag: v8.0.0027
disable_es: true
- vimbin: vim
vimtag: v8.0.0183
disable_es: true
- vimbin: vim
vimtag: v8.0.0184
- vimbin: vim
vimtag: v8.0.1453
- vimbin: vim
vimtag: v8.1.2269
- vimbin: vim
vimtag: v8.2.2434
- vimbin: vim
vimtag: v8.2.3995
- vimbin: vim
vimtag: nightly
- vimbin: nvim
vimtag: nightly
- vimbin: nvim
vimtag: v0.9.1
- vimbin: nvim
vimtag: v0.9.0
- vimbin: nvim
vimtag: v0.8.3
- vimbin: nvim
vimtag: v0.8.2
- vimbin: nvim
vimtag: v0.8.1
- vimbin: nvim
vimtag: v0.8.0
- vimbin: nvim
vimtag: v0.7.2
- vimbin: nvim
vimtag: v0.7.0
- vimbin: nvim
vimtag: v0.6.1
- vimbin: nvim
vimtag: v0.6.0
- vimbin: nvim
vimtag: v0.5.1
- vimbin: nvim
vimtag: v0.5.0
- vimbin: nvim
vimtag: v0.4.4
- vimbin: nvim
vimtag: v0.4.3
- vimbin: nvim
vimtag: v0.4.2
- vimbin: nvim
vimtag: v0.4.0
- vimbin: nvim
vimtag: v0.3.8
runs-on: ubuntu-20.04
env:
VIM_BIN: ${{ matrix.vimbin }}
VIM_TAG: ${{ matrix.vimtag }}
DEPS: /home/runner/work/SpaceVim/deps
DISABLE_ES: ${{ matrix.disable_es }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip curl lua5.2 liblua5.2-dev
- name: Install ${{ matrix.vimbin }} ${{ matrix.vimtag }}
run: |
.ci/install/linux.sh $VIM_BIN $VIM_TAG
- name: Run test
run: |
if [ "$VIM_BIN" = "nvim" ]; then
export PATH="${DEPS}/_neovim/${VIM_TAG}/bin:${PATH}"
export VIM="${DEPS}/_neovim/${VIM_TAG}/share/nvim/runtime"
export VIM_Es="--headless"
else
export PATH="${DEPS}/_vim/${VIM_TAG}/bin:${PATH}"
export VIM="${DEPS}/_vim/${VIM_TAG}/share/vim"
if [ "$DISABLE_ES" = "true" ]; then
export VIM_Es=""
else
export VIM_Es="-Es"
fi
fi
export PATH="/home/runner/.local/bin:${PATH}"
echo "\$PATH: \"${PATH}\""
echo "\$VIM: \"${VIM}\""
echo "================= ${VIM_BIN} version ======================"
$VIM_BIN --version
pip3 install --upgrade "pip < 21.0"
pip3 install covimerage virtualenv codecov
make test_coverage
covimerage -vv xml --omit 'build/*' --omit 'bundle/*'
codecov -X search gcov pycov -f coverage.xml
Windows:
strategy:
fail-fast: false
matrix:
include:
- vimbin: vim
vimtag: nightly
- vimbin: vim
vimtag: v7.4.1185
- vimbin: vim
vimtag: v7.4.1689
- vimbin: vim
vimtag: v8.0.0027
- vimbin: vim
vimtag: v8.0.1453
- vimbin: vim
vimtag: v8.1.2269
- vimbin: vim
vimtag: v8.2.2434
- vimbin: vim
vimtag: v8.2.3995
- vimbin: nvim
vimtag: nightly
- vimbin: nvim
vimtag: v0.9.1
- vimbin: nvim
vimtag: v0.9.0
- vimbin: nvim
vimtag: v0.8.3
- vimbin: nvim
vimtag: v0.8.2
- vimbin: nvim
vimtag: v0.8.1
- vimbin: nvim
vimtag: v0.8.0
- vimbin: nvim
vimtag: v0.7.2
- vimbin: nvim
vimtag: v0.7.0
- vimbin: nvim
vimtag: v0.6.1
- vimbin: nvim
vimtag: v0.6.0
- vimbin: nvim
vimtag: v0.5.1
- vimbin: nvim
vimtag: v0.5.0
- vimbin: nvim
vimtag: v0.4.4
- vimbin: nvim
vimtag: v0.4.3
- vimbin: nvim
vimtag: v0.4.2
- vimbin: nvim
vimtag: v0.3.8
runs-on: windows-latest
env:
VIM_BIN: ${{ matrix.vimbin }}
VIM_TAG: ${{ matrix.vimtag }}
DEPS: C:\deps
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install ${{ matrix.vimbin }} ${{ matrix.vimtag }}
run: |
.ci/install/windows.ps1 $VIM_BIN $VIM_TAG
- name: Run test
run: |
if ($Env:VIM_BIN.StartsWith("nvim"))
{
if (Test-Path $env:DEPS\Neovim\bin ) {
$Env:PATH = $Env:DEPS + '\Neovim\bin\;' + $Env:PATH
$Env:VIM = $Env:DEPS + '\Neovim\share\nvim'
}else{
$Env:PATH = $Env:DEPS + '\nvim-win64\bin\;' + $Env:PATH
$Env:VIM = $Env:DEPS + '\nvim-win64\share\nvim'
}
$Env:VIM_Es = '--headless'
}
elseif ($Env:VIM_BIN.StartsWith("vim"))
{
$Env:PATH = $Env:DEPS + '\vim\vim82\;' + $Env:PATH
$Env:VIM = $Env:DEPS + '\vim'
}
echo $Env:PATH
echo $Env:VIM
make test

34
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: docker
on:
push:
branches:
- 'master'
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: docker/Dockerfile
push: true
tags: spacevim/spacevim:latest

13
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,13 @@
name: reviewdog
on: [pull_request]
jobs:
vint:
name: runner / vint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: vint
uses: reviewdog/action-vint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review # Change reporter.

23
.github/workflows/remote.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: mirror
on: [push]
jobs:
check:
strategy:
fail-fast: false
matrix:
mirror: ["gitee", "coding", "gitlab"]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Push to ${{ matrix.mirror }}
env:
BOTSECRET: ${{ secrets.BOTSECRET }}
BOTSECRET_GITHUB: ${{ secrets.BOTSECRET_GITHUB }}
CODINGBOTSECRET: ${{ secrets.CODINGBOTSECRET }}
run: .ci/update_mirror.sh ${{ matrix.mirror }}

View File

@ -1,25 +1,29 @@
# SpaceVim
<h1 align="center">
<a href="https://github.com/SpaceVim/SpaceVim#readme">
<img src="https://spacevim.org/logo.png" width="440" alt="SpaceVim"/>
</a>
</h1>
[![twitter](https://img.spacevim.org/twitter.svg)](https://twitter.com/SpaceVim)
[Quick Start Guide](https://spacevim.org/quick-start-guide/) \|
[FAQ](https://spacevim.org/faq/)
SpaceVim is a modular configuration of Vim and Neovim.
It's inspired by spacemacs. It manages collections of plugins in layers,
which help to collect related packages together to provide features.
This approach helps keep the configuration organized and reduces
overhead for the user by keeping them from having to think about
what packages to install.
[![build](https://img.shields.io/github/actions/workflow/status/SpaceVim/SpaceVim/check.yml?branch=master)](https://github.com/SpaceVim/SpaceVim/actions/workflows/check.yml?query=branch%3Amaster)
[![Codecov coverage](https://img.shields.io/codecov/c/github/SpaceVim/SpaceVim.svg)](https://codecov.io/gh/SpaceVim/SpaceVim)
[![GPLv3 License](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://github.com/SpaceVim/SpaceVim/blob/master/LICENSE)
[![Docker Pulls](https://img.shields.io/docker/pulls/spacevim/spacevim)](https://hub.docker.com/r/spacevim/spacevim)
- [Quick start guide](https://spacevim.org/quick-start-guide/): installation, configuration, and learning resources for SpaceVim
- [Documentation](https://spacevim.org/documentation/): the primary official documentation of SpaceVim
- [Available layers](https://spacevim.org/layers/): a list of available layers which can be used in SpaceVim
SpaceVim is a (neo)vim configuration inspired by spacemacs.
## Community
## Features
- English: [https://spacevim.org/community/](https://spacevim.org/community/)
- Chinese: [https://spacevim.org/cn/community/](https://spacevim.org/cn/community/)
- **Modularization:** plugins and functions are organized in [layers](https://spacevim.org/layers/).
- **Compatible api:** a series of [compatible APIs](https://spacevim.org/api/) for Vim/Neovim.
- **Great documentation:** online [documentation](https://spacevim.org/documentation/) and `:h SpaceVim`.
- **Better experience:** [Use lua to implement core plugins](https://spacevim.org/use-lua-to-reimplement-core-plugins/)
- **Beautiful UI:** you'll love the awesome UI and its useful features.
- **Mnemonic key bindings:** key binding guide will be displayed automatically
- **Fast boot time:** Lazy-load 90% of plugins with [dein.vim](https://github.com/Shougo/dein.vim)
- **Lower the risk of RSI:** by heavily using the space bar instead of modifiers.
- **Consistent experience:** consistent experience between terminal and gui
## Development
- English: [https://spacevim.org/development/](https://spacevim.org/development/)
- Chinese: [https://spacevim.org/cn/development/](https://spacevim.org/cn/development/)
<!-- vim:set nowrap: -->

41
docker/Dockerfile Normal file
View File

@ -0,0 +1,41 @@
FROM ubuntu:latest
MAINTAINER Shidong Wang <wsdjeg@outlook.com>
RUN apt update && \
apt install -y \
neovim \
curl \
python3-dev \
python3-pynvim \
lua5.3 \
git \
universal-ctags \
silversearcher-ag && \
apt clean
ENV HOME /home/spacevim
RUN groupdel users \
&& groupadd -r spacevim \
&& useradd --create-home --home-dir $HOME \
-r -g spacevim \
spacevim
USER spacevim
WORKDIR $HOME
ENV PYTHON3_HOST_PROG "/usr/bin/python3"
RUN mkdir -p $HOME/.config $HOME/.SpaceVim.d
RUN curl https://raw.githubusercontent.com/SpaceVim/SpaceVim/master/docker/init.toml > $HOME/.SpaceVim.d/init.toml
RUN curl -sLf https://spacevim.org/install.sh | bash
RUN nvim --headless +'call dein#install#_update([], "install", v:false)' +qall
RUN rm $HOME/.SpaceVim.d/init.toml
ENTRYPOINT nvim

13
docker/Makefile Normal file
View File

@ -0,0 +1,13 @@
HAVE_DOCKER := $(shell which docker 2>/dev/null)
HAVE_PODMAN := $(shell which podman 2>/dev/null)
build:
ifdef HAVE_DOCKER
docker build -t nvim -f Dockerfile .
else
ifdef HAVE_PODMAN
podman build -t nvim -f Dockerfile .
else
$(error "No docker or podman in $(PATH). Check if one was installed.")
endif
endif

43
docker/README.md Normal file
View File

@ -0,0 +1,43 @@
## SpaceVim in DockerHub
![Docker Automated build](https://img.shields.io/docker/automated/spacevim/spacevim)
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/spacevim/spacevim?sort=date)
[![Docker Pulls](https://img.shields.io/docker/pulls/spacevim/spacevim)](https://hub.docker.com/r/spacevim/spacevim)
This Dockerfile builds neovim `HEAD` and installs the latest available version of SpaceVim. You might want to use this for several reasons:
- Have a consistent version of Neovim and SpaceVim as long as the machine supports Docker.
- Try SpaceVim without modifying your current Vim/Neovim configuration.
- Try the latest Neovim with SpaceVim.
- Try SpaceVim with a newer version of Python.
- Debug SpaceVim configurations. e.g. when posting a bug report if you can reproduce it in this container then there's a higher chance that it is a true bug and not just an issue with your machine.
### FAQ
Isn't Docker stateless? Won't I have to reinstall all plugins each time I launch the container?
- During the build we call `dein#install()` so all plugins are installed and frozen. Your custom configurations can be added as an additional build step using the Docker `COPY` command.
### Build
You can build using the supplied `Makefile`:
make build
or call the command manually using:
docker build -t nvim -f Dockerfile .
### Run
You can run the container using:
docker run -it nvim
but that isn't terribly useful since changes made inside the container won't be visible outside. More useful is mounting the current working directory inside the container:
docker run -it -v $(pwd):/home/spacevim/src nvim
Even better is an alias `dnvim` which will do this automatically:
alias dnvim='docker run -it -v $(pwd):/home/spacevim/src nvim'

232
docker/init.toml Normal file
View File

@ -0,0 +1,232 @@
#=============================================================================
# init.toml --- Docker config temp file
# Copyright (c) 2016-2023 Wang Shidong & Contributors
# Author: Wang Shidong < wsdjeg@outlook.com >
# URL: https://spacevim.org
#=============================================================================
# SpaceVim options {{{
[options]
# vimcompatible = true
# enable_language_specific_leader = false
# }}}
## -- SpaceVim layer list start
[[layers]]
name = "VersionControl"
[[layers]]
name = "autocomplete"
[[layers]]
name = "chat"
[[layers]]
name = "checkers"
[[layers]]
name = "chinese"
[[layers]]
name = "colorscheme"
[[layers]]
name = "core#banner"
[[layers]]
name = "core#statusline"
[[layers]]
name = "core#tabline"
[[layers]]
name = "core"
[[layers]]
name = "cscope"
[[layers]]
name = "ctrlp"
[[layers]]
name = "debug"
[[layers]]
name = "default"
[[layers]]
name = "denite"
[[layers]]
name = "edit"
[[layers]]
name = "floobits"
[[layers]]
name = "format"
[[layers]]
name = "fzf"
[[layers]]
name = "git"
[[layers]]
name = "github"
[[layers]]
name = "japanese"
[[layers]]
name = "lang#WebAssembly"
[[layers]]
name = "lang#agda"
[[layers]]
name = "lang#asciidoc"
[[layers]]
name = "lang#autohotkey"
[[layers]]
name = "lang#c"
[[layers]]
name = "lang#clojure"
[[layers]]
name = "lang#csharp"
[[layers]]
name = "lang#dart"
[[layers]]
name = "lang#dockerfile"
[[layers]]
name = "lang#elixir"
[[layers]]
name = "lang#elm"
[[layers]]
name = "lang#erlang"
[[layers]]
name = "lang#extra"
[[layers]]
name = "lang#fsharp"
[[layers]]
name = "lang#go"
[[layers]]
name = "lang#haskell"
[[layers]]
name = "lang#html"
[[layers]]
name = "lang#java"
[[layers]]
name = "lang#javascript"
[[layers]]
name = "lang#julia"
[[layers]]
name = "lang#kotlin"
[[layers]]
name = "lang#latex"
[[layers]]
name = "lang#lisp"
[[layers]]
name = "lang#lua"
[[layers]]
name = "lang#markdown"
[[layers]]
name = "lang#nim"
[[layers]]
name = "lang#ocaml"
[[layers]]
name = "lang#perl"
[[layers]]
name = "lang#php"
[[layers]]
name = "lang#plantuml"
[[layers]]
name = "lang#puppet"
[[layers]]
name = "lang#purescript"
[[layers]]
name = "lang#python"
[[layers]]
name = "lang#ruby"
[[layers]]
name = "lang#rust"
[[layers]]
name = "lang#scala"
[[layers]]
name = "lang#sh"
[[layers]]
name = "lang#swift"
[[layers]]
name = "lang#typescript"
[[layers]]
name = "lang#vim"
[[layers]]
name = "lang#vue"
[[layers]]
name = "lsp"
[[layers]]
name = "leaderf"
[[layers]]
name = "shell"
[[layers]]
name = "sudo"
[[layers]]
name = "tags"
[[layers]]
name = "tmux"
[[layers]]
name = "tools#dash"
[[layers]]
name = "tools"
[[layers]]
name = "ui"
## -- SpaceVim layer list end