On 12-Apr-2013 Bram Moolenaar <[email protected]> wrote:
> 
> Lech Lorens wrote:
> 
> > On 12 April 2013 13:45, Bram Moolenaar <[email protected]> wrote:
> > 
> > >
> > > The updated docs say:
> > >         Unix                $HOME/.gvimrc or $HOME/.vim/gvimrc
> > >         Unix                $HOME/.vimrc or $HOME/.vim/vimrc
> > >
> > > What does that "or" mean?  What if both files exist?
> > >
> > > This is an important thing, where your Vim settings are located.  This
> > > deserves proper explanation, also for beginners.
> > >
> > 
> > OK, I'll update the docs. BTW the docs do not mention the values for VMS.
> > Would you like to have them added as well?
> 
> Yes.  Or we can send an email to the VMS user. :-)

Oh, I didn't realise there were so many of them :-)
I added a note about the order in which the vimrc/gvimrc files are 
searched and which one of them is actually sourced. I didn't add the 
note for VMS.

-- 
Cheers,
Lech

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt
index b2e6a0c..be82a0c 100644
--- a/runtime/doc/gui.txt
+++ b/runtime/doc/gui.txt
@@ -93,10 +93,16 @@ and initialize other things that you may want to set up differently from the
 terminal version.
 
 Recommended place for your personal GUI initializations:
-	Unix		    $HOME/.gvimrc
-	OS/2		    $HOME/.gvimrc or $VIM/.gvimrc
-	MS-DOS and Win32    $HOME/_gvimrc or $VIM/_gvimrc
-	Amiga		    s:.gvimrc or $VIM/.gvimrc
+	Unix		    $HOME/.gvimrc or $HOME/.vim/gvimrc
+	OS/2		    $HOME/.gvimrc, $HOME/vimfiles/gvimrc
+			    or $VIM/.gvimrc
+	MS-DOS and Win32    $HOME/_gvimrc, $HOME/vimfiles/gvimrc
+			    or $VIM/_gvimrc
+	Amiga		    s:.gvimrc, home:.gvimrc, home:vimfiles:gvimrc
+			    or $VIM/.gvimrc
+
+The personal initialization files are searched in the order specified above
+and only the first that is found is read.
 
 There are a number of options which only have meaning in the GUI version of
 Vim.  These are 'guicursor', 'guifont', 'guipty' and 'guioptions'.  They are
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 84dc78b..de827d9 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -754,10 +754,16 @@ accordingly.  Vim proceeds in this order:
 	name.  Also see |vimrc-intro|.
 
 	Recommended place for your personal initializations:
-		Unix		    $HOME/.vimrc
-		OS/2		    $HOME/.vimrc or $VIM/.vimrc (or _vimrc)
-		MS-DOS and Win32    $HOME/_vimrc or $VIM/_vimrc
-		Amiga		    s:.vimrc or $VIM/.vimrc
+		Unix		    $HOME/.vimrc or $HOME/.vim/vimrc
+		OS/2		    $HOME/.vimrc, $HOME/vimfiles/vimrc
+				    or $VIM/.vimrc (or _vimrc)
+		MS-DOS and Win32    $HOME/_vimrc, $HOME/vimfiles/vimrc
+				    or $VIM/_vimrc
+		Amiga		    s:.vimrc, home:.vimrc, home:vimfiles:vimrc
+				    or $VIM/.vimrc
+
+	The personal initialization files are searched in the order specified
+	above and only the first that is found is read.
 
 	If Vim was started with "-u filename", the file "filename" is used.
 	All following initializations until 4. are skipped.
diff --git a/src/gui.c b/src/gui.c
index 1c60b7a..22dfba9 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -547,10 +547,14 @@ gui_init()
 		 && do_source((char_u *)USR_GVIMRC_FILE2, TRUE,
 							  DOSO_GVIMRC) == FAIL
 #endif
+#ifdef USR_GVIMRC_FILE3
+		 && do_source((char_u *)USR_GVIMRC_FILE3, TRUE,
+							  DOSO_GVIMRC) == FAIL
+#endif
 				)
 	    {
-#ifdef USR_GVIMRC_FILE3
-		(void)do_source((char_u *)USR_GVIMRC_FILE3, TRUE, DOSO_GVIMRC);
+#ifdef USR_GVIMRC_FILE4
+		(void)do_source((char_u *)USR_GVIMRC_FILE4, TRUE, DOSO_GVIMRC);
 #endif
 	    }
 
