SpaceVim 使用指南
SpaceVim[1] 是一个社区驱动的模块化 vim/neovim 配置集合,其中包含了多种功能模块,并且针对 neovim 做了功能优化。SpaceVim[2] 有多种功能模块可供选择,用户只需要选择所需的模块,就可以配置出一个适合自己的开发环境。
- 项 目 主 页: spacevim.org[3]
- Github 地址 : SpaceVim GitHub[4],欢迎 Star 或 fork。
使用过程中遇到问题或者有什么功能需求可以在 github 提交 issue,这将更容易被关注和修复。我们也欢迎喜欢 vim/neovim 的用户加入我们的 QQ 群,一起讨论 vim 相关的技巧,点击加入Vim/SpaceVim用户群[5]。
SpaceVim[6] 的开发很活跃,以下是近几周的开发汇总:
安装
Linux 或 Mac
Linux 或 Mac 下 SpaceVim 的安装非常简单,只需要执行以下命令即可:
curl -sLf https://spacevim.org/install.sh | bash
想要获取更多的自定义的安装方式,请参考:
curl -sLf https://spacevim.org/install.sh | bash -s -- -h
SpaceVim是一种模块化配置,可以运行在vim或者neovim上,关于vim以及neovim的安装,请参考以下链接:
Windows
Windows 下 vim 用户只需要将本仓库克隆成用户 HOME 目录下的 vimfiles 即可,打开 CMD 默认的目录默认即为 HOME 目录,只需要执行如下命令即可:
gitclone https://github.com/SpaceVim/SpaceVim.git vimfiles
Windows 下 neovim 用户需要将本仓库克隆成用户 HOME 目录下的
AppData\Local\nvim
,想要获取跟多关于 neovim 安装相关的知识,可以访问 neovim 的 wiki, wiki 写的非常详细。打开 CMD 初始目录默认一般即为 HOME 目录,只需要执行如下命令即可:gitclone https://github.com/SpaceVim/SpaceVim.git AppData\Local\nvim
字体
SpaceVim 默认启用了 Powerline 字体,默认的字体文件是:DejaVu Sans Mono[9], Windows 用户直接下载下来右键安装即可。
vimproc.dll
Windows 下用户如果不方便编译,可以在 qq 群文件里面下载相应的 dll 文件放到 vimproc 的 lib 目录,默认是
~/.cache/vimfiles/repos/github.com/Shougo/vimproc.vim/lib/
特性
优雅的界面
SpaceVim 的默认界包括 tagbar 、vimfiler 、以及 airline 界面,配色主题采用的 gruvbox。
Unite 为主的工作平台
Unite 的快捷键前缀是
f
, 可以通过 g:spacevim_unite_leader
来设定,快捷键无需记忆,SpaceVim 有很好的快捷键辅助机制,如下是 Unite 的快捷键键图:自动补全
SpaceVim 采用最快补全引擎 deoplete, 该引擎不同与 YouCompleteMe 的主要一点是支持多源补全,而不单单是语义补全。 而且补全来源拓展非常方便。
用户配置
SpaceVim 将从
~/.SpaceVim.d/init.vim
和当前目录的 ./SpaceVim.d/init.vim
载入配置,并且更新 rtp,用户可以在 ~/.SpaceVim.d/
和 .SpaceVim.d/
这两个文件夹下编辑自己的脚本,和 SpaceVim 的配置文件。示例:
" Here are some basic customizations,
" please refer to the ~/.SpaceVim.d/init.vim
" file for all possible options:
let g:spacevim_default_indent = 3
let g:spacevim_max_column = 80
"Change the default directory where all miscellaneous persistent files go.
" By default it is ~/.cache/vimfiles.
let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles'
"setSpaceVim colorscheme
let g:spacevim_colorscheme ='jellybeans'
" Set plugin manager, you want to use, default is dein.vim
let g:spacevim_plugin_manager = 'dein' " neobundle or dein orvim-plug
" use space as `<Leader>`
let mapleader = "\<space>"
"Set windows shortcut leader [Window],defaultis`s`
let g:spacevim_windows_leader ='s'
" Set unite work flow shortcut leader [Unite], default is `f`
let g:spacevim_unite_leader = 'f'
"Bydefault, language specific plugins are not loaded.This can be changed
" with the following, then the plugins for go development will be loaded.
call SpaceVim#layers#load('lang#go')
" loaded ui layer
call SpaceVim#layers#load('ui')
" If there is a particular plugin you don't like, you can define this
" variable to disable them entirely:
let g:spacevim_disabled_plugins=[
\ ['junegunn/fzf.vim'],
\ ]
" If you want to add some custom plugins, use these options:
let g:spacevim_custom_plugins = [
\ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}],
\ ['wsdjeg/GitHub.vim'],
\ ]
"set the guifont
let g:spacevim_guifont ='DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
SpaceVim 选项
选项名称 | 默认值 | 描述 |
---|---|---|
g:spacevim_default_indent | 2 | 对齐空格 |
g:spacevim_enable_guicolors | 1 | 启用/禁用终端使用真色彩 |
g:spacevim_windows_leader | s | 窗口管理快捷键前缀 |
g:spacevim_unite_leader | f | Unite快捷键前缀 |
g:spacevim_plugin_bundle_dir | ~/.cache/vimfiles | 默认插件缓存位置 |
g:spacevim_realtime_leader_guide | 0 | 启用/禁用实时快捷键提示 |
g:spacevim_guifont | '' | 设置SpaceVim字体 |
g:spacevim_sidebar_width | 30 | 设置边栏宽度,文件树以及语法树 |
g:spacevim_custom_plugins | [] | 设置自定义插件 |
推荐文章
< 左右滑动查看相关文章 >
输入文章 ID 或长按二维码直达
最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。