-*options.txt* For Vim version 9.1. Last change: 2024 Mar 29
+*options.txt* For Vim version 9.1. Last change: 2024 May 02
VIM REFERENCE MANUAL by Bram Moolenaar
<
*'runtimepath'* *'rtp'* *vimfiles*
'runtimepath' 'rtp' string (default:
- Unix: "$HOME/.vim,
+ Unix: "$HOME/.vim or
+ $XDG_CONFIG_HOME/vim,
$VIM/vimfiles,
$VIMRUNTIME,
$VIM/vimfiles/after,
And any other file searched for with the |:runtime| command.
+ For $XDG_CONFIG_HOME see |xdg-base-dir|.
+
The defaults for most systems are setup to search five locations:
1. In your home directory, for your personal preferences.
2. In a system-wide Vim directory, for preferences from the system
*'viewdir'* *'vdir'*
'viewdir' 'vdir' string (default for Amiga: "home:vimfiles/view",
for Win32: "$HOME/vimfiles/view",
- for Unix: "$HOME/.vim/view",
+ for Unix: "$HOME/.vim/view" or
+ "$XDG_CONFIG_HOME/vim/view"
for macOS: "$VIM/vimfiles/view",
for VMS: "sys$login:vimfiles/view")
global
{not available when compiled without the |+mksession|
feature}
Name of the directory where to store files for |:mkview|.
+ For $XDG_CONFIG_HOME see |xdg-base-dir|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
-*starting.txt* For Vim version 9.1. Last change: 2024 Apr 21
+*starting.txt* For Vim version 9.1. Last change: 2024 May 02
VIM REFERENCE MANUAL by Bram Moolenaar
and `~/.vim/vimrc` file.
*xdg-runtime*
-When the |xdg-vimrc| is used the |'runtimepath'| will be modified accordingly
-to respect the |xdg-base-dir|: >
+When the |xdg-vimrc| is used the 'runtimepath' and 'packpath' options will be
+modified accordingly to respect the |xdg-base-dir|: >
"$XDG_CONFIG_HOME/vim,$VIMRUNTIME,/after,$XDG_CONFIG_HOME/vim/after"
<
options[opt_idx].def_val[VI_DEFAULT] = xdg_rtp;
p_pp = xdg_rtp;
+#if defined(XDG_VDIR) && defined(FEAT_SESSION)
+ if ((opt_idx = findoption((char_u *)"viewdir")) < 0)
+ goto theend;
+
+ options[opt_idx].def_val[VI_DEFAULT] = (char_u *)XDG_VDIR;
+ p_vdir = (char_u *)XDG_VDIR;
+#endif
+
theend:
vim_free(vimrc1);
vim_free(vimrc2);
# define DFLT_VDIR "sys$login:vimfiles/view"
# else
# define DFLT_VDIR "$HOME/.vim/view" // default for 'viewdir'
+# define XDG_VDIR (mch_getenv("XDG_CONFIG_HOME") ? \
+ "$XDG_CONFIG_HOME/vim/view" : "~/.config/vim/view")
# endif
#endif
call assert_match('XfakeHOME/\.vimrc', $MYVIMRC)
call filter(g:, {idx, _ -> idx =~ '^rc'})
call assert_equal(#{rc_one: 'one', rc: '.vimrc'}, g:)
+ call assert_match('XfakeHOME/\.vim/view', &viewdir)
call writefile(v:errors, 'Xresult')
quit
END
call assert_match('XfakeHOME/\.vim/vimrc', $MYVIMRC)
call filter(g:, {idx, _ -> idx =~ '^rc'})
call assert_equal(#{rc_two: 'two', rc: '.vim/vimrc'}, g:)
+ call assert_match('XfakeHOME/\.vim/view', &viewdir)
call writefile(v:errors, 'Xresult')
quit
END
call assert_match('XfakeHOME/\.config/vim/vimrc', $MYVIMRC, msg)
call filter(g:, {idx, _ -> idx =~ '^rc'})
call assert_equal(#{rc_three: 'three', rc: '.config/vim/vimrc'}, g:)
+ call assert_match('XfakeHOME/\.config/vim/view', &viewdir)
call writefile(v:errors, 'Xresult')
quit
END
call assert_match('XfakeHOME/xdg/vim/vimrc', $MYVIMRC, msg)
call filter(g:, {idx, _ -> idx =~ '^rc'})
call assert_equal(#{rc_four: 'four', rc: 'xdg/vim/vimrc'}, g:)
+ call assert_match('XfakeHOME/xdg/vim/view, &viewdir)
call writefile(v:errors, 'Xresult')
quit
END
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 393,
/**/
392,
/**/