SpaceVim
A modular Vim/Neovim configuration
Home | About | Quick start guide | Documentation | Development | Community | Sponsors | 中文
This is a list of the frequently asked questions about SpaceVim. Including questions about installation, configuration and usage.
init.toml
?In Linux/MacOS, the old vim configuration file ~/.vimrc
will be renamed to ~/.vimrc_back
,
and the directory ~/.vim
also will be renamed to ~/.vim_back
.
The installation script does not remove your vimrc, it just changes the name from ~/.vim
to ~/.vim_back
.
and if you uninstalll SpaceVim, your vimrc will come back. you can run:
curl -sLf https://spacevim.org/install.sh | bash -s -- --uninstall
The following section will document how to install SpaceVim manually on Linux.
First, you need to clone the repository to ~/.SpaceVim
.
git clone https://spacevim.org/git/repos/SpaceVim/ ~/.SpaceVim
Then, backup your old Neovim/Vim configuration file:
mv ~/.vimrc ~/.vimrc_back
mv ~/.vim ~/.vim_back
mv ~/.config/nvim ~/.config/nvim_back
Link ~/.SpaceVim
to Vim and Neovim user folder:
ln -s ~/.SpaceVim ~/.vim
ln -s ~/.SpaceVim ~/.config/nvim
The SpaceVim install script will move your ~/.vimrc
to ~/.vimrc_back
. If you want to have a try SpaceVim without
overwriting your own Vim configuration you can:
Clone SpaceVim manually.
git clone https://spacevim.org/git/repos/SpaceVim/ ~/.SpaceVim
Then, start Vim via vim -u ~/.SpaceVim/vimrc
. You can also put this alias into your bashrc.
alias svim='vim -u ~/.SpaceVim/vimrc'
In the old version of SpaceVim, we used a Vim file (init.vim
) for configuration. This introduced a lot of problems.
When loading a Vim file the file content is executed line by line. This means that when there was an error the content
before the error was still executed. This led to unforeseen problems.
We decided going forward to use a more robust configuration mechanism in SpaceVim. SpaceVim must be able to load the whole configuration file and if there are syntax errors in the configuration file, the entire configuration needs to be discarded.
We compared TOML, YAML, XML, and JSON. We chose TOML as the default configuration language. Here are some of the drawbacks we found with the other choices considered:
SpaceVim loads custom global configuration from ~/.SpaceVim.d/init.toml
. It also supports project specific configuration.
That means it will load .SpaceVim.d/init.toml
from the root of your project.
Many people have encountered the same problem. The options have been added to init.toml
but SpaceVim do not use it.
One possibility is that there is a syntax error in toml. For example:
[options]
enable_statusline_mode = true
enable_tabline_filetype_icon = true
enable_os_fileformat_icon = true
statusline_unicode_symbols = true
line_on_the_fly = false
[[layers]]
name = 'core'
enable_filetree_gitstatus = true
enable_filetree_filetypeicon = true
[options]
bootstrap_before = 'myspacevim#before'
In this example, only bootstrap_before
option will be used.
In SpaceVim should have only one [options]
section in toml file. In the example above, the bootstrap_before
line should be moved before [[layers]]
.
The problem was git auto added ^M when cloning, solved by:
git config --global core.autocrlf input
By default, SpaceVim uses true colors, so you should make sure your terminal supports true colors. This is an article about what true colors are and which terminals support true colors.
Sometimes you will see Updating failed, The plugin dir is dirty
. Since the plugin dir is a git repo, if the
directory is dirty (has changes that haven’t been committed to git) you can not use git pull
to update plugin. To fix this
issue, just move your cursor to the error line, and press gf
, then run git reset --hard HEAD
or git checkout .
. For
more info please read git documentation.
init.toml
?You can not reload init.toml
after startup. After editing the init.toml
file, you need to restart your vim or neovim.
In Neovim we can use g:python_host_prog
and g:python3_host_prog
to config python prog. In SpaceVim
the custom configuration file is loaded after SpaceVim core code. So in SpaceVim itself, if we using :py
command, it may cause errors.
So we introduce two new environment variables: PYTHON_HOST_PROG
and PYTHON3_HOST_PROG
.
For example:
export PYTHON_HOST_PROG='/home/q/envs/neovim2/bin/python'
export PYTHON3_HOST_PROG='/home/q/envs/neovim3/bin/python'
This is a feature of terminal emulators. You can use Ctrl-q
to unfreeze Vim. To disable
this feature you need the following in either ~/.bash_profile
or ~/.bashrc
:
stty -ixon
If you use both Nvim and Vim, you can use following configuration to select corresponding layer.
[[layers]]
name = 'telescope'
enable = 'has("nvim")'
[[layers]]
name = 'leaderf'
enable = '!has("nvim")'
Powered by Jekyll