2018-01-31 14:59:29 +08:00
---
2019-01-07 21:15:22 +08:00
title: "FAQ"
2021-06-21 20:39:29 +08:00
description: "A list of questions and answers related to SpaceVim, especially those most asked in the SpaceVim community"
2018-01-31 14:59:29 +08:00
---
2017-10-28 14:57:02 +08:00
2019-10-14 23:29:07 +08:00
# [Home](../) >> FAQ
2017-11-13 17:14:19 +08:00
2020-10-24 22:30:59 +08:00
This is a list of the frequently asked questions about SpaceVim. Including questions about installation, configuration
and usage.
2018-01-31 14:59:29 +08:00
2018-02-22 10:05:04 +08:00
<!-- vim - markdown - toc GFM -->
2020-10-24 22:30:59 +08:00
- [Installation ](#installation )
- [Where is my old vim configuration? ](#where-is-my-old-vim-configuration )
2022-02-02 15:04:45 +08:00
- [How to uninstall SpaceVim? ](#how-to-uninstall-spacevim )
2022-04-20 01:31:23 +08:00
- [How to perform manual installation? ](#how-to-perform-manual-installation )
2020-10-24 22:30:59 +08:00
- [Configuration ](#configuration )
- [Can I try SpaceVim without overwriting my vimrc? ](#can-i-try-spacevim-without-overwriting-my-vimrc )
- [Why use toml as the default configuration file format? ](#why-use-toml-as-the-default-configuration-file-format )
- [Where should I put my configuration? ](#where-should-i-put-my-configuration )
- [E492: Not an editor command: ^M ](#e492-not-an-editor-command-m )
- [Why SpaceVim can not display default colorscheme? ](#why-spacevim-can-not-display-default-colorscheme )
- [Why can't I update plugins? ](#why-cant-i-update-plugins )
2021-05-07 19:29:32 +08:00
- [How to reload `init.toml`? ](#how-to-reload-inittoml )
2020-10-24 22:30:59 +08:00
- [How to enable +py and +py3 in Neovim? ](#how-to-enable-py-and-py3-in-neovim )
- [Why does Vim freeze after pressing Ctrl-s? ](#why-does-vim-freeze-after-pressing-ctrl-s )
2018-02-22 10:05:04 +08:00
<!-- vim - markdown - toc -->
2020-10-24 22:30:59 +08:00
## Installation
### Where is my old vim configuration?
2020-11-27 23:17:04 +08:00
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` .
2022-02-02 15:04:45 +08:00
### How to uninstall SpaceVim?
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
```
2022-04-20 01:31:23 +08:00
### How to perform manual installation?
2022-04-22 18:32:16 +08:00
Clone the SpaceVim Github repository to `~/.SpaceVim` and link Vim and Neovim user folder `~/.SpaceVim` . Delete `~/.vimrc` . On Linux use the following commands.
2022-04-20 01:31:23 +08:00
```
git clone https://github.com/SpaceVim/SpaceVim.git ~/.SpaceVim
ln -s ~/.SpaceVim ~/.vim
ln -s ~/.SpaceVim ~/.config/nvim
```
2020-10-24 22:30:59 +08:00
## Configuration
2018-12-28 01:14:42 +08:00
### Can I try SpaceVim without overwriting my vimrc?
2018-06-19 21:50:19 +08:00
2018-12-28 01:14:42 +08:00
The SpaceVim install script will move your `~/.vimrc` to `~/.vimrc_back` . If you want to have a try SpaceVim without
2019-01-22 07:50:55 +08:00
overwriting your own Vim configuration you can:
2018-12-28 01:14:42 +08:00
2019-01-22 07:50:55 +08:00
Clone SpaceVim manually.
2018-06-19 21:50:19 +08:00
```sh
git clone https://github.com/SpaceVim/SpaceVim.git ~/.SpaceVim
```
2019-01-22 07:50:55 +08:00
Then, start Vim via `vim -u ~/.SpaceVim/vimrc` . You can also put this alias into your bashrc.
2018-06-19 21:50:19 +08:00
```sh
alias svim='vim -u ~/.SpaceVim/vimrc'
```
2018-06-15 23:02:04 +08:00
### Why use toml as the default configuration file format?
2018-06-15 21:01:28 +08:00
2019-01-22 07:50:55 +08:00
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
2018-12-28 01:14:42 +08:00
before the error was still executed. This led to unforeseen problems.
2018-06-15 21:01:28 +08:00
2018-12-28 01:14:42 +08:00
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.
2018-06-15 21:01:28 +08:00
2019-01-07 21:15:22 +08:00
We compared TOML, YAML, XML, and JSON. We chose TOML as the default configuration language. Here are some of the
2018-12-28 01:14:42 +08:00
drawbacks we found with the other choices considered:
2018-06-15 21:01:28 +08:00
2018-12-28 01:14:42 +08:00
1. YAML: It is error-prone due to indentation being significant and when configuring transitions.
2. XML: Vim lacks a parsing library for XML and XML is hard for humans to write.
3. JSON: Is a good configuration format and Vim has a parsing function. However, JSON does not support comments.
2018-06-15 21:01:28 +08:00
### Where should I put my configuration?
2018-01-31 14:59:29 +08:00
2018-12-28 01:14:42 +08:00
SpaceVim loads custom global configuration from `~/.SpaceVim.d/init.toml` . It also supports project specific configuration.
2018-05-13 12:59:41 +08:00
That means it will load `.SpaceVim.d/init.toml` from the root of your project.
2018-01-31 14:59:29 +08:00
2018-06-15 21:01:28 +08:00
### E492: Not an editor command: ^M
2017-11-13 17:14:19 +08:00
The problem was git auto added ^M when cloning, solved by:
```sh
git config --global core.autocrlf input
```
2018-01-31 14:59:29 +08:00
2018-06-15 21:01:28 +08:00
### Why SpaceVim can not display default colorscheme?
2018-01-31 14:59:29 +08:00
2018-12-28 01:14:42 +08:00
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.](https://gist.github.com/XVilka/8346728)
2018-02-22 10:05:04 +08:00
2018-12-28 01:14:42 +08:00
### Why can't I update plugins?
2018-02-22 10:05:04 +08:00
2018-12-28 01:14:42 +08:00
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.
2018-07-28 10:58:12 +08:00
2021-05-07 19:29:32 +08:00
### How to reload `init.toml`?
You can not reload `init.toml` after startup. After editing the `init.toml` file, you need to restart your vim or neovim.
2019-01-22 07:50:55 +08:00
### How to enable +py and +py3 in Neovim?
2018-07-28 10:58:12 +08:00
2019-01-22 07:50:55 +08:00
In Neovim we can use `g:python_host_prog` and `g:python3_host_prog` to config python prog. In SpaceVim
2018-12-28 01:14:42 +08:00
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` .
2018-07-28 10:58:12 +08:00
2018-12-28 01:14:42 +08:00
For example:
2018-07-28 10:58:12 +08:00
```sh
export PYTHON_HOST_PROG='/home/q/envs/neovim2/bin/python'
export PYTHON3_HOST_PROG='/home/q/envs/neovim3/bin/python'
```
2018-09-12 21:05:11 +08:00
2019-01-22 07:50:55 +08:00
### Why does Vim freeze after pressing Ctrl-s?
2018-09-12 21:05:11 +08:00
2019-01-22 07:50:55 +08:00
This is a [feature of terminal emulators ](https://unix.stackexchange.com/a/137846 ). You can use `Ctrl-q` to unfreeze Vim. To disable
2018-12-28 01:14:42 +08:00
this feature you need the following in either `~/.bash_profile` or `~/.bashrc` :
2018-09-12 21:05:11 +08:00
```sh
stty -ixon
```