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

Add XDG_CONFIG_HOME/vim/vimrc support #14167

Closed
wants to merge 1 commit into from
Closed

Add XDG_CONFIG_HOME/vim/vimrc support #14167

wants to merge 1 commit into from

Conversation

diegoviola
Copy link
Contributor

fixes: #2034

fixes: #2034

Signed-off-by: Diego Viola <diego.viola@gmail.com>
@@ -210,6 +210,9 @@ typedef struct dsc$descriptor DESC;
#ifndef SYS_VIMRC_FILE
# define SYS_VIMRC_FILE "$VIM/vimrc"
#endif
#ifndef XDG_VIMRC_FILE
# define XDG_VIMRC_FILE "~/.config/vim/vimrc"
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't even use the $XDG_CONFIG_HOME environment variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zeertzjq yes, I couldn't figure out how to do that yet, first time ever making a change in the vim codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zeertzjq what would you suggest?

Copy link
Member

@zeertzjq zeertzjq Mar 9, 2024

Choose a reason for hiding this comment

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

First, as mentioned in the issue, this should come after USR_VIMRC_FILE2 etc..

And you can use mch_getenv() to check if XDG_CONFIG_HOME environment variable is set. If not, use ~/.config/vim/vimrc, otherwise use $XDG_CONFIG_HOME/vim/vimrc.

Copy link
Contributor Author

@diegoviola diegoviola Mar 9, 2024

Choose a reason for hiding this comment

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

@zeertzjq Thanks, unfortunately I don't have a lot of time at the moment, so I will leave it to someone more experienced to continue.

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.

[RFC] .config/vim(UNIX), AppData/Roaming/vim(Windows) directory structure
2 participants