SpaceVim - 模块化 Vim IDE,让你的 vim 更加高效和强大

SpaceVim 是一个模块化的 Vim 配置集合,以模块的方式组织和管理插件以及相关配置。针对某种语言,只需要启用相关的语言模块,即可搭配出对应的开发环境。比如启用 python 语言支持:

[[layers]]
    name = "lang#python"

SpaceVim对于新手有着非常友好的界面,界面格局和大多数IDE也比较类似。不过为了更好的体验SpaceVim,建议对于vim需要有一定的了解,如果有一定的英语基础建议阅读这篇关于vim的教程 vim-galore.

安装

Linux 或 Mac 下 SpaceVim的安装非常简单,只需要执行以下命令即可:

curl -sLf https://spacevim.org/install.sh | bash

想要获取更多的自定义的安装方式,请参考:

curl -sLf https://spacevim.org/install.sh | bash -s -- -h

在初次使用SpaceVim的时候,当你打开 vim 时,SpaceVim 会下载需要的插件,请等待下载过程完成,如果有失败的,可以手动执行 :

:SPInstall

SpaceVim 是一种模块化配置,可以运行在 vim 或者 neovim 上,关于 vim 以及 neovim 的安装,请参考以下链接:

windows系统下的安装步骤:

Windows 下 vim 用户只需要将本仓库克隆到用户 HOME 目录下的 vimfiles 即可,打开 CMD 默认的目录默认即为 HOME 目录,只需要执行如下命令即可:

git clone https://github.com/SpaceVim/SpaceVim.git vimfiles

Windows 下 neovim 用户 需要将本仓库克隆到用户 HOME 目录下的 AppData\Local\nvim,想要获取跟多关于 neovim 安装相关的知识,可以访问 neovim 的 wiki, wiki 写的非常详细。打开 CMD 初始目录默认一般即为 HOME 目录,只需要执行如下命令即可:

git clone https://github.com/SpaceVim/SpaceVim.git AppData\Local\nvim

特性

以neovim为主的新特性实现
模块化设置
依赖 dein.vim 的延迟加载,90%插件延迟加载,启动速度极快
高效,轻量级
Unite为主的工作平台
优雅的界面
针对不同语言开发的优化
可扩展的补全引擎,vim下为neocomplete, neovim 下为 deoplete
细致的tags管理
轻量级状态栏
优雅的主题

模块化设置

  1. SpaceVim 将从 ~/.local.vim 和当前目录的 .local.vim 载入用户配置,(该方式将被舍弃).
  2. SpaceVim 将从 ~/.SpaceVim.d/init.vim 和当前目录的 ./SpaceVim.d/init.vim 载入配置,并且更新 rtp,用户可以在 ~/.SpaceVim.d/ 和 .SpaceVim.d/ 这两个文件夹下编辑自己的脚本,和 SpaceVim 的配置文件。

示例:

" here are some basic customizations, please refer to the top of the vimrc file for all possible options
let g:spacevim_default_indent = 3
let g:spacevim_max_column     = 80
let g:spacevim_colorscheme    = 'my_awesome_colorscheme'
let g:spacevim_plugin_manager = 'dein'  " neobundle or dein or vim-plug

" change the default directory where all miscellaneous persistent files go
let g:spacevim_cache_dir = "/some/place/else"

" by default, language specific plugins are not loaded.  this can be changed with the following:
let g:spacevim_plugin_groups_exclude = ['ruby', 'python']

" if there are groups you want always loaded, you can use this:
let g:spacevim_plugin_groups_include = ['go']

" alternatively, you can set this variable to load exactly what you want
let g:spacevim_plugin_groups = ['core', 'web']

" recommend to use layer function, all the layers's name can be find in `:h SpaceVim-layers`
call SpaceVim#layers#load('layer_name')

" if there is a particular plugin you don't like, you can define this variable to disable them entirely
let g:spacevim_disabled_plugins=['vim-foo', 'vim-bar']

" if you want to add some custom plugins, use this options.
let g:spacevim_custom_plugins = [
        \ ['plasticboy/vim-markdown', 'on_ft' : 'markdown'],
        \ ['wsdjeg/GitHub.vim'],
        \ ]

" anything defined here are simply overrides
set backgroud=light
set nu

" but some options need to use spacevim's option, such as:
let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'

想要了解更多关于 SpaceVim 的相关信息,欢迎访问:

    原文作者:SpaceVim
    原文地址: https://www.jianshu.com/p/1f7b418eb53a
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