@@ -593,6 +597,10 @@ gui_init()
 			&& fullpathcmp((char_u *)USR_GVIMRC_FILE3,
 				     (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME
 #endif
+#ifdef USR_GVIMRC_FILE4
+			&& fullpathcmp((char_u *)USR_GVIMRC_FILE4,
+				     (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME
+#endif
 			)
 		    do_source((char_u *)GVIMRC_FILE, TRUE, DOSO_GVIMRC);
 
diff --git a/src/main.c b/src/main.c
index d3c54fa..5757ab2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2976,6 +2976,10 @@ source_startup_scripts(parmp)
 		&& do_source((char_u *)USR_VIMRC_FILE3, TRUE,
 							   DOSO_VIMRC) == FAIL
 #endif
+#ifdef USR_VIMRC_FILE4
+		&& do_source((char_u *)USR_VIMRC_FILE4, TRUE,
+							   DOSO_VIMRC) == FAIL
+#endif
 		&& process_env((char_u *)"EXINIT", FALSE) == FAIL
 		&& do_source((char_u *)USR_EXRC_FILE, FALSE, DOSO_NONE) == FAIL)
 	    {
diff --git a/src/os_amiga.h b/src/os_amiga.h
index 69a1523..bcdba32 100644
--- a/src/os_amiga.h
+++ b/src/os_amiga.h
@@ -158,7 +158,10 @@ typedef long off_t;
 # define USR_VIMRC_FILE2 "home:.vimrc"
 #endif
 #ifndef USR_VIMRC_FILE3
-# define USR_VIMRC_FILE3 "$VIM/.vimrc"
+# define USR_VIMRC_FILE3 "home:vimfiles:vimrc"
+#endif
+#ifndef USR_VIMRC_FILE4
+# define USR_VIMRC_FILE4 "$VIM/.vimrc"
 #endif
 #ifndef EVIM_FILE
 # define EVIM_FILE	"$VIMRUNTIME/evim.vim"
@@ -171,7 +174,10 @@ typedef long off_t;
 # define USR_GVIMRC_FILE2 "home:.gvimrc"
 #endif
 #ifndef USR_GVIMRC_FILE3
-# define USR_GVIMRC_FILE3 "$VIM/.gvimrc"
+# define USR_GVIMRC_FILE3 "home:vimfiles:gvimrc"
+#endif
+#ifndef USR_GVIMRC_FILE4
+# define USR_GVIMRC_FILE4 "$VIM/.gvimrc"
 #endif
 
 #ifdef FEAT_VIMINFO
diff --git a/src/os_dos.h b/src/os_dos.h
index 103cded..17246d4 100644
--- a/src/os_dos.h
+++ b/src/os_dos.h
@@ -20,7 +20,10 @@
 # define USR_VIMRC_FILE		"$HOME\\_vimrc"
 #endif
 #ifndef USR_VIMRC_FILE2
-# define USR_VIMRC_FILE2	"$VIM\\_vimrc"
+# define USR_VIMRC_FILE2	"$HOME\\vimfiles\\vimrc"
+#endif
+#ifndef USR_VIMRC_FILE3
+# define USR_VIMRC_FILE3	"$VIM\\_vimrc"
 #endif
 #ifndef EVIM_FILE
 # define EVIM_FILE		"$VIMRUNTIME\\evim.vim"
@@ -41,7 +44,10 @@
 #  define USR_GVIMRC_FILE	"$HOME\\_gvimrc"
 # endif
 # ifndef USR_GVIMRC_FILE2
-#  define USR_GVIMRC_FILE2	"$VIM\\_gvimrc"
+#  define USR_GVIMRC_FILE2	"$HOME\\vimfiles\\gvimrc"
+# endif
+# ifndef USR_GVIMRC_FILE3
+#  define USR_GVIMRC_FILE3	"$VIM\\_gvimrc"
 # endif
 # ifndef SYS_MENU_FILE
 #  define SYS_MENU_FILE		"$VIMRUNTIME\\menu.vim"
diff --git a/src/os_unix.h b/src/os_unix.h
index 3c9224c..02eeafc 100644
--- a/src/os_unix.h
+++ b/src/os_unix.h
@@ -294,11 +294,24 @@ typedef struct dsc$descriptor   DESC;
 # endif
 #endif
 
-#if !defined(USR_VIMRC_FILE2) && defined(OS2)
-# define USR_VIMRC_FILE2 "$VIM/.vimrc"
+
+#if !defined(USR_EXRC_FILE2)
+# ifdef OS2
+#  define USR_VIMRC_FILE2	"$HOME/vimfiles/vimrc"
+# else
+#  ifdef VMS
+#   define USR_VIMRC_FILE2	"sys$login:vimfiles:vimrc"
+#  else
+#    define USR_VIMRC_FILE2	"~/.vim/vimrc"
+#  endif
+# endif
+#endif
+
+#if !defined(USR_VIMRC_FILE3) && defined(OS2)
+# define USR_VIMRC_FILE3 "$VIM/.vimrc"
 #endif
-#if !defined(USR_VIMRC_FILE2) && defined(VMS)
-# define USR_VIMRC_FILE2 "sys$login:_vimrc"
+#if !defined(USR_VIMRC_FILE3) && defined(VMS)
+# define USR_VIMRC_FILE3 "sys$login:_vimrc"
 #endif
 
 #ifndef USR_GVIMRC_FILE
@@ -309,9 +322,21 @@ typedef struct dsc$descriptor   DESC;
 # endif
 #endif
 
+#ifndef USR_GVIMRC_FILE2
+# ifdef OS2
+#  define USR_GVIMRC_FILE2	"$HOME/vimfiles/gvimrc"
+# else
+#  ifdef VMS
+#   define USR_GVIMRC_FILE2	"sys$login:vimfiles:gvimrc"
+#  else
+#   define USR_GVIMRC_FILE2	"~/.vim/gvimrc"
+#  endif
+# endif
+#endif
+
 #ifdef VMS
-# ifndef USR_GVIMRC_FILE2
-#  define USR_GVIMRC_FILE2  "sys$login:_gvimrc"
+# ifndef USR_GVIMRC_FILE3
+#  define USR_GVIMRC_FILE3  "sys$login:_gvimrc"
 # endif
 #endif
 

Raspunde prin e-mail lui