Repository navigation
XDG base directory specification support - #3470
Conversation
|
Most of documentation changes is replacing |
|
Also many removes regarding windows (as I have no idea what should be written there). |
|
3795136 hanged on unknown test. If 3796471 also hangs I am considering #3427 a blocker (instead of using temporary commit that sets gtest output). BTW, I do not think ZyX-I@dcc02b2 should be a part of this PR, but I do not know whether this should be part of a separate PR, or of something existing windows-related. |
|
ZyX-I@dcc02b2 is ok for this PR. |
|
This one also hangs. Hang does not happen locally, thus I am waiting for resolution with #3427. |
9b20f12 to
892c8a9
Compare
|
By the way, not that this PR originally has |
There was a problem hiding this comment.
I think we decided to use the same XDG paths as in other *nixes for OSX (see #3198 (comment) and following)
There was a problem hiding this comment.
Yes 👍 Treat OSX as unix. Haters gonna hate.
👍 One of the major advantages of adopting XDG is that we have standard directories to persist swap/undo/backup. We should default to using those and consider enabling swap & persistent undo by default. |
|
Also it would be good to merge #1909 before this: to place socket in $XDG_RUNTIME_DIR I in any case need a single entry point. |
There was a problem hiding this comment.
I do not think it makes sense to support USR_EXRC_FILE or USR_EXRC_FILE2 if we are removing vimrc already.
|
I have a reason to want |
There was a problem hiding this comment.
If we leave this empty for now, what would it mean for people who are building/using nvim in Windows already?
There was a problem hiding this comment.
17.10.2015, 21:41, "Felipe Morales" notifications@github.com:
In src/nvim/os/stdpaths.c:
+static const char *xdg_env_vars[] = { > + [kXDGConfigHome] = "XDG_CONFIG_HOME", > + [kXDGDataHome] = "XDG_DATA_HOME", > + [kXDGCacheHome] = "XDG_CACHE_HOME", > + [kXDGRuntimeDir] = "XDG_RUNTIME_DIR", > + [kXDGConfigDirs] = "XDG_CONFIG_DIRS", > + [kXDGDataDirs] = "XDG_DATA_DIRS", > +}; > + > +/// Defaults for XDGVarType values > +/// > +/// Used in case environment variables contain nothing. Need to be expanded. > +static const char *const xdg_defaults[] = { > + // Windows, Apple stuff are just shims right now > +#ifdef WIN32 > + // Windows
If we leave this empty for now, what would it mean for people who are building/using nvim in Windows already?
That this will fail with syntax error. #endif is wrongly placed.
If it is correctly placed it should SEGV.
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
We can stub it out with the examples from https://github.com/ActiveState/appdirs/blob/master/appdirs.py .
There was a problem hiding this comment.
@justinmk Even assuming that C:\\Users\\user\\ from examples is ~\\ (I can’t reliably use $USER even on *nix) I have no idea what is AppAuthor. Also what exactly is AppName: nvim/Neovim/neovim?
There was a problem hiding this comment.
@ZyX-I AppAuthor in this case should be Neovim, and the same for AppName. Supposedly, you could use the %AppData% environment variable, see http://blogs.msdn.com/b/patricka/archive/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions.aspx
There was a problem hiding this comment.
Regarding all these references to ~/.config/...: shouldn't these instead say $XDG_CONFIG_HOME/...?
There was a problem hiding this comment.
17.10.2015, 22:01, "Michael Reed" notifications@github.com:
In runtime/doc/autocmd.txt:
@@ -994,7 +994,7 @@ expect. > Environment variables can be used in a pattern: > > :autocmd BufRead $VIMRUNTIME/doc/*.txt set expandtab > And ~ can be used for the home directory (if $HOME is defined): > > - :autocmd BufWritePost ~/.vimrc so ~/.vimrc > + :autocmd BufWritePost ~/.config/nvim/init.vim so
Regarding all these references to ~/.config/...: shouldn't these instead say $XDG_CONFIG_HOME/...?
Not all of them: $XDG_CONFIG_HOME is not guaranteed to be defined since PR with approach which adds support for XDG_* vars to vim_getenv was rejected.
Most of other stay as-is because I am not fond of explaining WTF is $XDG_CONFIG_HOME and what is its default. I guess we need another section somewhere in documentation (options.txt?) with explanations.
—
Reply to this email directly or view it on GitHub.
There was a problem hiding this comment.
I guess we need another section somewhere in documentation (options.txt?) with explanations.
I think that would be a good idea. It's not too complicated, so I think it should be doable in a paragraph or two, at least as a high level overview.
There was a problem hiding this comment.
I don't think it's necessary to be so specific. It is understood that ~/.config means "what ~/.vim used to mean". And for new users, also, it is easier to understand ~/.config than an env var from the linux desktop standard.
There was a problem hiding this comment.
Eh, probably. Let's not complicate it further.
|
XDG defaults for Windows (reference): + [kXDGConfigHome] = "~\\$CSIDL_LOCAL_APPDATA\\nvim",
+ [kXDGDataHome] = "~\\$CSIDL_LOCAL_APPDATA\\nvim", //same as kXDGConfigHome
+ [kXDGCacheHome] = "~\\$CSIDL_LOCAL_APPDATA\\nvim\\cache",
+ [kXDGRuntimeDir] = "", //I don't know what this is for
+ [kXDGConfigDirs] = "$CSIDL_COMMON_APPDATA\\nvim\\nvim",
+ [kXDGDataDirs] = "$CSIDL_COMMON_APPDATA\\nvim\\nvim", //same as kXDGConfigDirsNote that this does not switch on "roaming" but that is out of scope for now. This should be good enough. |
|
@justinmk Try |
|
Great, will update my nvim version with this branch. Thanks to all involved in this. BTW could #3498 be caused by this? |
|
hey folks, anyone know where the default location for the
|
|
@wbinnssmith In that case, you should place the autoload directory in |
|
@wbinnssmith Location of autoload directory did not change at all. The only thing which did change is the default value of &runtimepath. You may create |
|
@wbinnssmith If you are not using some plugin manager it is now expected that you put Note: putting it into $XDG_CONFIG_HOME/nvim/autoload (which is ~/.config/nvim/autoload by default) will also work, but this is going against XDG spec: |
|
@fmoralesc There is no |
This is exactly what I expected it would be. Thanks 😄 re:
I'm actually trying to use a plugin manager in this case, which would in this case be the only file in |
|
@ZyX-I Sorry, you are right about It's worth noting that |
|
@fmoralesc You are right, I forgot about Additionally users that install Neovim in $HOME may use the same layout: @wbinnssmith Note that I forgot about |
|
@ZyX-I yeah, I resolved my issue — it was unrelated to the I do think that |
|
@wbinnssmith No. I have said why |
Previous instructions are outdated as of neovim/neovim#3470.
There was an upstream change in how the config file locations are handled. So now I must symlink ~/.config/nvim/ -> ~/.dotfiles/nvim/ See: neovim/neovim#3470
This is the replacement for #3198, that fully implements #78, including documentation update, as requested in #3198 (comment).
I have not touched pi_.txt, os_.txt, vi_diff.txt, todo.txt, various.txt files.
Note: since it was not discussed, I assumed that
~/.gvimrcis replaced with$XDG_CONFIG_HOME/nvim/ginit.vim. Unless it is going away though.