Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make space-vim able to be installed to location other than ~/.space-vim #485

Merged
merged 3 commits into from
Sep 11, 2021

Conversation

rene-descartes2021
Copy link
Collaborator

@rene-descartes2021 rene-descartes2021 commented Sep 4, 2021

Fixes #472.

New Bug: layers/layers.py has incorrect path to info.vim
But I suppose this isn't a big issue as layers/layers.py appears to be a helper script which generates https://github.com/liuchengxu/space-vim/blob/master/layers/LAYERS.md, which is something I imagine only the maintainer does, and not an end-user.

From my understanding this python script doesn't have access to g:spacevim.base (in vimscript). A fix I can think of off the top of my head would be to store info.vim in a cache directory, accessible from an environmental variable like $XDG_RUNTIME_DIR/vim or $TMPDIR/vim-$USER, But, such a fix would be outside the scope of this commit. Another possible fix would be a check in python verifying the the installation is to ~/.space-vim

EDIT: Altered the .gitignore in order to better facilitate /path/to/spacevim being ~/.vim if the end-user chooses that install location.

@rene-descartes2021 rene-descartes2021 changed the title Make space-vim able to be installed to location other than .space-vim Make space-vim able to be installed to location other than ~/.space-vim Sep 4, 2021
@rene-descartes2021 rene-descartes2021 force-pushed the new-spacevim-base branch 3 times, most recently from 30aa016 to 9bad0c6 Compare September 8, 2021 13:09
@liuchengxu
Copy link
Owner

Thanks a lot for this PR! Looks good to me. Do you mind also adding the instructions for installing space-vim in a custom folder you mentioned in #472 (comment) to README?

@rene-descartes2021 rene-descartes2021 force-pushed the new-spacevim-base branch 2 times, most recently from 1e879f6 to 20075bf Compare September 8, 2021 15:24
New Bug: layers/layers.py has incorrect path to info.vim
@rene-descartes2021
Copy link
Collaborator Author

rene-descartes2021 commented Sep 8, 2021

Ok should be fine now.

EDIT: A heads up that I'm working on two other PRs:

  1. A rename of init.vim to vimrc and init.spacevim to vimrc.local like I mentioned earlier in Support for custom installaton folder #472.

    • For vim all that is needed is a clone to ~/.vim and no symbolic links needed... maybe that should be standard install directions for vim.
    • vimrc.local is versioned now via git, I think this is more intuitive change for end-users than ~/.spacevim
    • Should allow for removal of install scripts (not useful for end-users). Moved install scripts to ci/, I assume that's an ok place for them, or can delete them.
  2. And a csharp layer. Needs more thought before I'll make PR.

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@@ -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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking about if it could be better for the consistency favor to use a environment variable for space-vim location at all the places, like

$ export SPACE_VIM_LOCATION=/custom-path
$ git clone https://github.com/liuchengxu/space-vim.git "$SPACE_VIM_LOCATION/space-vim"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I apologize I didn't respond yet while I thought about it. While an environmental variable could be used in the installation directions I don't think it necessary.

I'd seen the /path/to/git-repository installation pattern used in this project:

git clone https://github.com/ingydotnet/git-subrepo /path/to/git-subrepo
echo 'source /path/to/git-subrepo/.rc' >> ~/.bashrc

Interesting and simple pattern.

@liuchengxu liuchengxu merged commit e10f77c into liuchengxu:master Sep 11, 2021
@liuchengxu
Copy link
Owner

I didn't really test this, but overall looks correct to me. Thank you!

@rene-descartes2021 rene-descartes2021 deleted the new-spacevim-base branch September 14, 2021 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for custom installaton folder
2 participants