[vim/vim] Implementing mechanism to locate user directory (Discussion #15518)

19 views
Skip to first unread message

Luca Saccarola

unread,
Aug 17, 2024, 10:36:28 AM8/17/24
to vim/vim, Subscribed

Hi,
I was finishing the XDG support for vim but I notices that I had to do a lot of checks to see what was the user directory. Having a mechanism to get the user directory regardless of the OS would be a really nice thing.

I think we could implement neovim's stdpath or $MYVIMDIR as suggested by @ghgary here 1

neovim's stdpath

stdpath({what})                                                *stdpath()* *E6100*
		Returns |standard-path| locations of various default files and
		directories.

		{what}       Type    Description ~
		cache        String  Cache directory: arbitrary temporary
		                     storage for plugins, etc.
		config       String  User configuration directory. |init.vim|
		                     is stored here.
		config_dirs  List    Other configuration directories.
		data         String  User data directory.
		data_dirs    List    Other data directories.
		log          String  Logs directory (for use by plugins too).
		run          String  Run directory: temporary, local storage
				     for sockets, named pipes, etc.
		state        String  Session state directory: storage for file
				     drafts, swap, undo, |shada|.

		Example: >vim
			echo stdpath("config")


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/repo-discussions/15518@github.com>

Luca Saccarola

unread,
Aug 21, 2024, 3:40:24 PM8/21/24
to vim/vim, Subscribed

Closed #15518 as resolved.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/repo-discussions/15518/discussion_event/1460511@github.com>

Reply all
Reply to author
Forward
0 new messages