Skip to content

Commit

Permalink
Make space-vim able to be installed to location other than ~/.space-vim
Browse files Browse the repository at this point in the history
New Bug: layers/layers.py has incorrect path to info.vim
  • Loading branch information
rene-descartes2021 committed Sep 8, 2021
1 parent a70e4a4 commit 1e879f6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ Thumbs.db

tags

autoload/plug.vim
core/autoload/info.vim
core/autoload/spacevim/info.vim
plugged/*
*.un~
private/*
!private/README.md
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
PWD := $(shell pwd)
APP := space-vim
INIT_VIM := ~/.space-vim/init.vim
INIT_VIM := $(PWD)/init.vim
VIMRC := ~/.vimrc
NVIMRC := ~/.config/nvim/init.vim

INIT_SPACEVIM := ~/.space-vim/init.spacevim
INIT_SPACEVIM := $(PWD)/init.spacevim
DOT_SPACEVIM := ~/.spacevim

help:
Expand Down Expand Up @@ -39,7 +40,6 @@ uninstall:
rm -f $(VIMRC) && echo " - Removed $(VIMRC)"; \
rm -f $(NVIMRC) && echo " - Removed $(NVIMRC)"; \
rm -f $(DOT_SPACEVIM) && echo " - Removed $(DOT_SPACEVIM)"; \
rm -rf ~/.$(APP) && echo " - Removed ~/.$(APP)"; \
echo -e "\033[32m[✔]\033[0m Successfully uninstalled $(APP)"

.PHONY: help vim neovim update uninstall
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ $ bash <(curl -fsSL https://raw.githubusercontent.com/liuchengxu/space-vim/maste
#### Makefile

```bash
$ git clone https://github.com/liuchengxu/space-vim.git ~/.space-vim
$ cd ~/.space-vim
$ git clone https://github.com/liuchengxu/space-vim.git /path/to/space-vim
$ cd /path/to/space-vim
$ make vim # install space-vim for Vim
$ make neovim # install space-vim for NeoVim
```
Expand All @@ -126,28 +126,37 @@ Given git and Vim/NeoVim have been installed already:
1. Clone [space-vim](https://github.com/liuchengxu/space-vim)

```bash
$ git clone https://github.com/liuchengxu/space-vim.git ~/.space-vim
$ git clone https://github.com/liuchengxu/space-vim.git /path/to/space-vim
```

2. Install [vim-plug](https://github.com/junegunn/vim-plug#installation), refer to vim-plug installation section for more information.
/path/to/space-vim may be ~/.vim or ~/.config/nvіm if you so desire.

3. Create the symlinks.
2. Install [vim-plug](https://github.com/junegunn/vim-plug#installation), refer to vim-plug installation section for more information:
```bash
# For Vim
$ curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
# For NeoVim
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
```

3. Create the symlinks and install plugins.

**Linux and macOS**

```bash
# For Vim
$ ln -s ~/.space-vim/init.vim ~/.vimrc
$ ln -s /path/to/space-vim/init.vim ~/.vimrc
$ cp /path/to/space-vim/init.spacevim ~/.spacevim
$ vim -es +'PlugInstall' +qall

# For NeoVim
$ ln -s ~/.space-vim/init.vim ~/.config/nvim/init.vim

# Both for Vim and NeoVim
$ cp ~/.space-vim/init.spacevim ~/.spacevim
$ ln -s /path/to/space-vim/init.vim ~/.config/nvim/init.vim
$ cp /path/to/space-vim/init.spacevim ~/.spacevim
$ nvim +'PlugInstall' +qall
```

5. Open vim, then space-vim will automatically detect and install the missing plugins. If auto-installation fails unexpectly, please try running `:PlugInstall` manually.

## Customize

You can use `.spacevim` in your home directory to customize space-vim, where you can enable the existing layers, add your extra plugins and private configurations.
Expand Down
2 changes: 1 addition & 1 deletion core/autoload/spacevim/autocmd/unite.vim
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ let s:menus.v = {
\}
let s:menus.v.command_candidates = [
\['► init.vim',
\'e ~/.vimrc'],
\'e '.g:spacevim.base.'/init.vim'],
\['► .spacevim',
\'e ~/.spacevim'],
\['► vim-help',
Expand Down
2 changes: 1 addition & 1 deletion core/autoload/spacevim/map/manager.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ let s:clap_enabled = get(g:, 'spacevim_enable_clap', 0)

let g:spacevim#map#manager#quick_open = [
\ '~/.spacevim',
\ '~/.space-vim/init.vim',
\ g:spacevim.base.'/init.vim',
\ '~/.bashrc',
\ '~/.zshrc',
\ '~/.tmux.conf',
Expand Down
4 changes: 2 additions & 2 deletions init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
scriptencoding utf-8

let g:spacevim = get(g:, 'spacevim', {})
let g:spacevim.base = $HOME.'/.space-vim'
let g:spacevim.base = fnamemodify(resolve(expand('<sfile>:p')),':h')
let g:spacevim.version = '0.9.0'

" Identify platform {
Expand All @@ -35,6 +35,6 @@ if g:spacevim.os.windows
endif
" }

set runtimepath+=$HOME/.space-vim/core
let &runtimepath = &runtimepath . ',' . g:spacevim.base . '/core'

call spacevim#bootstrap()
2 changes: 1 addition & 1 deletion layers/+tools/lsp/config.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function! s:lcn() abort
let g:LanguageClient_loggingFile = '/tmp/LanguageClient.log'
let g:LanguageClient_loggingLevel = 'INFO'
let g:LanguageClient_serverStderr = '/tmp/LanguageServer.log'
let g:LanguageClient_settingsPath = expand('~/.space-vim/layers/+tools/lsp/settings.json')
let g:LanguageClient_settingsPath = fnamemodify(resolve(expand('<sfile>:p')),':h').'/settings.json'

let g:LanguageClient_serverCommands = {
\ 'c': ['ccls', '--log-file=/tmp/cq.log'],
Expand Down

0 comments on commit 1e879f6

Please sign in to comment.