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

*nix preliminary XDG support #814

Open
wants to merge 1 commit into
base: 3.0
Choose a base branch
from
Open

*nix preliminary XDG support #814

wants to merge 1 commit into from

Conversation

mwilliammyers
Copy link

Need to test this on someone else's machine. On mine the colors seem to be screwed up even though I didn't touch that part of the code.

" No subdir because we might need to respect g:spf13_consolidated_directory
let g:spf13_vim_cache_home = $HOME . '/.'
endif
" }
Copy link
Author

Choose a reason for hiding this comment

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

This PR exposes some new global variables all listed here (I know global variables are a sin). This is in the hopes of making the code more modular (getting rid of hard-coded paths). And only needing to change paths one place...

Copy link
Author

Choose a reason for hiding this comment

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

i meant with all the variables, but none of the xdg specific logic. in that it would work exactly the same as before the PR,

so do you want me to set the variables here but not actually use them so none of the functionality is changed and you can just echo them to debug it? i.e. not source any of the new XDG specific files.

Copy link
Author

Choose a reason for hiding this comment

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

Another thought would be to split up this PR further into only bootstrap.sh changes which set up everything according to XDG specs but keep all the .vimrc* files the same and move that to a new PR? If that is the case though we might need to move to a new branch as we might not be able to merge these all at once and keep functionality. as in if the bootstrap.sh and .vimrc* files don't both support XDG then things will be broken - at least for our XDG users- normal users won't notice a difference at all of course...

I don't know if that made any sense or would be worth it at all but its just a thought.

Copy link

Choose a reason for hiding this comment

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

well I just meant creating and using let g:spf13_vim_data_home and friends.. but them being set to the way everything works already (before the PR) and not being configurable at all.

Copy link

Choose a reason for hiding this comment

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

i musta been super tired when i wrote that, it seems a lot simpler at a second look.

@mwilliammyers
Copy link
Author

Setting viminfo like set viminfo+=n$XDG_CACHE_HOME/vim/viminfo as suggested in this great blog post did not work for me.

@mwilliammyers mwilliammyers changed the title preliminary XDG support *nix preliminary XDG support Aug 11, 2015
############################ BASIC SETUP TOOLS
msg() {
printf '%b\n' "$1" >&2
}

success() {
if [ "$ret" -eq '0' ]; then
if [[ "$ret" -eq '0' ]]; then
Copy link

Choose a reason for hiding this comment

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

can you put fixes like this in their own PR?

Copy link

Choose a reason for hiding this comment

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

oh, and make sure it works when running under both bash and dash

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I totally forgot that was still in there... My bad. I was following google's shell style guide which says it is better for many reasons.

Copy link

Choose a reason for hiding this comment

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

but it seems to be a bashism, which means we shouldn't use it. https://wiki.ubuntu.com/DashAsBinSh

Copy link

Choose a reason for hiding this comment

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

this is is sorta OT, but do you think that bootstrap.sh could be converted to viml reasonably? then we wouldn't have to worry about such things.

Copy link

Choose a reason for hiding this comment

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

neovim is converting to lua, but will still read viml for the foreseeable future.. likely many years. We're not currently allowed to use lua since not all vims are built with Lua, so that would mean that we'd have to keep two versions around to support both vim and neovim. Sticking with viml is pretty much all we can do if we want to work with regular vim also. I can nearly guarantee that spf13 would be against a wholesale conversion to lua in the near term.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah that is definitely understandable. Do you know if we are going to support neovim and vim or just vim?

Copy link
Author

Choose a reason for hiding this comment

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

Are bash and dash the only shells we officially support? Or are we trying to make bootstrap.sh as shell agnostic as possible?

Copy link

Choose a reason for hiding this comment

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

if it works with dash, then it should work with most shells that exist. It might even work with windows powershell

Copy link

Choose a reason for hiding this comment

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

supporting vim is supporting neovim (except some really old stuff) at least for the next few years

@mwilliammyers
Copy link
Author

To be clear I did not attempt to handle any support for Windows as XDG doesn't really support Windows... It would be wise to have someone test this on Windows at some point down the road though to make sure everything runs fine...

" On Windows use "dir" as fallback command.
if WINDOWS()
let s:ctrlp_fallback = 'dir %s /-n /b /s /a-d'
elseif executable('ag')
Copy link

Choose a reason for hiding this comment

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

was this moved for a reason relevant to this PR?

@ghost
Copy link

ghost commented Aug 14, 2015

can you rebase this, once you've completed the mentioned changes?

@mwilliammyers
Copy link
Author

FYI I just started school again :( so I don't know when I will be able to fix everything...

@ghost
Copy link

ghost commented Aug 28, 2015

Would you have time to apply some of the fixes (like removing the [[ from bootstrap.sh) and then rebase it? Don't bother trying to experiment with the source/eval stuff.

@mwilliammyers
Copy link
Author

Yes I could do that.

@ghost
Copy link

ghost commented Oct 16, 2015

can you still? :)

@ghost ghost mentioned this pull request Oct 16, 2015
@ghost
Copy link

ghost commented Oct 26, 2015

neovim has xdg support now: neovim/neovim@1ca5646

EDIT: previously had pasted to the wrong commit!

@spf13
Copy link
Owner

spf13 commented Nov 4, 2015

@mkwmms @jrobeson what's the status of this? I'd love to get it in.

@ghost
Copy link

ghost commented Nov 5, 2015

i don't think it's been rebased since I asked for it. I think I wasn't sure if there was any concerns (performance, security, etc) with using exec like so:

exec 'source ' . somevar

@spf13
Copy link
Owner

spf13 commented Dec 15, 2015

@jrobeson I'm not familiar with XDG and I'm not yet using NeoVim so if you could own either getting this rebased and merged or close it that would be awesome. cc @mkwmms

@CLAassistant
Copy link

CLAassistant commented Oct 24, 2019

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


William Myers seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@jameswilson
Copy link

XDG Base Directory support landed in Vim itself earlier this year vim/vim#14182.

It would be fantastic to have spf13-vim support XDG too! XDG Spec here.

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.

4 participants