Introduce dirs.base.data_local helper#415
Open
bltavares wants to merge 1 commit into
Open
Conversation
This commit introduces the `dirs.base.data_local` helper as a templating function. This exposes `directories` [config_local_dir()](https://docs.rs/directories/latest/directories/struct.BaseDirs.html#method.config_local_dir) for using in templating > |Platform | Value | Example | > | ------- | ------------------------------------- | ---------------------------------------- | > | Linux | `$XDG_CONFIG_HOME` or `$HOME`/.config | /home/alice/.config | > | macOS | `$HOME`/Library/Application Support | /Users/Alice/Library/Application Support | > | Windows | `{FOLDERID_LocalAppData}` | C:\Users\Alice\AppData\Local | This is useful for using specially in `nvim` to setup cross-platform config. ```yaml global: links: nvim: {{ dirs.base.data_local }}/nvim ``` This should expand to `~/.config/nvim` in Linux and MacOS, as well as `%USERPROFILE/AppData/Local/nvim` on Windows.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you for the project. The design seems to fit quite nicely with my current
dot-filessetup.I'd like to propose adding a new function to help setup
neovimeasier acrossWindows and Linux/MacOS without having to rely on the per-platform path
declaration.
This PR introduces the
dirs.base.data_localhelper as a templatingfunction.
This exposes
directoriesconfig_local_dir() for using in templating$XDG_CONFIG_HOMEor$HOME/.config$HOME/Library/Application Support{FOLDERID_LocalAppData}This is useful for using specially in
nvimto setup cross-platform config.This should expand to
~/.config/nvimin Linux and MacOS, as well as%USERPROFILE/AppData/Local/nvimon Windows.