-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
base: 3.0
Are you sure you want to change the base?
Conversation
" No subdir because we might need to respect g:spf13_consolidated_directory | ||
let g:spf13_vim_cache_home = $HOME . '/.' | ||
endif | ||
" } |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Setting viminfo like |
############################ BASIC SETUP TOOLS | ||
msg() { | ||
printf '%b\n' "$1" >&2 | ||
} | ||
|
||
success() { | ||
if [ "$ret" -eq '0' ]; then | ||
if [[ "$ret" -eq '0' ]]; then |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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') |
There was a problem hiding this comment.
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?
can you rebase this, once you've completed the mentioned changes? |
FYI I just started school again :( so I don't know when I will be able to fix everything... |
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. |
Yes I could do that. |
can you still? :) |
neovim has xdg support now: neovim/neovim@1ca5646 EDIT: previously had pasted to the wrong commit! |
@mkwmms @jrobeson what's the status of this? I'd love to get it in. |
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 |
@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 |
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. |
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. |
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.