SpaceVim安装和使用

SpaceVim 官网地址

https://spacevim.org/cn/quick-start-guide/

说明

官网推荐的安装脚本 , 上面安装包是从 github 上clone 的, 有时候安装会失败 , 所以修改一下安装脚本中仓库地址

修改后的脚本

#!/usr/bin/env bash#=============================================================================
# install.sh --- bootstrap script for SpaceVim
# Copyright (c) 2016-2021 Shidong Wang & Contributors
# Author: Shidong Wang < wsdjeg at 163.com >
# URL: https://spacevim.org
# License: GPLv3
#=============================================================================# Init option {{{
Color_off='\033[0m'       # Text Reset# terminal color template {{{
# Regular Colors
Black='\033[0;30m'        # Black
Red='\033[0;31m'          # Red
Green='\033[0;32m'        # Green
Yellow='\033[0;33m'       # Yellow
Blue='\033[0;34m'         # Blue
Purple='\033[0;35m'       # Purple
Cyan='\033[0;36m'         # Cyan
White='\033[0;37m'        # White# Bold
BBlack='\033[1;30m'       # Black
BRed='\033[1;31m'         # Red
BGreen='\033[1;32m'       # Green
BYellow='\033[1;33m'      # Yellow
BBlue='\033[1;34m'        # Blue
BPurple='\033[1;35m'      # Purple
BCyan='\033[1;36m'        # Cyan
BWhite='\033[1;37m'       # White# Underline
UBlack='\033[4;30m'       # Black
URed='\033[4;31m'         # Red
UGreen='\033[4;32m'       # Green
UYellow='\033[4;33m'      # Yellow
UBlue='\033[4;34m'        # Blue
UPurple='\033[4;35m'      # Purple
UCyan='\033[4;36m'        # Cyan
UWhite='\033[4;37m'       # White# Background
On_Black='\033[40m'       # Black
On_Red='\033[41m'         # Red
On_Green='\033[42m'       # Green
On_Yellow='\033[43m'      # Yellow
On_Blue='\033[44m'        # Blue
On_Purple='\033[45m'      # Purple
On_Cyan='\033[46m'        # Cyan
On_White='\033[47m'       # White# High Intensity
IBlack='\033[0;90m'       # Black
IRed='\033[0;91m'         # Red
IGreen='\033[0;92m'       # Green
IYellow='\033[0;93m'      # Yellow
IBlue='\033[0;94m'        # Blue
IPurple='\033[0;95m'      # Purple
ICyan='\033[0;96m'        # Cyan
IWhite='\033[0;97m'       # White# Bold High Intensity
BIBlack='\033[1;90m'      # Black
BIRed='\033[1;91m'        # Red
BIGreen='\033[1;92m'      # Green
BIYellow='\033[1;93m'     # Yellow
BIBlue='\033[1;94m'       # Blue
BIPurple='\033[1;95m'     # Purple
BICyan='\033[1;96m'       # Cyan
BIWhite='\033[1;97m'      # White# High Intensity backgrounds
On_IBlack='\033[0;100m'   # Black
On_IRed='\033[0;101m'     # Red
On_IGreen='\033[0;102m'   # Green
On_IYellow='\033[0;103m'  # Yellow
On_IBlue='\033[0;104m'    # Blue
On_IPurple='\033[0;105m'  # Purple
On_ICyan='\033[0;106m'    # Cyan
On_IWhite='\033[0;107m'   # White
# }}}# version
Version='2.0.0-dev'
#System name
System="$(uname -s)"# }}}# need_cmd {{{
need_cmd () {if ! hash "$1" &>/dev/null; thenerror "Need '$1' (command not found)"exit 1fi
}
# }}}# success/info/error/warn {{{
msg() {printf '%b\n' "$1" >&2
}success() {msg "${Green}[✔]${Color_off} ${1}${2}"
}info() {msg "${Blue}[➭]${Color_off} ${1}${2}"
}error() {msg "${Red}[✘]${Color_off} ${1}${2}"exit 1
}warn () {msg "${Yellow}[⚠]${Color_off} ${1}${2}"
}
# }}}# echo_with_color {{{
echo_with_color () {printf '%b\n' "$1$2$Color_off" >&2
}
# }}}# fetch_repo {{{
fetch_repo () {if [[ -d "$HOME/.SpaceVim" ]]; theninfo "Trying to update SpaceVim"cd "$HOME/.SpaceVim"git pullcd - > /dev/null 2>&1success "Successfully update SpaceVim"elseinfo "Trying to clone SpaceVim"git clone https://gitee.com/spacevim/SpaceVim.git "$HOME/.SpaceVim"if [ $? -eq 0 ]; thensuccess "Successfully clone SpaceVim"elseerror "Failed to clone SpaceVim"exit 0fifi
}
# }}}# install_vim {{{
install_vim () {if [[ -f "$HOME/.vimrc" ]]; thenmv "$HOME/.vimrc" "$HOME/.vimrc_back"success "Backup $HOME/.vimrc to $HOME/.vimrc_back"fiif [[ -d "$HOME/.vim" ]]; thenif [[ "$(readlink $HOME/.vim)" =~ \.SpaceVim$ ]]; thensuccess "Installed SpaceVim for vim"elsemv "$HOME/.vim" "$HOME/.vim_back"success "BackUp $HOME/.vim to $HOME/.vim_back"ln -s "$HOME/.SpaceVim" "$HOME/.vim"success "Installed SpaceVim for vim"fielseln -s "$HOME/.SpaceVim" "$HOME/.vim"success "Installed SpaceVim for vim"fi
}
# }}}# install_neovim {{{
install_neovim () {if [[ -d "$HOME/.config/nvim" ]]; thenif [[ "$(readlink $HOME/.config/nvim)" =~ \.SpaceVim$ ]]; thensuccess "Installed SpaceVim for neovim"elsemv "$HOME/.config/nvim" "$HOME/.config/nvim_back"success "BackUp $HOME/.config/nvim to $HOME/.config/nvim_back"ln -s "$HOME/.SpaceVim" "$HOME/.config/nvim"success "Installed SpaceVim for neovim"fielsemkdir -p "$HOME/.config"ln -s "$HOME/.SpaceVim" "$HOME/.config/nvim"success "Installed SpaceVim for neovim"fi
}
# }}}# uninstall_vim {{{
uninstall_vim () {if [[ -d "$HOME/.vim" ]]; thenif [[ "$(readlink $HOME/.vim)" =~ \.SpaceVim$ ]]; thenrm "$HOME/.vim"success "Uninstall SpaceVim for vim"if [[ -d "$HOME/.vim_back" ]]; thenmv "$HOME/.vim_back" "$HOME/.vim"success "Recover from $HOME/.vim_back"fififiif [[ -f "$HOME/.vimrc_back" ]]; thenmv "$HOME/.vimrc_back" "$HOME/.vimrc"success "Recover from $HOME/.vimrc_back"fi
}
# }}}# uninstall_neovim {{{
uninstall_neovim () {if [[ -d "$HOME/.config/nvim" ]]; thenif [[ "$(readlink $HOME/.config/nvim)" =~ \.SpaceVim$ ]]; thenrm "$HOME/.config/nvim"success "Uninstall SpaceVim for neovim"if [[ -d "$HOME/.config/nvim_back" ]]; thenmv "$HOME/.config/nvim_back" "$HOME/.config/nvim"success "Recover from $HOME/.config/nvim_back"fififi
}
# }}}# check_requirements {{{
check_requirements () {info "Checking Requirements for SpaceVim"if hash "git" &>/dev/null; thengit_version=$(git --version)success "Check Requirements: ${git_version}"elsewarn "Check Requirements : git"fiif hash "vim" &>/dev/null; thenis_vim8=$(vim --version | grep "Vi IMproved 8")is_vim74=$(vim --version | grep "Vi IMproved 7.4")if [ -n "$is_vim8" ]; thensuccess "Check Requirements: vim 8.0"elif [ -n "$is_vim74" ]; thensuccess "Check Requirements: vim 7.4"elseif hash "nvim" &>/dev/null; thensuccess "Check Requirements: nvim"elsewarn "SpaceVim need vim 7.4 or above"fifiif hash "nvim" &>/dev/null; thensuccess "Check Requirements: nvim"fielseif hash "nvim" &>/dev/null; thensuccess "Check Requirements: nvim"elsewarn "Check Requirements : vim or nvim"fifiinfo "Checking true colors support in terminal:"bash -c "$(curl -fsSL https://raw.githubusercontent.com/JohnMorales/dotfiles/master/colors/24-bit-color.sh)"
}
# }}}# usage {{{
usage () {echo "SpaceVim install script : V ${Version}"echo ""echo "Usage : curl -sLf https://spacevim.org/install.sh | bash -s -- [option] [target]"echo ""echo "  This is bootstrap script for SpaceVim."echo ""echo "OPTIONS"echo ""echo " -i, --install            install spacevim for vim or neovim"echo " -v, --version            Show version information and exit"echo " -u, --uninstall          Uninstall SpaceVim"echo " -c, --checkRequirements  checkRequirements for SpaceVim"echo " --no-fonts               skip downloading fonts"echo ""echo "EXAMPLE"echo ""echo "    Install SpaceVim for vim and neovim"echo ""echo "        curl -sLf https://spacevim.org/install.sh | bash"echo ""echo "    Install SpaceVim for vim only or neovim only"echo ""echo "        curl -sLf https://spacevim.org/install.sh | bash -s -- --install vim"echo "        curl -sLf https://spacevim.org/install.sh | bash -s -- --install neovim"echo ""echo "    Uninstall SpaceVim"echo ""echo "        curl -sLf https://spacevim.org/install.sh | bash -s -- --uninstall"
}
# }}}# install_done {{{install_done () {echo_with_color ${Yellow} ""echo_with_color ${Yellow} "Almost done!"echo_with_color ${Yellow} "=============================================================================="echo_with_color ${Yellow} "==    Open Vim or Neovim and it will install the plugins automatically      =="echo_with_color ${Yellow} "=============================================================================="echo_with_color ${Yellow} ""echo_with_color ${Yellow} "That's it. Thanks for installing SpaceVim. Enjoy!"echo_with_color ${Yellow} ""
}# }}}# welcome {{{welcome () {echo_with_color ${Yellow} "        /######                                     /##    /##/##             "echo_with_color ${Yellow} "       /##__  ##                                   | ##   | #|__/             "echo_with_color ${Yellow} "      | ##  \__/ /######  /######  /####### /######| ##   | ##/##/######/#### "echo_with_color ${Yellow} "      |  ###### /##__  ##|____  ##/##_____//##__  #|  ## / ##| #| ##_  ##_  ##"echo_with_color ${Yellow} "       \____  #| ##  \ ## /######| ##     | ########\  ## ##/| #| ## \ ## \ ##"echo_with_color ${Yellow} "       /##  \ #| ##  | ##/##__  #| ##     | ##_____/ \  ###/ | #| ## | ## | ##"echo_with_color ${Yellow} "      |  ######| #######|  ######|  ######|  #######  \  #/  | #| ## | ## | ##"echo_with_color ${Yellow} "       \______/| ##____/ \_______/\_______/\_______/   \_/   |__|__/ |__/ |__/"echo_with_color ${Yellow} "               | ##                                                           "echo_with_color ${Yellow} "               | ##                                                           "echo_with_color ${Yellow} "               |__/                                                           "echo_with_color ${Yellow} "                      version : ${Version}      by : spacevim.org             "}# }}}# download_font {{{
download_font () {url="https://raw.githubusercontent.com/wsdjeg/DotFiles/7a75a186c6db9ad6f02cafba8d4c7bc78f47304c/local/share/fonts/${1// /%20}"path="$HOME/.local/share/fonts/$1"# Clean up after https://github.com/SpaceVim/SpaceVim/issues/2532if [[ -f "$path" && ! -s "$path" ]]thenrm "$path"fiif [[ -f "$path" ]]thensuccess "Downloaded $1"elseinfo "Downloading $1"curl -s -o "$path" "$url"success "Downloaded $1"fi
}# }}}# install_fonts {{{
install_fonts () {if [[ ! -d "$HOME/.local/share/fonts" ]]; thenmkdir -p $HOME/.local/share/fontsfidownload_font "DejaVu Sans Mono Bold Oblique for Powerline.ttf"download_font "DejaVu Sans Mono Bold for Powerline.ttf"download_font "DejaVu Sans Mono Oblique for Powerline.ttf"download_font "DejaVu Sans Mono for Powerline.ttf"download_font "DroidSansMonoForPowerlinePlusNerdFileTypesMono.otf"download_font "Ubuntu Mono derivative Powerline Nerd Font Complete.ttf"download_font "WEBDINGS.TTF"download_font "WINGDNG2.ttf"download_font "WINGDNG3.ttf"download_font "devicons.ttf"download_font "mtextra.ttf"download_font "symbol.ttf"download_font "wingding.ttf"info "Updating font cache, please wait ..."if [ $System == "Darwin" ];thenif [ ! -e "$HOME/Library/Fonts" ];thenmkdir "$HOME/Library/Fonts"ficp $HOME/.local/share/fonts/* $HOME/Library/Fonts/elsefc-cache -fv > /dev/nullmkfontdir "$HOME/.local/share/fonts" > /dev/nullmkfontscale "$HOME/.local/share/fonts" > /dev/nullfisuccess "font cache done!"
}# }}}### main {{{
main () {if [ $# -gt 0 ]thencase $1 in--uninstall|-u)info "Trying to uninstall SpaceVim"uninstall_vimuninstall_neovimecho_with_color ${BWhite} "Thanks!"exit 0;;--checkRequirements|-c)check_requirementsexit 0;;--install|-i)welcomeneed_cmd 'git'fetch_repoif [ $# -eq 2 ]thencase $2 inneovim)install_neoviminstall_fontsinstall_doneexit 0;;vim)install_viminstall_fontsinstall_doneexit 0esacfiinstall_viminstall_neoviminstall_fontsinstall_doneexit 0;;--help|-h)usageexit 0;;--no-fonts)welcomeneed_cmd 'git'fetch_repoinstall_viminstall_neoviminstall_fontsinstall_doneexit 0;;--version|-v)msg "${Version}"exit 0esacelsewelcomeneed_cmd 'git'fetch_repoinstall_viminstall_neoviminstall_fontsinstall_donefi
}# }}}main $@# vim:set nofoldenable foldmethod=marker:

安装

新建一个 install.sh 脚本文件

把修改后的脚本内容复制到 install.sh 文件中

执行命令

bash install.sh

到此 安装 spacevim 步骤完成

SpaceVim安装和使用相关推荐

  1. linux jedi-vim安装,SpaceVim安装与环境配置

    配置vim是一件很让人头疼的事,网速差的同学可能安装个YouCompleteMe都要几个小时. 本文要介绍一种vim的预配置方案--SpaceVim的安装过程(注意SpaceVim和space-vim ...

  2. SpaceVim 安装和卸载

    Mac安装 curl -sLf https://spacevim.org/install.sh | bash 卸载 curl -sLf https://spacevim.org/install.sh ...

  3. [SpaceVim] 安装SpaceVim

    Window 进入官网 https://spacevim.org/cn/quick-start-guide/,下载 install.cmd并运行 运行 nvim-qt.exe 两遍,第一遍打开软件会下 ...

  4. SpaceVim的配置+ e121:undefined variable:g:spacevim global config path

    SpaceVim安装和环境配置:https://www.jianshu.com/p/565f8ac13d8b 注意:如果发现了spc+f+v+d的快捷键不能使用的情况,也就是标题的 e121:unde ...

  5. Go语言 linux下开发 IDE -SpaceVim\NeoVim

    文章目录 Go语言 linux下开发 IDE -SpaceVim 一.NeoVim和SpaceVim区别 二.NeoVim 安装 NeoVim Neovim GitHub Copilot插件安装 常见 ...

  6. SpaceVim+CTags配置

    软件准备: spacevim安装 spacevim官网; 链接: https://spacevim.org/cn/documentation/ linux: curl -sLf https://spa ...

  7. SpaceVim——IDE般的vim

    ide般的vim–SpaceVim 「生命不息,折腾不止:代码就是生命,一起折腾.」 如何将vim折腾成ide?往下看 Vim安装 这些基本安装不多详细描述,按照流程就行了 • vim官网[1] • ...

  8. ParrotSec-OS渗透测试系统

    –>初识 官网 ParrotSecOS 镜像下载 官方镜像下载 清华镜像下载 中科大镜像下载 测试版下载 论坛 官方论坛 国内论坛 电报群 官方TG群 国内TG群 Git库 官方Gitlab 官 ...

  9. vim安装指南(for Ubuntu and Windows)(配置C/C++和Python开发环境)

    Ubuntu 安装vimplus GitHub链接:vimplus 安装步骤 git clone https://github.com/chxuan/vimplus.git ~/.vimplus # ...

最新文章

  1. 我来做百科(第九天)
  2. vue下拉框值改变_vue select下拉框绑定值不跟着变问题
  3. 计算机设备管理程序在哪,电脑设备管理在哪,教您如何打开电脑设备管理
  4. Spark SQL程序操作HiveContext
  5. Android 里的adb命令
  6. 修改mysql连接回收时间_Druid无效链接回收策略(源码分析)(mysql 8小时连接失效问题)...
  7. python unittest用法
  8. Kali Linux进阶篇:Nmap扫描网络空间存活主机技巧
  9. php 改变图片大小,php修改图片大小的方法
  10. 设计师该如何把简历写好?
  11. php珠心算源码,NOIP201401珠心算测验
  12. RFC 文档中文目录
  13. 【机器学习】详解 EfficientNet
  14. 超越函数e^(-x^2)的定积分
  15. 用Python分析1585家电商车厘子销售数据,发现这些秘密
  16. 解决方案:惠普15-bc012tx笔记本电脑电池掉电快的检测及解决
  17. php小数点后保留一位或两位小数
  18. NAO机器人高尔夫中的视觉系统设计
  19. 虚拟跑步刷步软件下载_dvdfab virtual drive win10版|dvdfab virtual drive(虚拟光驱) V1.5.1.1 官方版 下载_当下软件园...
  20. GPRS模块为什么会低至十几元?我所经历的物联网模块国产化过程

热门文章

  1. GitHub上50个最受欢迎的PHP开源项目【2019】
  2. 学画需要努力,更需要坚持-轻微课学员成长帖
  3. 计算机二级软件无法运行,全国计算机等级模拟软件提示COMDLG32.OCX的解决方法
  4. 机器学习的基本数学知识1
  5. Go 语言 2019 调查报告发布
  6. 计算机模拟方法棒影图,棒影图实验报告.doc
  7. [转载]田雪松硬笔行书临文征明《滕王阁序》_拔剑-浆糊的传说_新浪博客
  8. DaVinci Resolve Studio 17中文语言设置教程
  9. 圈复杂度 (Cyclomatic Complexity)
  10. 三菱模拟量fx3u4da_全新原装三菱PLC模拟量适配器 FX3U-4AD FX3U-4DA 1PG输入输出