diff options
author | Keerthan Jaic <jckeerthan@gmail.com> | 2015-08-04 21:41:38 -0400 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2015-10-23 14:54:09 +0300 |
commit | c2dd07448ff1b2922e8ea14f909a9cbde481e5fc (patch) | |
tree | 747efd028186695c226327a724fdc1fa72ed5dad /src/nvim/option.c | |
parent | e38cbb93670272d0da15c60222a123b88ec55002 (diff) | |
download | rneovim-c2dd07448ff1b2922e8ea14f909a9cbde481e5fc.tar.gz rneovim-c2dd07448ff1b2922e8ea14f909a9cbde481e5fc.tar.bz2 rneovim-c2dd07448ff1b2922e8ea14f909a9cbde481e5fc.zip |
option,main: Partial support of XDG base directory specification
- Add functions that are able to query XDG.
- Replace defaults for
- &runtimepath. Does not follow #78.
- &viewdir.
- &undodir.
- &directory.
- &backupdir. Does not follow #78.
- vimrc location.
- Remove user vimrc file line from :version message.
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index a578f2bb01..c419e58f7e 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -301,6 +301,15 @@ static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", # include "option.c.generated.h" #endif +static void set_runtimepath_default(void) +{ + garray_T rtp_ga; + ga_init(&rtp_ga, (int)sizeof(const char *), 1); + GA_APPEND(const char *, &rtp_ga, get_user_conf_dir()); + GA_APPEND(const char *, &rtp_ga, concat_fnames(get_user_conf_dir(), "after", true)); + set_string_default("runtimepath", ga_concat_strings(&rtp_ga)); +} + /* * Initialize the options, first part. * @@ -437,6 +446,12 @@ void set_init_1(void) "system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice) . ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error" ); + set_string_default("viewdir", (char_u *)get_from_user_data("view")); + set_string_default("backupdir", (char_u *)get_from_user_data("backup")); + set_string_default("directory", (char_u *)get_from_user_data("swap")); + set_string_default("undodir", (char_u *)get_from_user_data("undo")); + set_runtimepath_default(); + /* * Set all the options (except the terminal options) to their default * value. Also set the global value for local options. |