updated for version 7.0002
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 462d66b..9d39f61 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.0aa.  Last change: 2004 Jun 20
+*eval.txt*      For Vim version 7.0aa.  Last change: 2004 Jun 22
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1236,10 +1236,19 @@
 executable({expr})					*executable()*
 		This function checks if an executable with the name {expr}
 		exists.  {expr} must be the name of the program without any
-		arguments.  executable() uses the normal $PATH.
-		On MS-DOS and MS-Windows the ".exe", ".bat", etc. must be
-		included.  It only checks if the file exists and is not a
-		directory, not if it's really executable.
+		arguments.
+		executable() uses the value of $PATH and/or the normal
+		searchpath for programs.		*PATHEXT*
+		On MS-DOS and MS-Windows the ".exe", ".bat", etc. can
+		optionally be included.  Then the extensions in $PATHEXT are
+		tried.  Thus if "foo.exe" does not exist, "foo.exe.bat" can be
+		found.  If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is
+		used.  A dot by itself can be used in $PATHEXT to try using
+		the name without an extension.  When 'shell' looks like a
+		Unix shell, then the name is also tried without adding an
+		extension.
+		On MS-DOS and MS-Windows it only checks if the file exists and
+		is not a directory, not if it's really executable.
 		The result is a Number:
 			1	exists
 			0	does not exist
diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt
index a855d46..21c48d3 100644
--- a/runtime/doc/filetype.txt
+++ b/runtime/doc/filetype.txt
@@ -1,4 +1,4 @@
-*filetype.txt*  For Vim version 7.0aa.  Last change: 2004 May 05
+*filetype.txt*  For Vim version 7.0aa.  Last change: 2004 Jun 24
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -148,7 +148,7 @@
 
 							*new-filetype*
 If a file type that you want to use is not detected yet, there are three ways
-to add it.  In any way, it's better not modify the $VIMRUNTIME/filetype.vim
+to add it.  In any way, it's better not to modify the $VIMRUNTIME/filetype.vim
 file.  It will be overwritten when installing a new version of Vim.
 
 A. If you want to overrule all default file type checks.
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 8028b66..7e13134 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 7.0aa.  Last change: 2004 Jun 16
+*insert.txt*    For Vim version 7.0aa.  Last change: 2004 Jun 24
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -375,6 +375,11 @@
 undo the effect of the backspace key, without changing what you typed before
 that, with CTRL-O u.
 
+Using CTRL-O splits undo: the text typed before and after it is undone
+separately.  If you want to avoid this (e.g., in a mapping) you might be able
+to use CTRL-R = |i_CTRL-R|.  E.g., to call a function: >
+	:imap <F2> <C-R>=MyFunc()<CR>
+
 When the 'whichwrap' option is set appropriately, the <Left> and <Right>
 keys on the first/last character in the line make the cursor wrap to the
 previous/next line.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 0d48e98..297012d 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 7.0aa.  Last change: 2004 Jun 15
+*options.txt*	For Vim version 7.0aa.  Last change: 2004 Jun 21
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -50,7 +50,7 @@
 :se[t] {option}&vim	Reset option to its Vim default value. {not in Vi}
 
 :se[t] all&		Set all options, except terminal options, to their
-			default value.	The values of 'term', 'lines' and
+			default value.  The values of 'term', 'lines' and
 			'columns' are not changed. {not in Vi}
 
 						*:set-args* *E487* *E521*
@@ -140,7 +140,7 @@
 The advantage over a mapping is that it works in all situations.
 
 The listing from ":set" looks different from Vi.  Long string options are put
-at the end of the list.  The number of options is quite large.	The output of
+at the end of the list.  The number of options is quite large.  The output of
 "set all" probably does not fit on the screen, causing Vim to give the
 |more-prompt|.
 
@@ -154,14 +154,14 @@
    :set tags=tags\\,file	    results in "tags\,file"
    :set tags=tags\\\ file	    results in "tags\ file"
 
-The "|" character separates a ":set" command from a following command.	To
-include the "|" in the option value, use "\|" instead.	This example sets the
+The "|" character separates a ":set" command from a following command.  To
+include the "|" in the option value, use "\|" instead.  This example sets the
 'titlestring' option to "hi|there": >
    :set titlestring=hi\|there
 This sets the 'titlestring' option to "hi" and 'iconstring' to "there": >
    :set titlestring=hi|set iconstring=there
 
-For MS-DOS and WIN32 backslashes in file names are mostly not removed.	More
+For MS-DOS and WIN32 backslashes in file names are mostly not removed.  More
 precise: For options that expect a file name (those where environment
 variables are expanded) a backslash before a normal file name character is not
 removed.  But a backslash before a special character (space, backslash, comma,
@@ -172,7 +172,7 @@
    :set dir=\\path\\file	    results in "\\path\file" (wrong!)
 For the first one the start is kept, but for the second one the backslashes
 are halved.  This makes sure it works both when you expect backslashes to be
-halved and when you expect the backslashes to be kept.	The third gives a
+halved and when you expect the backslashes to be kept.  The third gives a
 result which is probably not what you want.  Avoid it.
 
 				*add-option-flags* *remove-option-flags*
@@ -183,12 +183,12 @@
 Remove a flag from an option like this: >
    :set guioptions-=a
 This removes the 'a' flag from 'guioptions'.
-Note that you should add or remove one flag at a time.	If 'guioptions' has
+Note that you should add or remove one flag at a time.  If 'guioptions' has
 the value "ab", using "set guioptions-=ba" won't work, because the string "ba"
 doesn't appear.
 
 			   *:set_env* *expand-env* *expand-environment-var*
-Environment variables in most string options will be expanded.	If the
+Environment variables in most string options will be expanded.  If the
 environment variable exists the '$' and the following environment variable
 name is replaced with its value.  If it does not exist the '$' and the name
 are not modified.  Any non-id character (not a letter, digit or '_') may
@@ -247,7 +247,7 @@
 global value.  Note that if you do this next: >
 	:e one
 You will not get back the 'list' value as it was the last time you edited
-"one".	The options local to a window are not remembered for each buffer.
+"one".  The options local to a window are not remembered for each buffer.
 
 							*:setl* *:setlocal*
 :setl[ocal] ...		Like ":set" but set only the value local to the
@@ -300,7 +300,7 @@
 the 'makeprg' option in the other C source window too.
 However, if you start editing a Perl file in a new window, you want to use
 another 'makeprog' for it, without changing the value used for the C source
-files.	You use this command: >
+files.  You use this command: >
 	:setlocal makeprg=perlmake
 You can switch back to using the global value by making the local value empty: >
 	:setlocal makeprg=
@@ -384,7 +384,7 @@
 				:  fixdel
 				:endif
 <			Where "^V" is CTRL-V and "<BS>" is the backspace key
-			(don't type four characters!).	Replace "termname"
+			(don't type four characters!).  Replace "termname"
 			with your terminal name.
 
 			If your <Delete> key sends a strange key sequence (not
@@ -500,7 +500,7 @@
 If an error is detected the rest of the line is skipped.
 
 If you want to include a ':' in a set command precede it with a '\'.  The
-backslash in front of the ':' will be removed.	Example: >
+backslash in front of the ':' will be removed.  Example: >
    /* vi:set dir=c\:\tmp: */
 This sets the 'dir' option to "c:\tmp".  Only a single backslash before the
 ':' is removed.  Thus to include "\:" you have to specify "\\:".
@@ -529,7 +529,7 @@
 'compatible' is set.
 
 Most options are the same in all windows and buffers.  There are a few that
-are specific to how the text is presented in a window.	These can be set to a
+are specific to how the text is presented in a window.  These can be set to a
 different value in each window.  For example the 'list' option can be set in
 one window and reset in another for the same text, giving both types of view
 at the same time.  There are a few options that are specific to a certain
@@ -546,14 +546,14 @@
 buffer-specific options this depends on the 's' and 'S' flags in the
 'cpoptions' option.  If 's' is included (which is the default) the values for
 buffer options are copied from the currently active buffer when a buffer is
-first entered.	If 'S' is present the options are copied each time the buffer
-is entered, this is almost like having global options.	If 's' and 'S' are not
+first entered.  If 'S' is present the options are copied each time the buffer
+is entered, this is almost like having global options.  If 's' and 'S' are not
 present, the options are copied from the currently active buffer when the
 buffer is created.
 
-Not all options are supported in all versions.	To test if option "foo" can be
-used with ":set" use "exists('&foo')".	This doesn't mean the value is
-actually remembered and works.	Some options are hidden, which means that you
+Not all options are supported in all versions.  To test if option "foo" can be
+used with ":set" use "exists('&foo')".  This doesn't mean the value is
+actually remembered and works.  Some options are hidden, which means that you
 can set them but the value is not remembered.  To test if option "foo" is
 really supported use "exists('+foo')".
 
@@ -597,7 +597,7 @@
 	When off, the keyboard map toggles between Hebrew and English. This
 	is useful to start the Vim in native mode i.e. English (left-to-right
 	mode) and have default second language Farsi or Hebrew (right-to-left
-	mode).	See |farsi.txt|.
+	mode).  See |farsi.txt|.
 
 						*'ambiwidth'* *'ambw'*
 'ambiwidth' 'ambw'	string (default: "single")
@@ -703,9 +703,12 @@
 	Copy indent from current line when starting a new line (typing <CR>
 	in Insert mode or when using the "o" or "O" command).  If you do not
 	type anything on the new line except <BS> or CTRL-D and then type
-	<Esc> or <CR>, the indent is deleted again.  When autoindent is on,
-	formatting (with the "gq" command or when you reach 'textwidth' in
-	Insert mode) uses the indentation of the first line.
+	<Esc> or <CR>, the indent is deleted again.  Moving the cursor to
+	another line has the same effect, unless the 'I' flag is included in
+	'cpoptions'.
+	When autoindent is on, formatting (with the "gq" command or when you
+	reach 'textwidth' in Insert mode) uses the indentation of the first
+	line.
 	When 'smartindent' or 'cindent' is on the indent is changed in
 	a different way.
 	The 'autoindent' option is reset when the 'paste' option is set.
@@ -757,7 +760,7 @@
 	color, see |:hi-normal|.
 
 	When 'background' is set Vim will adjust the default color groups for
-	the new value.	But the colors used for syntax highlighting will not
+	the new value.  But the colors used for syntax highlighting will not
 	change.
 	When a color scheme is loaded (the "colors_name" variable is set)
 	setting 'background' will cause the color scheme to be reloaded.  If
@@ -824,7 +827,7 @@
 	backup file, but you do want a backup while the file is being
 	written, reset this option and set the 'writebackup' option (this is
 	the default).  If you do not want a backup file at all reset both
-	options (use this if your file system is almost full).	See the
+	options (use this if your file system is almost full).  See the
 	|backup-table| for more explanations.
 	When the 'backupskip' pattern matches, a backup is not made anyway.
 	When 'patchmode' is set, the backup may be renamed to become the
@@ -877,13 +880,13 @@
 	One situation where "no" and "auto" will cause problems: A program
 	that opens a file, invokes Vim to edit that file, and then tests if
 	the open file was changed (through the file descriptor) will check the
-	backup file instead of the newly created file.	"crontab -e" is an
+	backup file instead of the newly created file.  "crontab -e" is an
 	example.
 
 	When a copy is made, the original file is truncated and then filled
 	with the new text.  This means that protection bits, owner and
 	symbolic links of the original file are unmodified.  The backup file
-	however, is a new file, owned by the user who edited the file.	The
+	however, is a new file, owned by the user who edited the file.  The
 	group of the backup is set to the group of the original file.  If this
 	fails, the protection bits for the group are made the same as for
 	others.
@@ -1134,7 +1137,7 @@
 	these words, separated by a comma:
 	internal	Use internal case mapping functions, the current
 			locale does not change the case mapping.  This only
-			matters when 'encoding' is a Unicode encoding.	When
+			matters when 'encoding' is a Unicode encoding.  When
 			"internal" is omitted, the towupper() and towlower()
 			system library functions are used when available.
 	keepascii	For the ASCII characters (0x00 to 0x7f) use the US
@@ -1389,7 +1392,7 @@
 	This is a special kind of option, because when it's set or reset,
 	other options are also changed as a side effect.  CAREFUL: Setting or
 	resetting this option can have a lot of unexpected effects: Mappings
-	are interpreted in another way, undo behaves differently, etc.	If you
+	are interpreted in another way, undo behaves differently, etc.  If you
 	set this option in your vimrc file, you should probably put it at the
 	very start.
 	By default this option is on and the Vi defaults are used for the
@@ -1401,7 +1404,7 @@
 	to the Vim defaults.  Effectively, this means that when a ".vimrc"
 	file exists, Vim will use the Vim defaults, otherwise it will use the
 	Vi defaults.  (Note: This doesn't happen for the system-wide vimrc
-	file).	Also see |compatible-default|.
+	file).  Also see |compatible-default|.
 	You can also set this option with the "-C" argument, and reset it with
 	"-N".  See |-C| and |-N|.
 	Switching this option off makes the Vim defaults be used for options
@@ -1409,7 +1412,7 @@
 	marked with a '+' below.  Other options are not modified.
 	At the moment this option is set, several other options will be set
 	or reset to make Vim as Vi-compatible as possible.  See the table
-	below.	This can be used if you want to revert to Vi compatible
+	below.  This can be used if you want to revert to Vi compatible
 	editing.
 	See also 'cpoptions'.
 
@@ -1529,7 +1532,7 @@
 			global
 			{not in Vi}  {only for MS-DOS}
 	When on direct console I/O is used to obtain a keyboard character.
-	This should work in most cases.  Also see |'bioskey'|.	Together,
+	This should work in most cases.  Also see |'bioskey'|.  Together,
 	three methods of console input are available:
 	'conskey'   'bioskey'	    action ~
 	   on	     on or off	    direct console input
@@ -1556,7 +1559,7 @@
 			global
 			{not in Vi}
 	A sequence of single character flags.  When a character is present
-	this indicates vi-compatible behavior.	This is used for things where
+	this indicates vi-compatible behavior.  This is used for things where
 	not being vi-compatible is mostly or sometimes preferred.
 	'cpoptions' stands for "compatible-options".
 	Commas can be added for readability.
@@ -1635,6 +1638,9 @@
 								*cpo-i*
 		i	When included, interrupting the reading of a file will
 			leave it modified.
+								*cpo-I*
+		I	When moving the cursor up or down just after inserting
+			indent for 'autoindent', do not delete the indent.
 								*cpo-j*
 		j	When joining lines, only add two spaces after a '.',
 			not after '!' or '?'.  Also see 'joinspaces'.
@@ -1698,7 +1704,7 @@
 								*cpo-s*
 		s	Set buffer options when entering the buffer for the
 			first time.  This is like it is in Vim version 3.0.
-			And it is the default.	If not present the options are
+			And it is the default.  If not present the options are
 			set when the buffer is created.
 								*cpo-S*
 		S	Set buffer options always when entering a buffer
@@ -1719,7 +1725,7 @@
 			the history for search pattern, but doesn't change the
 			last used search pattern.
 								*cpo-u*
-		u	Undo is Vi compatible.	See |undo-two-ways|.
+		u	Undo is Vi compatible.  See |undo-two-ways|.
 								*cpo-v*
 		v	Backspaced characters remain visible on the screen in
 			Insert mode.  Without this flag the characters are
@@ -1763,14 +1769,14 @@
 			specially.  When matching a paren outside of quotes,
 			everything inside quotes is ignored.  When matching a
 			paren inside quotes, it will find the matching one (if
-			there is one).	This works very well for C programs.
+			there is one).  This works very well for C programs.
 								*cpo-star*
 		*	Use ":*" in the same way as ":@".  When not included,
 			":*" is an alias for ":'<,'>", select the Visual area.
 								*cpo-<*
 		<	Disable the recognition of special key codes in |<>|
 			form in mappings, abbreviations, and the "to" part of
-			menu commands.	For example, the command
+			menu commands.  For example, the command
 			":map X <Tab>" results in X being mapped to:
 				'<' included:	"<Tab>"  (5 characters)
 				'<' excluded:	"^I"	 (^I is a real <Tab>)
@@ -1845,7 +1851,7 @@
 'define' 'def'		string	(default "^\s*#\s*define")
 			global or local to buffer |global-local|
 			{not in Vi}
-	Pattern to be used to find a macro definition.	It is a search
+	Pattern to be used to find a macro definition.  It is a search
 	pattern, just like for the "/" command.  This option is used for the
 	commands like "[i" and "[d" |include-search|.  The 'isident' option is
 	used to recognize the defined name after the match:
@@ -1882,7 +1888,7 @@
 	contain a list of words.  This can be one word per line, or several
 	words per line, separated by non-keyword characters (white space is
 	preferred).  Maximum line length is 510 bytes.
-	To include a comma in a file name precede it with a backslash.	Spaces
+	To include a comma in a file name precede it with a backslash.  Spaces
 	after a comma are ignored, otherwise spaces are included in the file
 	name.  See |option-backslash| about using backslashes.
 	Where to find a list of words?
@@ -1901,7 +1907,7 @@
 			{not available when compiled without the |+diff|
 			feature}
 	Join the current window in the group of windows that shows differences
-	between files.	See |vimdiff|.
+	between files.  See |vimdiff|.
 
 						*'dex'* *'diffexpr'*
 'diffexpr' 'dex'	string	(default "")
@@ -1920,7 +1926,7 @@
 			{not in Vi}
 			{not available when compiled without the |+diff|
 			feature}
-	Option settings for diff mode.	It can consist of the following items.
+	Option settings for diff mode.  It can consist of the following items.
 	All are optional.  Items must be separated by a comma.
 
 		filler		Show filler lines, to keep the text
@@ -2014,7 +2020,7 @@
 	Change the way text is displayed.  This is comma separated list of
 	flags:
 	lastline	When included, as much as possible of the last line
-			in a window will be displayed.	When not included, a
+			in a window will be displayed.  When not included, a
 			last line that doesn't fit is replaced with "@" lines.
 	uhex		Show unprintable characters hexadecimal as <xx>
 			instead of using ^C and ~C.
@@ -2058,12 +2064,12 @@
 	"utf-8".  Although care has been taken to allow different values of
 	'encoding', "utf-8" is the natural choice for the environment and
 	avoids unnecessary conversion overhead.  "utf-8" has not been made
-	the default to prevent different behaviour of the GUI and terminal
+	the default to prevent different behavior of the GUI and terminal
 	versions, and to avoid changing the encoding of newly created files
 	without your knowledge (in case 'fileencodings' is empty).
 
 	The character encoding of files can be different from 'encoding'.
-	This is specified with 'fileencoding'.	The conversion is done with
+	This is specified with 'fileencoding'.  The conversion is done with
 	iconv() or as specified with 'charconvert'.
 
 	Normally 'encoding' will be equal to your current locale.  This will
@@ -2101,7 +2107,7 @@
 			local to buffer
 			{not in Vi}
 	When writing a file and this option is off and the 'binary' option
-	is on, no <EOL> will be written for the last line in the file.	This
+	is on, no <EOL> will be written for the last line in the file.  This
 	option is automatically set when starting to edit a new file, unless
 	the file does not have an <EOL> for the last line in the file, in
 	which case it is reset.  Normally you don't have to set or reset this
@@ -2116,7 +2122,7 @@
 			global
 			{not in Vi}
 	When on, all the windows are automatically made the same size after
-	splitting or closing a window.	When off, splitting a window will
+	splitting or closing a window.  When off, splitting a window will
 	reduce the size of the current window and leave the other windows the
 	same.  When closing a window the extra lines are given to the window
 	next to it (depending on 'splitbelow' and 'splitright').
@@ -2133,7 +2139,7 @@
 	External program to use for "=" command.  When this option is empty
 	the internal formatting functions are used ('lisp', 'cindent' or
 	'indentexpr').
-	Environment variables are expanded |:set_env|.	See |option-backslash|
+	Environment variables are expanded |:set_env|.  See |option-backslash|
 	about including spaces and backslashes.
 	This option cannot be set from a |modeline| or in the |sandbox|, for
 	security reasons.
@@ -2144,7 +2150,7 @@
 	Ring the bell (beep or screen flash) for error messages.  This only
 	makes a difference for error messages, the bell will be used always
 	for a lot of errors without a message (e.g., hitting <Esc> in Normal
-	mode).	See 'visualbell' on how to make the bell behave like a beep,
+	mode).  See 'visualbell' on how to make the bell behave like a beep,
 	screen flash or do nothing.
 
 						*'errorfile'* *'ef'*
@@ -2204,7 +2210,7 @@
 			local to buffer
 			{not in Vi}
 	In Insert mode: Use the appropriate number of spaces to insert a
-	<Tab>.	Spaces are used in indents with the '>' and '<' commands and
+	<Tab>.  Spaces are used in indents with the '>' and '<' commands and
 	when 'autoindent' is on.  To insert a real tab when 'expandtab' is
 	on, use CTRL-V<Tab>.  See also |:retab| and |ins-expandtab|.
 	NOTE: This option is reset when 'compatible' is set.
@@ -2256,7 +2262,7 @@
 
 							*'fe'*
 	NOTE: Before version 6.0 this option specified the encoding for the
-	whole of Vim, this was a mistake.  Now use 'encoding' instead.	The
+	whole of Vim, this was a mistake.  Now use 'encoding' instead.  The
 	old short name was 'fe', which is no longer used.
 
 					*'fileencodings'* *'fencs'*
@@ -2270,7 +2276,7 @@
 	an existing file.  When a file is read, Vim tries to use the first
 	mentioned character encoding.  If an error is detected, the next one
 	in the list is tried.  When an encoding is found that works,
-	'fileencoding' is set to it.	If all fail, 'fileencoding' is set to
+	'fileencoding' is set to it.  If all fail, 'fileencoding' is set to
 	an empty string, which means the value of 'encoding' is used.
 		WARNING: Conversion can cause loss of information!  When
 		'encoding' is "utf-8" (or one of the other Unicode variants)
@@ -2344,7 +2350,7 @@
 	- When empty, the format defined with 'fileformat' will be used
 	  always.  It is not set automatically.
 	- When set to one name, that format will be used whenever a new buffer
-	  is opened.  'fileformat' is set accordingly for that buffer.	The
+	  is opened.  'fileformat' is set accordingly for that buffer.  The
 	  'fileformats' name will be used when a file is read into an existing
 	  buffer, no matter what 'fileformat' for that buffer is set to.
 	- When more than one name is present, separated by commas, automatic
@@ -2353,7 +2359,7 @@
 	  1. If all lines end in <CR><NL>, and 'fileformats' includes "dos",
 	     'fileformat' is set to "dos".
 	  2. If a <NL> is found and 'fileformats' includes "unix", 'fileformat'
-	     is set to "unix".	Note that when a <NL> is found without a
+	     is set to "unix".  Note that when a <NL> is found without a
 	     preceding <CR>, "unix" is preferred over "dos".
 	  3. If 'fileformats' includes "mac", 'fileformat' is set to "mac".
 	     This means that "mac" is only chosen when "unix" is not present,
@@ -2424,7 +2430,7 @@
 	  fold:c	'-'		filling 'foldtext'
 	  diff:c	'-'		deleted lines of the 'diff' option
 
-	Any one that is omitted will fall back to the default.	For "stl" and
+	Any one that is omitted will fall back to the default.  For "stl" and
 	"stlnc" the space will be used when there is highlighting, '^' or '-'
 	otherwise.
 
@@ -2449,7 +2455,7 @@
 			feature}
 	When on, the keyboard is mapped for the Farsi character set.
 	Normally you would set 'allowrevins' and use CTRL-_ in insert mode to
-	toggle this option |i_CTRL-_|.	See |farsi.txt|.
+	toggle this option |i_CTRL-_|.  See |farsi.txt|.
 
 						*'foldclose'* *'fcl'*
 'foldclose' 'fcl'	string (default "")
@@ -2481,7 +2487,7 @@
 	When off, all folds are open.  This option can be used to quickly
 	switch between showing all text unfolded and viewing the text with
 	folds (including manually opened or closed folds).  It can be toggled
-	with the |zi| command.	The 'foldcolumn' will remain blank when
+	with the |zi| command.  The 'foldcolumn' will remain blank when
 	'foldenable' is off.
 	This option is set by commands that create a new fold or close a fold.
 	See |folding|.
@@ -2504,7 +2510,7 @@
 			feature}
 	Used only when 'foldmethod' is "indent".  Lines starting with
 	characters in 'foldignore' will get their fold level from surrounding
-	lines.	White space is skipped before checking for this character.
+	lines.  White space is skipped before checking for this character.
 	The default "#" works well for C programs.  See |fold-indent|.
 
 						*'foldlevel'* *'fdl'*
@@ -2529,7 +2535,7 @@
 	Useful to always start editing with all folds closed (value zero),
 	some folds closed (one) or no folds closed (99).
 	This is done before reading any modeline, thus a setting in a modeline
-	overrules this option.	Starting to edit a file for |diff-mode| also
+	overrules this option.  Starting to edit a file for |diff-mode| also
 	ignores this option and closes all folds.
 	It is also done before BufReadPre autocommands, to allow an autocmd to
 	overrule the 'foldlevel' value for specific files.
@@ -2605,7 +2611,7 @@
 				(not for a search pattern in a ":" command)
 		tag		jumping to a tag: ":ta", CTRL-T, etc.
 		undo		undo or redo: "u" and CTRL-R
-	When the command is part of a mapping this option is not used.	Add
+	When the command is part of a mapping this option is not used.  Add
 	the |zv| command to the mapping to get the same effect.
 	When a movement command is used for an operator (e.g., "dl" or "y%")
 	this option is not used.  This means the operator will include the
@@ -2715,12 +2721,12 @@
 			{only available when compiled with GUI enabled, and
 			for MS-DOS and Win32 console}
 	This option tells Vim what the cursor should look like in different
-	modes.	It fully works in the GUI.  In an MSDOS or Win32 console, only
+	modes.  It fully works in the GUI.  In an MSDOS or Win32 console, only
 	the height of the cursor can be changed.  This can be done by
 	specifying a block cursor, or a percentage for a vertical or
 	horizontal cursor.
 
-	The option is a comma separated list of parts.	Each part consist of a
+	The option is a comma separated list of parts.  Each part consist of a
 	mode-list and an argument-list:
 		mode-list:argument-list,mode-list:argument-list,..
 	The mode-list is a dash separated list of these modes:
@@ -2901,7 +2907,7 @@
 	If set and valid, 'guifontwide' is always used for double width
 	characters, even if 'encoding' is not set to "utf-8".
 	Vim does not attempt to find an appropriate value for 'guifontwide'
-	automatically.	If 'guifontwide' is empty Pango/Xft will choose the
+	automatically.  If 'guifontwide' is empty Pango/Xft will choose the
 	font for characters not available in 'guifont'.  Thus you do not need
 	to set 'guifontwide' at all unless you want to override the choice
 	made by Pango/Xft.
@@ -2913,7 +2919,7 @@
 	The number of pixels subtracted from the screen height when fitting
 	the GUI window on the screen.  Set this before the GUI is started,
 	e.g., in your |gvimrc| file.  When zero, the whole screen height will
-	be used by the window.	When positive, the specified number of pixel
+	be used by the window.  When positive, the specified number of pixel
 	lines will be left for window decorations and other items on the
 	screen.  Set it to a negative value to allow windows taller than the
 	screen.
@@ -2947,7 +2953,7 @@
 		by a yank or delete operation for the "* register.
 		The same applies to the modeless selection.
 
-	  'A'	Autoselect for the modeless selection.	Like 'a', but only
+	  'A'	Autoselect for the modeless selection.  Like 'a', but only
 		applies to the modeless selection.
 
 		    'guioptions'   autoselect Visual  autoselect modeless ~
@@ -2972,7 +2978,7 @@
 		limitations of X11.  For a color icon, see |X11-icon|.
 
 	  'm'	Menu bar is present.
-	  'M'	The system menu "$VIMRUNTIME/menu.vim" is not sourced.	Note
+	  'M'	The system menu "$VIMRUNTIME/menu.vim" is not sourced.  Note
 		that this flag must be added in the .vimrc file, before
 		switching on syntax or filetype recognition (when the .gvimrc
 		file is sourced the system menu has already been loaded; the
@@ -3009,7 +3015,7 @@
 		the right moment, try adding this flag.  This must be done
 		before starting the GUI.  Set it in your gvimrc.  Adding or
 		removing it after the GUI has started has no effect.
-	  'F'	Add a footer.  Only for Motif.	See |gui-footer|.
+	  'F'	Add a footer.  Only for Motif.  See |gui-footer|.
 
 						*'guipty'* *'noguipty'*
 'guipty'		boolean	(default on)
@@ -3029,7 +3035,7 @@
 	in 'runtimepath' will be used.
 	Environment variables are expanded |:set_env|.  For example:
 	"$VIMRUNTIME/doc/help.txt".  If $VIMRUNTIME is not set, $VIM is also
-	tried.	Also see |$VIMRUNTIME| and |option-backslash| about including
+	tried.  Also see |$VIMRUNTIME| and |option-backslash| about including
 	spaces and backslashes.
 	This option cannot be set from a |modeline| or in the |sandbox|, for
 	security reasons.
@@ -3075,7 +3081,7 @@
 	The commands that move through the buffer list sometimes make a buffer
 	hidden although the 'hidden' option is off: When the buffer is
 	modified, 'autowrite' is off or writing is not possible, and the '!'
-	flag was used.	See also |windows.txt|.
+	flag was used.  See also |windows.txt|.
 	This option is set for one command with ":hide {command}" |:hide|.
 	WARNING: It's easy to forget that you have changes in hidden buffers.
 	Think twice when using ":q!" or ":qa!".
@@ -3095,7 +3101,7 @@
 	This option can be used to set highlighting mode for various
 	occasions.  It is a comma separated list of character pairs.  The
 	first character in a pair gives the occasion, the second the mode to
-	use for that occasion.	The occasions are:
+	use for that occasion.  The occasions are:
 	|hl-SpecialKey|	 8  Meta and special keys listed with ":map"
 	|hl-NonText|	 @  '~' and '@' at the end of the window and
 			    characters from 'showbreak'
@@ -3158,7 +3164,7 @@
 	highlighting comes back.
 	When the search pattern can match an end-of-line, Vim will try to
 	highlight all of the matched text.  However, this depends on where the
-	search starts.	This will be the first line in the window or the first
+	search starts.  This will be the first line in the window or the first
 	line below a closed fold.  A match in a previous line which is not
 	drawn may not continue in an newly drawn line.
 	NOTE: This option is reset when 'compatible' is set.
@@ -3227,7 +3233,7 @@
 	When Vim was compiled with HAVE_X11 defined, the original icon will be
 	restored if possible |X11|.
 	When this option contains printf-style '%' items, they will be
-	expanded according to the rules used for 'statusline'.	See
+	expanded according to the rules used for 'statusline'.  See
 	'titlestring' for example settings.
 	{not available when compiled without the |+statusline| feature}
 
@@ -3342,7 +3348,7 @@
 			{not in Vi}
 			{not available when compiled without the
 			|+find_in_path| feature}
-	Pattern to be used to find an include command.	It is a search
+	Pattern to be used to find an include command.  It is a search
 	pattern, just like for the "/" command (See |pattern|).  The default
 	value is for C programs.  This option is used for the commands "[i",
 	"]I", "[d", etc..  The 'isfname' option is used to recognize the file
@@ -3356,12 +3362,12 @@
 			{not available when compiled without the
 			|+find_in_path| or |+eval| feature}
 	Expression to be used to transform the string found with the 'include'
-	option to a file name.	Mostly useful to change "." to "/" for Java: >
+	option to a file name.  Mostly useful to change "." to "/" for Java: >
 		:set includeexpr=substitute(v:fname,'\\.','/','g')
 <	The "v:fname" variable will be set to the file name that was detected.
 	Evaluated in the |sandbox|.
 	Also used for the |gf| command if an unmodified file name can't be
-	found.	Allows doing "gf" on the name after an 'include' statement.
+	found.  Allows doing "gf" on the name after an 'include' statement.
 	Also used for |<cfile>|.
 
 				 *'incsearch'* *'is'* *'noincsearch'* *'nois'*
@@ -3371,11 +3377,11 @@
 			{not available when compiled without the
 			|+extra_search| feature}
 	While typing a search command, show immediately where the so far
-	typed pattern matches.	The matched string is highlighted.  If the
+	typed pattern matches.  The matched string is highlighted.  If the
 	pattern is invalid or not found, nothing is shown.  The screen will
 	be updated often, this is only useful on fast terminals.  Note that
 	the match will be shown, but the cursor is not actually positioned
-	there.	You still need to finish the search command with <CR> to move
+	there.  You still need to finish the search command with <CR> to move
 	the cursor.  The highlighting can be set with the 'i' flag in
 	'highlight'.  See also: 'hlsearch'.
 	NOTE: This option is reset when 'compatible' is set.
@@ -3472,7 +3478,7 @@
 			{not in Vi}
 	The characters specified by this option are included in file names and
 	path names.  Filenames are used for commands like "gf", "[i" and in
-	the tags file.	It is also used for "\f" in a |pattern|.
+	the tags file.  It is also used for "\f" in a |pattern|.
 	Multi-byte characters 256 and above are always included, only the
 	characters up to 255 are specified with this option.
 	For UTF-8 the characters 0xa0 to 0xff are included as well.
@@ -3486,8 +3492,8 @@
 	cmd.exe.
 
 	The format of this option is a list of parts, separated with commas.
-	Each part can be a single character number or a range.	A range is two
-	character numbers with '-' in between.	A character number can be a
+	Each part can be a single character number or a range.  A range is two
+	character numbers with '-' in between.  A character number can be a
 	decimal number between 0 and 255 or the ASCII character itself (does
 	not work for digits).  Example:
 		"_,-,128-140,#-43"	(include '_' and '-' and the range
@@ -3524,7 +3530,7 @@
 	|pattern|. See 'isfname' for a description of the format of this
 	option.
 	Careful: If you change this option, it might break expanding
-	environment variables.	E.g., when '/' is included and Vim tries to
+	environment variables.  E.g., when '/' is included and Vim tries to
 	expand "$HOME/.viminfo".  Maybe you should change 'iskeyword' instead.
 
 						*'iskeyword'* *'isk'*
@@ -3535,7 +3541,7 @@
 			local to buffer
 			{not in Vi}
 	Keywords are used in searching and recognizing with many commands:
-	"w", "*", "[i", etc.  It is also used for "\k" in a |pattern|.	See
+	"w", "*", "[i", etc.  It is also used for "\k" in a |pattern|.  See
 	'isfname' for a description of the format of this option.  For C
 	programs you could use "a-z,A-Z,48-57,_,.,-,>".
 	For a help file it is set to all non-blank printable characters except
@@ -3650,7 +3656,7 @@
 			{only available when compiled with the |+langmap|
 			feature}
 	This option allows switching your keyboard into a special language
-	mode.	When you are typing text in Insert mode the characters are
+	mode.  When you are typing text in Insert mode the characters are
 	inserted directly.  When in command mode the 'langmap' option takes
 	care of translating these special characters to the original meaning
 	of the key.  This means you don't have to change the keyboard mode to
@@ -3730,7 +3736,7 @@
 			{not in Vi}
 	When this option is set, the screen will not be redrawn while
 	executing macros, registers and other commands that have not been
-	typed.	Also, updating the window title is postponed.  To force an
+	typed.  Also, updating the window title is postponed.  To force an
 	update use |:redraw|.
 
 			*'linebreak'* *'lbr'* *'nolinebreak'* *'nolbr'*
@@ -3811,7 +3817,7 @@
 'listchars' 'lcs'	string	(default "eol:$")
 			global
 			{not in Vi}
-	Strings to use in 'list' mode.	It is a comma separated list of string
+	Strings to use in 'list' mode.  It is a comma separated list of string
 	settings.
 	  eol:c		Character to show at the end of each line.  When
 			omitted, there is no extra character at the end of the
@@ -3821,7 +3827,7 @@
 			fill the space that the Tab normally occupies.
 			"tab:>-" will show a Tab that takes four spaces as
 			">---".  When omitted, a Tab is show as ^I.
-	  trail:c	Character to show for trailing spaces.	When omitted,
+	  trail:c	Character to show for trailing spaces.  When omitted,
 			trailing spaces are blank.
 	  extends:c	Character to show in the last column, when 'wrap' is
 			off and the line continues beyond the right of the
@@ -3830,7 +3836,7 @@
 			is off and there is text preceding the character
 			visible in the first column.
 
-	The characters ':' and ',' should not be used.	UTF-8 characters can
+	The characters ':' and ',' should not be used.  UTF-8 characters can
 	be used when 'encoding' is "utf-8", otherwise only printable
 	characters are allowed.
 
@@ -3902,7 +3908,7 @@
 			local to buffer
 			{not in Vi}
 	Characters that form pairs.  The |%| command jumps from one to the
-	other.	Currently only single character pairs are allowed, and they
+	other.  Currently only single character pairs are allowed, and they
 	must be different.  The characters must be separated by a colon.  The
 	pairs must be separated by a comma.  Example for including '<' and '>'
 	(HTML): >
@@ -3961,7 +3967,7 @@
 			global
 			{not in Vi}
 	Maximum amount of memory (in Kbyte) to use for all buffers together.
-	Maximum value 2000000.	Use this to work without a limit.  Also see
+	Maximum value 2000000.  Use this to work without a limit.  Also see
 	'maxmem'.
 
 						*'menuitems'* *'mis'*
@@ -4048,7 +4054,7 @@
 	See |mouse-using|.  Also see |'clipboard'|.
 
 	Note: When enabling the mouse in a terminal, copy/paste will use the
-	"* register if there is access to an X-server.	The xterm handling of
+	"* register if there is access to an X-server.  The xterm handling of
 	the mouse buttons can still be used by keeping the shift key pressed.
 	Also see the 'clipboard' option.
 
@@ -4235,11 +4241,11 @@
 'paste'			boolean	(default off)
 			global
 			{not in Vi}
-	Put Vim in Paste mode.	This is useful if you want to cut or copy
-	some text from one window and paste it in Vim.	This will avoid
+	Put Vim in Paste mode.  This is useful if you want to cut or copy
+	some text from one window and paste it in Vim.  This will avoid
 	unexpected effects.
 	Setting this option is useful when using Vim in a terminal, where Vim
-	cannot distinguish between typed text and pasted text.	In the GUI, Vim
+	cannot distinguish between typed text and pasted text.  In the GUI, Vim
 	knows about pasting and will mostly do the right thing without 'paste'
 	being set.  The same is true for a terminal where Vim handles the
 	mouse clicks itself.
@@ -4300,7 +4306,7 @@
 			{not available when compiled without the |+diff|
 			feature}
 	Expression which is evaluated to apply a patch to a file and generate
-	the resulting new version of the file.	See |diff-patchexpr|.
+	the resulting new version of the file.  See |diff-patchexpr|.
 
 						*'patchmode'* *'pm'* *E206*
 'patchmode' 'pm'	string	(default "")
@@ -4370,7 +4376,7 @@
 		:set path=.,c:/include
 <	Don't forget "." or files won't even be found in the same directory as
 	the file!
-	The maximum length is limited.	How much depends on the system, mostly
+	The maximum length is limited.  How much depends on the system, mostly
 	it is something like 256 or 1024 characters.
 	You can check if all the include files are found, using the value of
 	'path', see |:checkpath|.
@@ -4419,7 +4425,7 @@
 			{not in Vi}
 			{not available when compiled without the |+windows| or
 			|+quickfix| feature}
-	Identifies the preview window.	Only one window can have this option
+	Identifies the preview window.  Only one window can have this option
 	set.  It's normally not set directly, but by using one of the commands
 	|:ptag|, |:pedit|, etc.
 
@@ -4733,14 +4739,14 @@
 			{not available when compiled without the
 			|+cmdline_info| feature}
 	Show the line and column number of the cursor position, separated by a
-	comma.	When there is room, the relative position of the displayed
+	comma.  When there is room, the relative position of the displayed
 	text in the file is shown on the far right:
 		Top	first line is visible
 		Bot	last line is visible
 		All	first and last line are visible
 		45%	relative position in the file
 	If 'rulerformat' is set, it will determine the contents of the ruler.
-	Each window has its own ruler.	If a window has a status line, the
+	Each window has its own ruler.  If a window has a status line, the
 	ruler is shown there.  Otherwise it is shown in the last line of the
 	screen.  If the statusline is given by 'statusline' (ie. not empty),
 	this option takes precedence over 'ruler' and 'rulerformat'
@@ -4833,7 +4839,7 @@
 
 	Note that, unlike 'path', no wildcards like "**" are allowed.  Normal
 	wildcards are allowed, but can significantly slow down searching for
-	runtime files.	For speed, use as few items as possible and avoid
+	runtime files.  For speed, use as few items as possible and avoid
 	wildcards.
 	See |:runtime|.
 	Example: >
@@ -4856,7 +4862,7 @@
 	Number of lines to scroll with CTRL-U and CTRL-D commands.  Will be
 	set to half the number of lines in the window when the window size
 	changes.  If you give a count to the CTRL-U or CTRL-D command it will
-	be used as the new value for 'scroll'.	Reset to half the window
+	be used as the new value for 'scroll'.  Reset to half the window
 	height with ":set scroll=0".   {Vi is a bit different: 'scroll' gives
 	the number of screen lines instead of file lines, makes a difference
 	when lines wrap}
@@ -4945,7 +4951,7 @@
 	displayed.  Switch it off only if you know that you will not run into
 	problems, or when the 'exrc' option is off.  On Unix this option is
 	only used if the ".vimrc" or ".exrc" is not owned by you.  This can be
-	dangerous if the systems allows users to do a "chown".	You better set
+	dangerous if the systems allows users to do a "chown".  You better set
 	'secure' at the end of your ~/.vimrc then.
 	This option cannot be set from a |modeline| or in the |sandbox|, for
 	security reasons.
@@ -5035,14 +5041,14 @@
 	Name of the shell to use for ! and :! commands.  When changing the
 	value also check these options: 'shelltype', 'shellpipe', 'shellslash'
 	'shellredir', 'shellquote', 'shellxquote' and 'shellcmdflag'.
-	It is allowed to give an argument to the command, e.g.	"csh -f".
+	It is allowed to give an argument to the command, e.g.  "csh -f".
 	See |option-backslash| about including spaces and backslashes.
 	Environment variables are expanded |:set_env|.
 	If the name of the shell contains a space, you might need to enclose
 	it in quotes.  Example: >
 		:set shell=\"c:\program\ files\unix\sh.exe\"\ -f
 <	Note the backslash before each quote (to avoid starting a comment) and
-	each space (to avoid ending the option value).	Also note that the
+	each space (to avoid ending the option value).  Also note that the
 	"-f" is not inside the quotes, because it is not part of the command
 	name.  And Vim automagically recognizes the backslashes that are path
 	separators.
@@ -5080,7 +5086,7 @@
 			{not available when compiled without the |+quickfix|
 			feature}
 	String to be used to put the output of the ":make" command in the
-	error file.  See also |:make_makeprg|.	See |option-backslash| about
+	error file.  See also |:make_makeprg|.  See |option-backslash| about
 	including spaces and backslashes.
 	The name of the temporary file can be represented by "%s" if necessary
 	(the file name is appended automatically if no %s appears in the value
@@ -5209,7 +5215,7 @@
 						*'shiftwidth'* *'sw'*
 'shiftwidth' 'sw'	number	(default 8)
 			local to buffer
-	Number of spaces to use for each step of (auto)indent.	Used for
+	Number of spaces to use for each step of (auto)indent.  Used for
 	|'cindent'|, |>>|, |<<|, etc.
 
 						*'shortmess'* *'shm'*
@@ -5298,7 +5304,7 @@
 			{not in Vi}
 			{not available when compiled without the
 			|+cmdline_info| feature}
-	Show (partial) command in status line.	Set this option off if your
+	Show (partial) command in status line.  Set this option off if your
 	terminal is slow.
 	In Visual mode the size of the selected area is shown:
 	- When selecting characters within a line, the number of characters.
@@ -5313,7 +5319,7 @@
 			{not in Vi}
 	When completing a word in insert mode (see |ins-completion|) from the
 	tags file, show both the tag name and a tidied-up form of the search
-	pattern (if there is one) as possible matches.	Thus, if you have
+	pattern (if there is one) as possible matches.  Thus, if you have
 	matched a C function, you can see a template for what arguments are
 	required (coding style permitting).
 
@@ -5340,7 +5346,7 @@
 	If in Insert, Replace or Visual mode put a message on the last line.
 	Use the 'M' flag in 'highlight' to set the type of highlighting for
 	this message.
-	When |XIM| may be used the message will include "XIM".	But this
+	When |XIM| may be used the message will include "XIM".  But this
 	doesn't mean XIM is really active, especially when 'imactivatekey' is
 	not set.
 	NOTE: This option is set to the Vi default value when 'compatible' is
@@ -5386,7 +5392,7 @@
 	Override the 'ignorecase' option if the search pattern contains upper
 	case characters.  Only used when the search pattern is typed and
 	'ignorecase' option is on.  Used for the commands "/", "?", "n", "N",
-	":g" and ":s".	Not used for "*", "#", "gd", tag search, etc..	After
+	":g" and ":s".  Not used for "*", "#", "gd", tag search, etc..  After
 	"*" and "#" you can make 'smartcase' used by doing a "/" command,
 	recalling the search pattern from history and hitting <Enter>.
 	NOTE: This option is reset when 'compatible' is set.
@@ -5411,11 +5417,11 @@
 	given the same indent as the matching '{'.
 	When typing '#' as the first character in a new line, the indent for
 	that line is removed, the '#' is put in the first column.  The indent
-	is restored for the next line.	If you don't want this, use this
+	is restored for the next line.  If you don't want this, use this
 	mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H.
 	When using the ">>" command, lines starting with '#' are not shifted
 	right.
-	NOTE: 'smartindent' is reset when 'compatible' is set.	When 'paste'
+	NOTE: 'smartindent' is reset when 'compatible' is set.  When 'paste'
 	is set smart indenting is disabled.
 
 				 *'smarttab'* *'sta'* *'nosmarttab'* *'nosta'*
@@ -5475,7 +5481,7 @@
 			{not in Vi}
 	When "on" the commands listed below move the cursor to the first
 	blank of the line.  When off the cursor is kept in the same column
-	(if possible).	This applies to the commands: CTRL-D, CTRL-U, CTRL-B,
+	(if possible).  This applies to the commands: CTRL-D, CTRL-U, CTRL-B,
 	CTRL-F, "G", "H", "M", "L", , and to the commands "d", "<<" and ">>"
 	with a linewise operator, with "%" with a count and to buffer changing
 	commands (CTRL-^, :bnext, :bNext, etc.).  Also for an Ex command that
@@ -5508,7 +5514,7 @@
 	0	    Leading zeroes in numeric items. Overridden by '-'.
 	minwid	    Minimum width of the item, padding as set by '-' & '0'.
 		    Value must be 50 or less.
-	maxwid	    Maximum width of the item.	Truncation occurs with a '<'
+	maxwid	    Maximum width of the item.  Truncation occurs with a '<'
 		    on the left for text items.  Numeric items will be
 		    shifted down to maxwid-2 digits followed by '>'number
 		    where number is the amount of missing digits, much like
@@ -5551,7 +5557,7 @@
 	L N   Number of lines in buffer.
 	c N   Column number.
 	v N   Virtual column number.
-	V N   Virtual column number as -{num}.	Not displayed if equal to 'c'.
+	V N   Virtual column number as -{num}.  Not displayed if equal to 'c'.
 	p N   Percentage through file in lines as in |CTRL-G|.
 	P S   Percentage through file of displayed window.  This is like the
 	      percentage described for 'ruler'.  Always 3 in length.
@@ -5573,7 +5579,7 @@
 
 	Display of flags are controlled by the following heuristic:
 	If a flag text starts with comma it is assumed that it wants to
-	separate itself from anything but preceding plaintext.	If it starts
+	separate itself from anything but preceding plaintext.  If it starts
 	with a space it is assumed that it wants to separate itself from
 	anything but other flags.  That is: A leading comma is removed if the
 	preceding character stems from plaintext.  A leading space is removed
@@ -5631,8 +5637,8 @@
 			{not in Vi}
 	Files with these suffixes get a lower priority when multiple files
 	match a wildcard.  See |suffixes|.  Commas can be used to separate the
-	suffixes.  Spaces after the comma are ignored.	A dot is also seen as
-	the start of a suffix.	To avoid a dot or comma being recognized as a
+	suffixes.  Spaces after the comma are ignored.  A dot is also seen as
+	the start of a suffix.  To avoid a dot or comma being recognized as a
 	separator, precede it with a backslash (see |option-backslash| about
 	including spaces and backslashes).
 	See 'wildignore' for completely ignoring files.
@@ -5654,7 +5660,7 @@
 'swapfile' 'swf'	boolean (default on)
 			local to buffer
 			{not in Vi}
-	Use a swapfile for the buffer.	This option can be reset when a
+	Use a swapfile for the buffer.  This option can be reset when a
 	swapfile is not wanted for a specific buffer.  For example, with
 	confidential information that even root must not be able to access.
 	Careful: All text will be in memory:
@@ -5675,7 +5681,7 @@
 			global
 			{not in Vi}
 	When this option is not empty a swap file is synced to disk after
-	writing to it.	This takes some time, especially on busy unix systems.
+	writing to it.  This takes some time, especially on busy unix systems.
 	When this option is empty parts of the swap file may be in memory and
 	not written to disk.  When the system crashes you may lose more work.
 	On Unix the system does a sync now and then without Vim asking for it,
@@ -5742,7 +5748,7 @@
 	   'expandtab'.  This way you will always insert spaces.  The
 	   formatting will never be messed up when 'tabstop' is changed.
 	3. Set 'tabstop' and 'shiftwidth' to whatever you prefer and use a
-	   |modeline| to set these values when editing the file again.	Only
+	   |modeline| to set these values when editing the file again.  Only
 	   works when using Vim to edit the file.
 	4. Always set 'tabstop' and 'shiftwidth' to the same value, and
 	   'noexpandtab'.  This should then work (for initial indents only)
@@ -5756,7 +5762,7 @@
 			global
 			{not in Vi}
 	When searching for a tag (e.g., for the |:ta| command), Vim can either
-	use a binary search or a linear search in a tags file.	Binary
+	use a binary search or a linear search in a tags file.  Binary
 	searching makes searching for a tag a LOT faster, but a linear search
 	will find more tags if the tags file wasn't properly sorted.
 	Vim normally assumes that your tags files are sorted, or indicate that
@@ -5764,7 +5770,7 @@
 	'tagbsearch' option need to be switched off.
 
 	When 'tagbsearch' is on, binary searching is first used in the tags
-	files.	In certain situations, Vim will do a linear search instead for
+	files.  In certain situations, Vim will do a linear search instead for
 	certain files, or retry all files with a linear search.  When
 	'tagbsearch' is off, only a linear search is done.
 
@@ -5950,8 +5956,8 @@
 			{not in Vi}
 	Maximum width of text that is being inserted.  A longer line will be
 	broken after white space to get this width.  A zero value disables
-	this.  'textwidth' is set to 0 when the 'paste' option is set.	When
-	'textwidth' is zero, 'wrapmargin' may be used.	See also
+	this.  'textwidth' is set to 0 when the 'paste' option is set.  When
+	'textwidth' is zero, 'wrapmargin' may be used.  See also
 	'formatoptions' and |ins-textwidth|.
 	NOTE: This option is set to 0 when 'compatible' is set.
 
@@ -5960,13 +5966,13 @@
 			global or local to buffer |global-local|
 			{not in Vi}
 	List of file names, separated by commas, that are used to lookup words
-	for thesaurus completion commands |i_CTRL-X_CTRL-T|.	Each line in
+	for thesaurus completion commands |i_CTRL-X_CTRL-T|.  Each line in
 	the file should contain words with similar meaning, separated by
 	non-keyword characters (white space is preferred).  Maximum line
 	length is 510 bytes.
 	To obtain a file to be used here, check out the wordlist FAQ at
 	http://www.hyphenologist.co.uk .
-	To include a comma in a file name precede it with a backslash.	Spaces
+	To include a comma in a file name precede it with a backslash.  Spaces
 	after a comma are ignored, otherwise spaces are included in the file
 	name.  See |option-backslash| about using backslashes.
 	The use of |:set+=| and |:set-=| is preferred when adding or removing
@@ -6083,8 +6089,8 @@
 			{not available when compiled without the |+title|
 			feature}
 	Gives the percentage of 'columns' to use for the length of the window
-	title.	When the title is longer, only the end of the path name is
-	shown.	A '<' character before the path name is used to indicate this.
+	title.  When the title is longer, only the end of the path name is
+	shown.  A '<' character before the path name is used to indicate this.
 	Using a percentage makes this adapt to the width of the window.  But
 	it won't work perfectly, because the actual number of characters
 	available also depends on the font used and other things in the title
@@ -6124,7 +6130,7 @@
 	Some people prefer to have the file name first: >
     :set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:~:.:h\")})%)%(\ %a%)
 <	Note the use of "%{ }" and an expression to get the path of the file,
-	without the file name.	The "%( %)" constructs are used to add a
+	without the file name.  The "%( %)" constructs are used to add a
 	separating space only when needed.
 	NOTE: Use of special characters in 'titlestring' may cause the display
 	to be garbled (e.g., when it contains a CR or NL character).
@@ -6135,12 +6141,12 @@
 			global
 			{only for |+GUI_GTK|, |+GUI_Athena|, |+GUI_Motif| and
 			|+GUI_Photon|}
-	The contents of this option controls various toolbar settings.	The
+	The contents of this option controls various toolbar settings.  The
 	possible values are:
 		icons		Toolbar buttons are shown with icons.
 		text		Toolbar buttons shown with text.
 		horiz		Icon and text of a toolbar button are
-				horizontally arranged.	{only in GTK+ 2 GUI}
+				horizontally arranged.  {only in GTK+ 2 GUI}
 		tooltips	Tooltips are active for toolbar buttons.
 	Tooltips refer to the popup help text which appears after the mouse
 	cursor is placed over a toolbar button for a brief moment.
@@ -6352,7 +6358,7 @@
 			{not available when compiled without the +mksession
 			feature}
 	Changes the effect of the |:mkview| command.  It is a comma separated
-	list of words.	Each word enables saving and restoring something:
+	list of words.  Each word enables saving and restoring something:
 	   word		save and restore ~
 	   cursor	cursor position in file and in window
 	   folds	manually created folds, opened/closed folds and local
@@ -6378,7 +6384,7 @@
 			{not available when compiled without the  |+viminfo|
 			feature}
 	When non-empty, the viminfo file is read upon startup and written
-	when exiting Vim (see |viminfo-file|).	The string should be a comma
+	when exiting Vim (see |viminfo-file|).  The string should be a comma
 	separated list of parameters, each consisting of a single character
 	identifying the particular parameter, followed by a number or string
 	which specifies the value of that parameter.  If a particular
@@ -6397,7 +6403,7 @@
 	%	When included, save and restore the buffer list.  If Vim is
 		started with a file name argument, the buffer list is not
 		restored.  If Vim is started without a file name argument, the
-		buffer list is restored from the viminfo file.	Buffers
+		buffer list is restored from the viminfo file.  Buffers
 		without a file name and buffers for help files are not written
 		to the viminfo file.
 	'	Maximum number of previously edited files for which the marks
@@ -6406,23 +6412,23 @@
 		Including this item also means that the |jumplist| and the
 		|changelist| are stored in the viminfo file.
 	/	Maximum number of items in the search pattern history to be
-		saved.	If non-zero, then the previous search and substitute
+		saved.  If non-zero, then the previous search and substitute
 		patterns are also saved.  When not included, the value of
 		'history' is used.
 	:	Maximum number of items in the command-line history to be
-		saved.	When not included, the value of 'history' is used.
+		saved.  When not included, the value of 'history' is used.
 	<	Maximum number of lines saved for each register.  If zero then
 		registers are not saved.  When not included, all lines are
 		saved.  '"' is the old name for this item.
 		Also see the 's' item below: limit specified in Kbyte.
 	@	Maximum number of items in the input-line history to be
-		saved.	When not included, the value of 'history' is used.
+		saved.  When not included, the value of 'history' is used.
 	c	When included, convert the text in the viminfo file from the
 		'encoding' used when writing the file to the current
 		'encoding'. See |viminfo-encoding|.
 	f	Whether file marks need to be stored.  If zero, file marks ('0
 		to '9, 'A to 'Z) are not stored.  When not present or when
-		non-zero, they are all stored.	'0 is used for the current
+		non-zero, they are all stored.  '0 is used for the current
 		cursor position (when exiting or when doing ":wviminfo").
 	h	Disable the effect of 'hlsearch' when loading the viminfo
 		file.  When not included, it depends on whether ":nohlsearch"
@@ -6631,7 +6637,7 @@
 			global
 			{not in Vi}
 	Completion mode that is used for the character specified with
-	'wildchar'.  It is a comma separated list of up to four parts.	Each
+	'wildchar'.  It is a comma separated list of up to four parts.  Each
 	part specifies what to do for each consecutive use of 'wildchar.  The
 	first part specifies the behavior for the first use of 'wildchar',
 	The second part for the second use, etc.
@@ -6678,7 +6684,7 @@
 	  yes	ALT key handling is done by the windowing system.  ALT key
 		combinations cannot be mapped.
 	  menu	Using ALT in combination with a character that is a menu
-		shortcut key, will be handled by the windowing system.	Other
+		shortcut key, will be handled by the windowing system.  Other
 		keys can be mapped.
 	If the menu is disabled by excluding 'm' from 'guioptions', the ALT
 	key is never used for the menu.
@@ -6692,7 +6698,7 @@
 			{not available when compiled without the +windows
 			feature}
 	Minimal number of lines for the current window.  This is not a hard
-	minimum, Vim will use fewer lines if there is not enough room.	If the
+	minimum, Vim will use fewer lines if there is not enough room.  If the
 	current window is smaller, its size is increased, at the cost of the
 	height of other windows.  Set it to 999 to make the current window
 	always fill the screen (although this has the drawback that ":all"
@@ -6771,8 +6777,8 @@
 	This option changes how text is displayed.  It doesn't change the text
 	in the buffer, see 'textwidth' for that.
 	When on, lines longer than the width of the window will wrap and
-	displaying continues on the next line.	When off lines will not wrap
-	and only part of long lines will be displayed.	When the cursor is
+	displaying continues on the next line.  When off lines will not wrap
+	and only part of long lines will be displayed.  When the cursor is
 	moved to a part that is not shown, the screen will scroll
 	horizontally.
 	The line will be broken in the middle of a word if necessary.  See
@@ -6805,7 +6811,7 @@
 			{not in Vi}
 	Allows writing files.  When not set, writing a file is not allowed.
 	Can be used for a view-only mode, where modifications to the text are
-	still allowed.	Can be reset with the |-m| or |-M| command line
+	still allowed.  Can be reset with the |-m| or |-M| command line
 	argument.  Filtering text is still possible, even though this requires
 	writing a temporary file.
 
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 5aee401..f2fa8f6 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -1,4 +1,4 @@
-*repeat.txt*    For Vim version 7.0aa.  Last change: 2004 Apr 02
+*repeat.txt*    For Vim version 7.0aa.  Last change: 2004 Jun 22
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -467,6 +467,13 @@
 		Set a breakpoint in a sourced file.  Example: >
 			:breakadd file 43 .vimrc
 
+:breaka[dd] here
+		Set a breakpoint in the current line of the current file.
+		Like doing: >
+			:breakadd file <cursor-line> <current-file>
+<		Note that this only works for commands that are executed when
+		sourcing the file, not for a function defined in that file.
+
 The [lnum] is the line number of the breakpoint.  Vim will stop at or after
 this line.  When omitted line 1 is used.
 
@@ -501,6 +508,9 @@
 :breakd[el] file [lnum] {name}
 		Delete a breakpoint in a sourced file.
 
+:breakd[el] here
+		Delete a breakpoint at the current line of the current file.
+
 When [lnum] is omitted, the first breakpoint in the function or file is
 deleted.
 The {name} must be exactly the same as what was typed for the ":breakadd"
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index d5d44df..ea6dea2 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 7.0aa.  Last change: 2004 Jun 20
+*todo.txt*      For Vim version 7.0aa.  Last change: 2004 Jun 24
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -30,6 +30,8 @@
 							*known-bugs*
 -------------------- Known bugs and current work -----------------------
 
+Change for fsync() error in Vim 6 as patch?
+
 For version 7.0:
 -   Include many PATCHES:
     9   Merge in ideas from tutor.txt (Gabriel Zachmann)
@@ -59,7 +61,7 @@
 	InsmodLeave	    Taro Muraoka, 2004 Jun 16
     -   Include the kvim patch. http://freenux.org/vim/ (Mickael Marchand)
 	Do not add Qtopia yet, it doesn't work very well.
-	Mickael will update the patch before 21st.
+	update from Mickael 2004 Jun 20.
     8   Unix: When libcall() fails there is no clear error message.  Johannes
 	Zellner has a patch for this.
 	updated patch 2004 June 16.
@@ -88,7 +90,8 @@
     7   Completion of network shares, patch by Yasuhiro Matsumoto.
 	Update 2004 Jun 17.
     8   Patches from Peter "Rain Dog" Cucka:
-	- guifont selector (2002 Dec 15)  will send update
+	- guifont selector (2002 Dec 15)
+	  update 2004 Jun 20
     7   Add an option to set the width of the 'number' column.  Eight
 	positions is often more than needed.  Or adjust the width to the
 	length of the file?
@@ -215,11 +218,6 @@
     7   Motif: use the menu font consistently.  Patch from Martin Dalecki 2002
 	Jan 11.
     -   Motif: add 3D shading for the menu entries?  Patch from Martin Dalecki.
-    9   When 'autoindent' is set, hitting <CR> twice, while there is text after
-	the cursor, doesn't delete the autoindent in the resulting blank line.
-	(Rich Wales) This is Vi compatible, but it looks like a bug.  Rich has
-	a suggestion for a patch to fix this.
-	e-mail to Rich bounced.
     7   For Visual mode: Command to do a search for the string in the marked
 	area.  Only when fewer than two lines. Use "g/" and "gb".  Patch from
 	Yegappan Lakshmanan.
@@ -260,6 +258,12 @@
 	ispell inside Vim).  Gautam Iyer has an example with "aspell".
 	"engspchk" from Charles Campbell is a good way.  Support for
 	approximate-regexps will help (agrep http://www.tgries.de/agrep/).
+	- Charles Campbell asks for method to add "contained" groups to
+	  existing syntax items (to add @Spell).  Add ":syntax contains
+	  {pattern} add=@Spell" command?  A bit like ":syn cluster" but change
+	  the contains list directly for matching syntax items.
+        - Keep wordlist in syntax group, load it only once and use it several
+	  times later.  Sort of global syntax items.
 -   REFACTORING: The main() function is very long.  Move parts to separate
     functions, especially loops.  Ideas from Walter Briscoe (2003 Apr 3, 2004
     Feb 9).
@@ -302,6 +306,11 @@
     Especially when using the scrollbar.  Typing a cursor-movement command
     scrolls back to where the cursor is.
 8   Support four composing characters, needed for Hebrew. (Ron Aaron)
+-   Add a few more things to 'diffopt': "horizontal", "vertical",
+    "foldcolumn". (Benji Fisher, 2004 Jun 21)
+-   FileChangedShellPost autocommand event: after (not) reloading a changed
+    file.  Can be used to update statusline oslt.
+-   Displaying size of Visual area: use 24-33 column display.
 
 
 Vi incompatibility:
@@ -1111,6 +1120,8 @@
 -   GTK: When pasting a selection from Vim to xclipboard gvim crashes with a
     ABRT signal.  Probably an error in the file gdkselection.c, the assert
     always fails when XmbTextListToTextProperty() fails. (Tom Allard)
+-   GTK 2: gives an assertion error for every non-builtin icon in the toolbar.
+    This is a GTK 2.4.x bug, fixed in GTK 2.4.2. (Thomas de Grenier de Latour)
 -   When using an xterm that supports the termresponse feature, and the 't_Co'
     termcap option was wrong when Vim started, it will be corrected when the
     termresponse is received.  Since the number of colors changes, the
@@ -2171,6 +2182,9 @@
 
 
 Insert mode:
+9   When 'autoindent' is set, hitting <CR> twice, while there is text after
+    the cursor, doesn't delete the autoindent in the resulting blank line.
+    (Rich Wales) This is Vi compatible, but it looks like a bug.
 8   When using CTRL-O in Insert mode, then executing an insert command
     "a" or "i", should we return to Insert mode after <Esc>? (Eggink)
     Perhaps it can be allowed a single time, to be able to do
@@ -3299,8 +3313,6 @@
 -   Implement 'redraw' option.
 -   Add special code to 'sections' option to define something else but '{' or
     '}' as the start of a section (e.g. one shiftwidth to the right).
--   Add 'indent' option: Always use this amount of indent when starting a new
-    line and when formatting text.
 -   Use pipes for filtering on Unix.  Requires using fork() to be able to read
     and write at the same time, or some select() mechanism.
 7   Allow using Vim in a pipe: "ls | vim -u xxx.vim - | yyy".  Only needs
diff --git a/runtime/doc/usr_05.txt b/runtime/doc/usr_05.txt
index ee9eba4..47396cc 100644
--- a/runtime/doc/usr_05.txt
+++ b/runtime/doc/usr_05.txt
@@ -1,4 +1,4 @@
-*usr_05.txt*	For Vim version 7.0aa.  Last change: 2004 Mar 12
+*usr_05.txt*	For Vim version 7.0aa.  Last change: 2004 Jun 24
 
 		     VIM USER MANUAL - by Bram Moolenaar
 
@@ -369,8 +369,8 @@
 	mv thefile ~/.vim/ftplugin/stuff_too.vim
 
 The underscore is used to separate the name of the filetype from the rest,
-which can be anything.  If you would use "otherstuff.vim" it wouldn't work, it
-would be loaded for the "otherstuff" filetype.
+which can be anything.  If you use "otherstuff.vim" it wouldn't work, it would
+be loaded for the "otherstuff" filetype.
 
 On MS-DOS you cannot use long filenames.  You would run into trouble if you
 add a second plugin and the filetype has more than six characters.  You can
@@ -505,7 +505,7 @@
 	:help 'wrap'
 
 In case you have messed up an option value, you can set it back to the
-default by putting a ampersand (&) after the option name.  Example: >
+default by putting an ampersand (&) after the option name.  Example: >
 
 	:set iskeyword&
 
@@ -514,8 +514,8 @@
 
 Vim normally wraps long lines, so that you can see all of the text.  Sometimes
 it's better to let the text continue right of the window.  Then you need to
-scroll the text left-right to see all of a long line.  Switch wrapping of with
-this command: >
+scroll the text left-right to see all of a long line.  Switch wrapping off
+with this command: >
 
 	:set nowrap
 
diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt
index 46bff9a..e366f07 100644
--- a/runtime/doc/version7.txt
+++ b/runtime/doc/version7.txt
@@ -1,4 +1,4 @@
-*version7.txt*  For Vim version 7.0aa.  Last change: 2004 Jun 07
+*version7.txt*  For Vim version 7.0aa.  Last change: 2004 Jun 24
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -32,6 +32,20 @@
 These changes are incompatible with previous releases.  Check this list if you
 run into a problem when upgrading from Vim 6.x to 7.0
 
+":helpgrep" now uses a help window to display a match.
+
+
+Minor incompatibilities:
+
+For filetype detection: For many types, instead of ~/.dir/filename use
+*/.dir/filename, so that it also works for other user's files.
+
+":0verbose" now sets 'verbose' to zero instead of one.
+
+Removed the old and incomplete "VimBuddy" code.
+
+Buffers without a name report "No Name" instead of "No File".  It was
+confusing for buffers with a name and 'buftype' set to "nofile".
 
 ==============================================================================
 NEW FEATURES						*new-7*
@@ -68,10 +82,21 @@
 
 New Syntax files: ~
 
+Others: ~
+
+Mac: Add the selection type to the clipboard, so that Block, line and
+character selections can be used between two Vims. (Eckehard Berns)
+Also fixes the problem that setting 'clipboard' to "unnamed" breaks using
+"yyp".
 
 ==============================================================================
 IMPROVEMENTS						*improvements-7*
 
+":helpgrep" accepts a language specifier after the pattern: "pat@it".
+
+":breakadd here" and ":breakdel here" can be used to set or delete a
+breakpoint at the cursor.
+
 
 ==============================================================================
 COMPILE TIME CHANGES					*compile-changes-7*
@@ -80,5 +105,51 @@
 ==============================================================================
 BUG FIXES						*bug-fixes-7*
 
+When using PostScript printing on MS-DOS the default 'printexpr' used "lpr"
+instead of "copy".  When 'printdevice' was empty the copy command did not
+work.  Use "LPT1" then.
+
+The GTK font dialog uses a font size zero when the font name doesn't include a
+size.  Use a default size of 10.
+
+This example in the documentation didn't work:
+    :e `=foo . ".c" `
+Skip over the expression in `=expr` when looking for comments, |, % and #.
+
+When ":helpgrep" doesn't find anything there is no error message.
+
+"L" and "H" did not take closed folds into account.
+
+Win32: The "-P title" argument stopped at the first title that matched, even
+when it doesn't support MDI.
+
+Mac GUI: CTRL-^ and CTRL-@ did not work.
+
+"2daw" on "word." at the end of a line didn't include the preceding white
+space.
+
+Win32: Using FindExecutable() doesn't work to find a program.  Use
+SearchPath() instead.  For executable() use $PATHEXT when the program searched
+for doesn't have an extension.
+
+When 'virtualedit' is set, moving the cursor up after appending a character
+may move it to a different column.  Was caused by auto-formatting moving the
+cursor and not putting it back where it was.
+
+When indent was added automatically and then moving the cursor, the indent was
+not deleted (like when pressing ESC).  The "I" flag in 'cpoptions' can be used
+to make it work the old way.
+
+When <Space> is mapped to something that starts with a space, typing <Space>
+does not expand abbreviations.  Only disable expanding abbreviations when a
+mapping is not remapped, not when the RHS starts with the LHS.
+
+When opening a command-line window, 'textwidth' gets set to 78 by the Vim
+filetype plugin.  Reset 'textwidth' to 0 to avoid lines are broken.
+
+After using cursor(line, col) moving up/down doesn't keep the same column.
+
+Win32: Borland C before 5.5 requires using ".u." for LowPart and HighPart
+fields. (Walter Briscoe)
 
  vim:tw=78:ts=8:ft=help:norl:
diff --git a/runtime/plugin/explorer.vim b/runtime/plugin/explorer.vim
index 4a5b605..e0fcb33 100644
--- a/runtime/plugin/explorer.vim
+++ b/runtime/plugin/explorer.vim
@@ -1,7 +1,7 @@
 "=============================================================================
 " File: explorer.vim
 " Author: M A Aziz Ahmed (aziz@acorn-networks.com - doesn't work)
-" Last Change:	2004 May 13
+" Last Change:	2004 Jun 22
 " Version: 2.5 + changes
 " Additions by Mark Waggoner (waggoner@aracnet.com) et al.
 "-----------------------------------------------------------------------------
@@ -647,7 +647,7 @@
     let b:maxFileLen = 0
     0
     /^"=/+1,$g/^/call s:MarkDirs()
-    normal! `t
+    keepjumps normal! `t
     call s:AddFileInfo()
   endif
 
@@ -840,7 +840,7 @@
   call s:AddSeparators()
 
   " return to start
-  normal! `t
+  keepjumps normal! `t
 
   let &sc = save_sc
 endfunction
@@ -973,7 +973,7 @@
   " Go back where we came from if possible
   0
   if line("'t") != 0
-    normal! `t
+    keepjumps normal! `t
   endif
 
   let &report=oldRep
diff --git a/runtime/plugin/netrw.vim b/runtime/plugin/netrw.vim
index fdb6d27..60dec43 100644
--- a/runtime/plugin/netrw.vim
+++ b/runtime/plugin/netrw.vim
@@ -1,18 +1,18 @@
-" netrw.vim: (global plugin) Handles file transfer across a network
-" Last Change:	Jun 18, 2004
+" netrw.vim: Handles file transfer and remote directory listing across a network
+" Last Change:	Jun 24, 2004
 " Maintainer:	Charles E. Campbell, Jr. PhD   <drchipNOSPAM at campbellfamily.biz>
-" Version:	46
+" Version:	47c	NOT RELEASED
 " License:	Vim License  (see vim's :help license)
 "
 "  But be doers of the word, and not only hearers, deluding your own selves
 "  (James 1:22 RSV)
 " =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
-" Exit quickly when already loaded or when 'compatible' is set.
+" Exit quickly when already loaded or when 'compatible' is set. {{{1
 if exists("loaded_netrw") || &cp
   finish
 endif
-let loaded_netrw = "v46"
+let loaded_netrw = "v47c"
 let s:save_cpo   = &cpo
 set cpo&vim
 
@@ -70,7 +70,7 @@
 endif
 if !exists("g:netrw_list_cmd")
  if executable("ssh")
-  let g:netrw_list_cmd= "ssh HOSTNAME ls -Fa"
+  let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
  else
 "  call Decho("ssh is not executable, can't do netlist")
   let g:netrw_list_cmd= ""
@@ -104,13 +104,13 @@
  augroup Network
   au!
   if has("win32")
-   au BufReadCmd  file://*		exe "doau BufReadPre ".expand("<afile>")|exe 'e '.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
+   au BufReadCmd  file://*		exe "silent doau BufReadPre ".expand("<afile>")|exe 'e '.substitute(expand("<afile>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<afile>")
   else
-   au BufReadCmd  file:///*		exe "doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
-   au BufReadCmd  file://localhost/*	exe "doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "doau BufReadPost ".expand("<afile>")
+   au BufReadCmd  file:///*		exe "silent doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<afile>")
+   au BufReadCmd  file://localhost/*	exe "silent doau BufReadPre ".expand("<afile>")|exe 'e /'.substitute(expand("<afile>"),"file:/*","","")|exe "silent doau BufReadPost ".expand("<afile>")
   endif
-  au BufReadCmd  ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://*	exe "doau BufReadPre ".expand("<afile>")|exe "Nread 0r ".expand("<afile>")|exe "doau BufReadPost ".expand("<afile>")
-  au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://*	exe "doau BufReadPre ".expand("<afile>")|exe "Nread "   .expand("<afile>")|exe "doau BufReadPost ".expand("<afile>")
+  au BufReadCmd  ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://*	exe "silent doau BufReadPre ".expand("<afile>")|exe "Nread 0r ".expand("<afile>")|exe "silent doau BufReadPost ".expand("<afile>")
+  au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://*	exe "silent doau BufReadPre ".expand("<afile>")|exe "Nread "   .expand("<afile>")|exe "silent doau BufReadPost ".expand("<afile>")
   au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://*    		exe "Nwrite "  .expand("<afile>")|call <SID>NetRestorePosn()
  augroup END
 endif
@@ -160,146 +160,585 @@
 " ------------------------------------------------------------------------
 " NetRead: responsible for reading a file over the net {{{1
 fun! s:NetRead(...)
-" call Dfunc("NetRead(a:1<".a:1.">)")
-
- " save options
- call s:NetOptionSave()
-
- " Special Exception: if a file is named "0r", then
- "		      "0r" will be used to read the
- "		      following files instead of "r"
- if	a:0 == 0
-  let readcmd= "r"
-  let ichoice= 0
- elseif a:1 == "0r"
-  let readcmd = "0r"
-  let ichoice = 2
- else
-  let readcmd = "r"
-  let ichoice = 1
- endif
-
- " get name of a temporary file
- let tmpfile= tempname()
-
-" call Decho("ichoice=".ichoice." readcmd<".readcmd.">")
- while ichoice <= a:0
-
-  " attempt to repeat with previous host-file-etc
-  if exists("b:netrw_lastfile") && a:0 == 0
-"   call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
-   let choice = b:netrw_lastfile
-   let ichoice= ichoice + 1
-
+"  call Dfunc("NetRead(a:1<".a:1.">)")
+ 
+  " save options
+  call s:NetOptionSave()
+ 
+  " Special Exception: if a file is named "0r", then
+  "		      "0r" will be used to read the
+  "		      following files instead of "r"
+  if	a:0 == 0
+   let readcmd= "r"
+   let ichoice= 0
+  elseif a:1 == "0r"
+   let readcmd = "0r"
+   let ichoice = 2
   else
-   exe "let choice= a:" . ichoice
-"   call Decho("no lastfile: choice<" . choice . ">")
-
-   " Reconstruct Choice if choice starts with '"'
-   if match(choice,"?") == 0
-    echo 'NetRead Usage:'
-    echo ':Nread machine:path                         uses rcp'
-    echo ':Nread "machine path"                       uses ftp   with <.netrc>'
-    echo ':Nread "machine id password path"           uses ftp'
-    echo ':Nread dav://machine[:port]/path            uses cadaver'
-    echo ':Nread fetch://machine/path                 uses fetch'
-    echo ':Nread ftp://[user@]machine[:port]/path     uses ftp   autodetects <.netrc>'
-    echo ':Nread http://[user@]machine/path           uses http  wget'
-    echo ':Nread rcp://[user@]machine/path            uses rcp'
-    echo ':Nread rsync://machine[:port]/path          uses rsync'
-    echo ':Nread scp://[user@]machine[[:#]port]/path  uses scp'
-    echo ':Nread sftp://[user@]machine[[:#]port]/path uses sftp'
-    break
-   elseif match(choice,"^\"") != -1
-"    call Decho("reconstructing choice")
-    if match(choice,"\"$") != -1
-     " case "..."
-     let choice=strpart(choice,1,strlen(choice)-2)
-    else
-      "  case "... ... ..."
-     let choice      = strpart(choice,1,strlen(choice)-1)
-     let wholechoice = ""
-
-     while match(choice,"\"$") == -1
-      let wholechoice = wholechoice . " " . choice
-      let ichoice     = ichoice + 1
-      if ichoice > a:0
-       echoerr "Unbalanced string in filename '". wholechoice ."'"
-"       call Dret("NetRead")
-       return
-      endif
-      let choice= a:{ichoice}
-     endwhile
-     let choice= strpart(wholechoice,1,strlen(wholechoice)-1) . " " . strpart(choice,0,strlen(choice)-1)
+   let readcmd = "r"
+   let ichoice = 1
+  endif
+ 
+  " get name of a temporary file
+  let tmpfile= tempname()
+ 
+"  call Decho("ichoice=".ichoice." readcmd<".readcmd.">")
+  while ichoice <= a:0
+ 
+   " attempt to repeat with previous host-file-etc
+   if exists("b:netrw_lastfile") && a:0 == 0
+"    call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
+    let choice = b:netrw_lastfile
+    let ichoice= ichoice + 1
+ 
+   else
+    exe "let choice= a:" . ichoice
+"    call Decho("no lastfile: choice<" . choice . ">")
+ 
+    " Reconstruct Choice if choice starts with '"'
+    if match(choice,"?") == 0
+     echo 'NetRead Usage:'
+     echo ':Nread machine:path                         uses rcp'
+     echo ':Nread "machine path"                       uses ftp   with <.netrc>'
+     echo ':Nread "machine id password path"           uses ftp'
+     echo ':Nread dav://machine[:port]/path            uses cadaver'
+     echo ':Nread fetch://machine/path                 uses fetch'
+     echo ':Nread ftp://[user@]machine[:port]/path     uses ftp   autodetects <.netrc>'
+     echo ':Nread http://[user@]machine/path           uses http  wget'
+     echo ':Nread rcp://[user@]machine/path            uses rcp'
+     echo ':Nread rsync://machine[:port]/path          uses rsync'
+     echo ':Nread scp://[user@]machine[[:#]port]/path  uses scp'
+     echo ':Nread sftp://[user@]machine[[:#]port]/path uses sftp'
+     break
+    elseif match(choice,"^\"") != -1
+"     call Decho("reconstructing choice")
+     if match(choice,"\"$") != -1
+      " case "..."
+      let choice=strpart(choice,1,strlen(choice)-2)
+     else
+       "  case "... ... ..."
+      let choice      = strpart(choice,1,strlen(choice)-1)
+      let wholechoice = ""
+ 
+      while match(choice,"\"$") == -1
+       let wholechoice = wholechoice . " " . choice
+       let ichoice     = ichoice + 1
+       if ichoice > a:0
+        echoerr "Unbalanced string in filename '". wholechoice ."'"
+"        call Dret("NetRead")
+        return
+       endif
+       let choice= a:{ichoice}
+      endwhile
+      let choice= strpart(wholechoice,1,strlen(wholechoice)-1) . " " . strpart(choice,0,strlen(choice)-1)
+     endif
     endif
    endif
-  endif
-"  call Decho("choice<" . choice . ">")
-  let ichoice= ichoice + 1
 
-  " fix up windows urls
-  if has("win32")
-   let choice = substitute(choice,'\\','/','ge')
-"   call Decho("fixing up windows url to <".choice."> tmpfile<".tmpfile)
-   exe 'lcd ' . fnamemodify(tmpfile,':h')
-   let tmpfile = fnamemodify(tmpfile,':t')
-  endif
+"   call Decho("choice<" . choice . ">")
+   let ichoice= ichoice + 1
+ 
+   " fix up windows urls
+   if has("win32")
+    let choice = substitute(choice,'\\','/','ge')
+"    call Decho("fixing up windows url to <".choice."> tmpfile<".tmpfile)
 
-  " Determine method of read (ftp, rcp, etc)
-  call s:NetMethod(choice)
-
-  " Check if NetList() should be handling this request
-"  call Decho("checking if netlist: choice<".choice."> netrw_list_cmd<".g:netrw_list_cmd.">")
-  if choice =~ "^.*/$"
-   if strlen(g:netrw_list_cmd) > 0
-    call s:NetList(choice)
-"    call Dret("NetRead")
-   else
-    echoerr "sorry, can't do a remote listing; ssh isn't executable"
+    exe 'lcd ' . fnamemodify(tmpfile,':h')
+    let tmpfile = fnamemodify(tmpfile,':t')
    endif
-   return
-  endif
-
-  " ============
-  " Perform Read
-  " ============
-
-  ".........................................
-  " rcp:  NetRead Method #1
-  if  b:netrw_method == 1 " read with rcp
-"   call Decho("read via rcp (method #1)")
-  " ER: noting done with g:netrw_uid yet?
-  " ER: on Win2K" rcp machine[.user]:file tmpfile
-  " ER: if machine contains '.' adding .user is required (use $USERNAME)
-  " ER: the tmpfile is full path: rcp sees C:\... as host C
-  if s:netrw_has_nt_rcp == 1
-   if exists("g:netrw_uid") &&	( g:netrw_uid != "" )
-    let uid_machine = g:netrw_machine .'.'. g:netrw_uid
-   else
-    " Any way needed it machine contains a '.'
-    let uid_machine = g:netrw_machine .'.'. $USERNAME
+ 
+   " Determine method of read (ftp, rcp, etc)
+   call s:NetMethod(choice)
+ 
+   " Check if NetList() should be handling this request
+"   call Decho("checking if netlist: choice<".choice."> netrw_list_cmd<".g:netrw_list_cmd.">")
+   if choice =~ "^.*/$"
+    if strlen(g:netrw_list_cmd) > 0
+     keepjumps call s:NetList(choice)
+"     call Dret("NetRead")
+    else
+     echoerr "sorry, can't do a remote listing; ssh isn't executable"
+    endif
+    return
    endif
-  else
-   if exists("g:netrw_uid") &&	( g:netrw_uid != "" )
-    let uid_machine = g:netrw_uid .'@'. g:netrw_machine
+ 
+   " ============
+   " Perform Read
+   " ============
+ 
+   ".........................................
+   " rcp:  NetRead Method #1
+   if  b:netrw_method == 1 " read with rcp
+"    call Decho("read via rcp (method #1)")
+   " ER: noting done with g:netrw_uid yet?
+   " ER: on Win2K" rcp machine[.user]:file tmpfile
+   " ER: if machine contains '.' adding .user is required (use $USERNAME)
+   " ER: the tmpfile is full path: rcp sees C:\... as host C
+   if s:netrw_has_nt_rcp == 1
+    if exists("g:netrw_uid") &&	( g:netrw_uid != "" )
+     let uid_machine = g:netrw_machine .'.'. g:netrw_uid
+    else
+     " Any way needed it machine contains a '.'
+     let uid_machine = g:netrw_machine .'.'. $USERNAME
+    endif
    else
-    let uid_machine = g:netrw_machine
+    if exists("g:netrw_uid") &&	( g:netrw_uid != "" )
+     let uid_machine = g:netrw_uid .'@'. g:netrw_machine
+    else
+     let uid_machine = g:netrw_machine
+    endif
    endif
-  endif
-"  call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
-  exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
-  let result           = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
-  let b:netrw_lastfile = choice
-
-  ".........................................
-  " ftp + <.netrc>:  NetRead Method #2
-  elseif b:netrw_method  == 2		" read with ftp + <.netrc>
-"   call Decho("read via ftp+.netrc (method #2)")
+"   call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
+   exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".uid_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
+   let result           = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+   let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " ftp + <.netrc>:  NetRead Method #2
+   elseif b:netrw_method  == 2		" read with ftp + <.netrc>
+"    call Decho("read via ftp+.netrc (method #2)")
+     let netrw_fname= b:netrw_fname
+     new
+     set ff=unix
+     exe "put ='".g:netrw_ftpmode."'"
+     exe "put ='get ".netrw_fname." ".tmpfile."'"
+     if exists("g:netrw_port") && g:netrw_port != ""
+"      call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
+      exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
+     else
+"      call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
+      exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
+     endif
+     " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+     if getline(1) !~ "^$"
+      echoerr getline(1)
+     endif
+     bd!
+     let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+     let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " ftp + machine,id,passwd,filename:  NetRead Method #3
+   elseif b:netrw_method == 3		" read with ftp + machine, id, passwd, and fname
+    " Construct execution string (four lines) which will be passed through filter
+"    call Decho("read via ftp+mipf (method #3)")
     let netrw_fname= b:netrw_fname
     new
     set ff=unix
+    if exists("g:netrw_port") && g:netrw_port != ""
+     put ='open '.g:netrw_machine.' '.g:netrw_port
+    else
+     put ='open '.g:netrw_machine
+    endif
+ 
+    if exists("g:netrw_ftp") && g:netrw_ftp == 1
+     put =g:netrw_uid
+     put =g:netrw_passwd
+    else
+     put ='user '.g:netrw_uid.' '.g:netrw_passwd
+    endif
+ 
+    if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
+     put =g:netrw_ftpmode
+    endif
+    put ='get '.netrw_fname.' '.tmpfile
+ 
+    " perform ftp:
+    " -i       : turns off interactive prompting from ftp
+    " -n  unix : DON'T use <.netrc>, even though it exists
+    " -n  win32: quit being obnoxious about password
+"    call Decho('performing ftp -i -n')
+    norm 1Gdd
+"    call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
+    exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
+    " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+    if getline(1) !~ "^$"
+     echoerr getline(1)
+    endif
+    bd!
+    let result		= s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " scp: NetRead Method #4
+   elseif     b:netrw_method  == 4	" read with scp
+"    call Decho("read via scp (method #4)")
+    if exists("g:netrw_port") && g:netrw_port != ""
+     let useport= " -P ".g:netrw_port
+    else
+     let useport= ""
+    endif
+    if g:netrw_cygwin == 1
+     let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+"     call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
+     exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
+    else
+"     call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
+     exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
+    endif
+    let result		= s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   elseif     b:netrw_method  == 5	" read with http (wget)
+"    call Decho("read via http (method #5)")
+    if g:netrw_http_cmd == ""
+     echoerr "neither wget nor fetch command is available"
+     exit
+    endif
+ 
+    if match(b:netrw_fname,"#") == -1
+     " simple wget
+"     call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.escape(b:netrw_fname,' ?&'))
+     exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.escape(b:netrw_fname,' ?&')
+     let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+ 
+    else
+     " wget plus a jump to an in-page marker (ie. http://abc/def.html#aMarker)
+     let netrw_html= substitute(b:netrw_fname,"#.*$","","")
+     let netrw_tag = substitute(b:netrw_fname,"^.*#","","")
+"     call Decho("netrw_html<".netrw_html.">")
+"     call Decho("netrw_tag <".netrw_tag.">")
+"     call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html)
+     exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html
+     let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+"     call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/')
+     exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
+    endif
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " cadaver: NetRead Method #6
+   elseif     b:netrw_method  == 6	" read with cadaver
+"    call Decho("read via cadaver (method #6)")
+ 
+    " Construct execution string (four lines) which will be passed through filter
+    let netrw_fname= b:netrw_fname
+    new
+    set ff=unix
+    if exists("g:netrw_port") && g:netrw_port != ""
+     put ='open '.g:netrw_machine.' '.g:netrw_port
+    else
+     put ='open '.g:netrw_machine
+    endif
+    put ='user '.g:netrw_uid.' '.g:netrw_passwd
+ 
+    if g:netrw_cygwin == 1
+     let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+     put ='get '.netrw_fname.' '.cygtmpfile
+    else
+     put ='get '.netrw_fname.' '.tmpfile
+    endif
+ 
+    " perform cadaver operation:
+    norm 1Gdd
+"    call Decho("executing: %!".g:netrw_dav_cmd)
+    exe g:netrw_silentxfer."%!".g:netrw_dav_cmd
+    bd!
+    let result		= s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " rsync: NetRead Method #7
+   elseif     b:netrw_method  == 7	" read with rsync
+"    call Decho("read via rsync (method #7)")
+    if g:netrw_cygwin == 1
+     let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+"     call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
+     exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
+    else
+"     call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
+     exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
+    endif
+    let result		= s:NetGetFile(readcmd,tmpfile, b:netrw_method)
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " fetch: NetRead Method #8
+   "    fetch://[user@]host[:http]/path
+   elseif     b:netrw_method  == 8	" read with fetch
+    if g:netrw_fetch_cmd == ""
+     echoerr "fetch command not available"
+     exit
+    endif
+    if exists("g:netrw_option") && g:netrw_option == ":http"
+     let netrw_option= "http"
+    else
+     let netrw_option= "ftp"
+    endif
+"    call Decho("read via fetch for ".netrw_option)
+ 
+    if exists("g:netrw_uid") && g:netrw_uid != "" && exists("g:netrw_passwd") && g:netrw_passwd != ""
+"     call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".escape(b:netrw_fname,' ?&'))
+     exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".escape(b:netrw_fname,' ?&')
+    else
+"     call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".escape(b:netrw_fname,' ?&'))
+     exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".escape(b:netrw_fname,' ?&')
+    endif
+ 
+    let result		= s:NetGetFile(readcmd,tmpfile, b:netrw_method)
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " sftp: NetRead Method #9
+   elseif     b:netrw_method  == 9	" read with sftp
+"    call Decho("read via sftp (method #4)")
+    if g:netrw_cygwin == 1
+     let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+"     call Decho("!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
+"     call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
+     exe "!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
+    else
+"     call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
+     exe g:netrw_silentxfer."!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
+    endif
+    let result		= s:NetGetFile(readcmd, tmpfile, b:netrw_method)
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   else " Complain
+    echo "***warning*** unable to comply with your request<" . choice . ">"
+   endif
+  endwhile
+ 
+  " cleanup
+"  call Decho("cleanup")
+  if exists("b:netrw_method")
+   unlet b:netrw_method
+   unlet g:netrw_machine
+   unlet b:netrw_fname
+  endif
+  call s:NetOptionRestore()
+ 
+"  call Dret("NetRead")
+endfun
+" end of NetRead
+
+" ------------------------------------------------------------------------
+" NetGetFile: Function to read file "fname" with command "readcmd". {{{1
+fun! s:NetGetFile(readcmd, fname, method)
+"   call Dfunc("NetGetFile(readcmd<".a:readcmd.">,fname<".a:fname."> method<".a:method.">)")
+ 
+  if exists("*NetReadFixup")
+   " for the use of NetReadFixup (not otherwise used internally)
+   let line2= line("$")
+  endif
+ 
+  " transform paths from / to \ for Windows, unless the shell is bash
+  if &term == "win32"
+   if &shell == "bash"
+    let fname=a:fname
+"    call Decho("(win32 && bash) fname<".fname.">")
+   else
+    let fname=substitute(a:fname,'/','\\\\','ge')
+"    call Decho("(win32 && !bash) fname<".fname.">")
+   endif
+  else
+   let fname= a:fname
+"   call Decho("(copied) fname<".fname.">")
+  endif
+ 
+  " get the file, but disable undo when reading a new buffer
+  if a:readcmd[0] == '0'
+   let use_e_cmd = 0		" 1 when using ':edit'
+   let delline   = 0		" 1 when have to delete empty last line
+   if line("$") == 1 && getline(1) == ""
+    " Now being asked to 0r a file into an empty file.
+    " Safe to :e it instead, unless there is another window on the same buffer.
+    let curbufnr  = bufnr("%")
+    let use_e_cmd = 1
+    let delline   = 1
+    " Loop over all windows,
+    " reset use_e_cmd when another one is editing the current buffer.
+    let i = 1
+    while 1
+      if i != winnr() && winbufnr(i) == curbufnr
+        let use_e_cmd = 0
+        break
+      endif
+      let i = i + 1
+      if winbufnr(i) < 0
+        break
+      endif
+    endwhile
+   endif
+ 
+   if use_e_cmd > 0
+    " ':edit' the temp file, wipe out the old buffer and rename the buffer
+    let curfilename = expand("%")
+ 
+    let binlocal = &l:bin
+    let binglobal = &g:bin
+    if binlocal
+      setglobal bin		" Need to set 'bin' globally for ":e" command.
+    endif
+    silent exe "e! ".v:cmdarg." ".fname
+    if binlocal && !binglobal
+      setglobal nobin
+      setlocal bin
+    endif
+ 
+    exe curbufnr . "bwipe!"
+    exe "f ".curfilename
+    " the ":f newname" apparently leaves the temporary file as the alternate
+    " file in the buffer list (see :ls!).  The following command wipes it out.
+    exe bufnr("#")."bwipe!"
+   else
+    let oldul= &ul
+    set ul=-1
+    exe a:readcmd." ".v:cmdarg." ".fname
+    if delline > 0
+     " wipe out last line, which should be a blank line anyway
+     $del
+    endif
+    let &ul= oldul
+   endif
+  elseif filereadable(fname)
+"   call Decho("exe<".a:readcmd." ".v:cmdarg." ".fname.">")
+   exe a:readcmd." ".v:cmdarg." ".fname
+  else
+"   call Dret("NetGetFile")
+   return
+  endif
+ 
+  " User-provided (ie. optional) fix-it-up command
+  if exists("*NetReadFixup")
+   let line1= line(".")
+   if a:readcmd == "r"
+    let line2= line("$") - line2 + line1
+   else
+    let line2= line("$") - line2
+   endif
+"   call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
+   call NetReadFixup(a:method, line1, line2)
+  endif
+ 
+"  call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> fname<".a:fname."> readable=".filereadable(a:fname))
+ 
+ " insure that we have the right filetype and that its being displayed
+  filetype detect
+  redraw!
+"  call Dret("NetGetFile")
+endfun
+
+" ------------------------------------------------------------------------
+" NetWrite: responsible for writing a file over the net {{{1
+fun! s:NetWrite(...) range
+"  call Dfunc("NetWrite(a:0=".a:0.")")
+ 
+  " option handling
+  let mod= 0
+  call s:NetOptionSave()
+ 
+  " Get Temporary Filename
+  let tmpfile= tempname()
+ 
+  if a:0 == 0
+   let ichoice = 0
+  else
+   let ichoice = 1
+  endif
+ 
+  " write (selected portion of) file to temporary
+  silent exe a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile
+ 
+  while ichoice <= a:0
+ 
+   " attempt to repeat with previous host-file-etc
+   if exists("b:netrw_lastfile") && a:0 == 0
+"    call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
+    let choice = b:netrw_lastfile
+    let ichoice= ichoice + 1
+   else
+    exe "let choice= a:" . ichoice
+ 
+    " Reconstruct Choice if choice starts with '"'
+    if match(choice,"?") == 0
+     echo 'NetWrite Usage:"'
+     echo ':Nwrite machine:path                        uses rcp'
+     echo ':Nwrite "machine path"                      uses ftp with <.netrc>'
+     echo ':Nwrite "machine id password path"          uses ftp'
+     echo ':Nwrite dav://[user@]machine/path           uses cadaver'
+     echo ':Nwrite fetch://[user@]machine/path         uses fetch'
+     echo ':Nwrite ftp://machine[#port]/path           uses ftp  (autodetects <.netrc>)'
+     echo ':Nwrite rcp://machine/path                  uses rcp'
+     echo ':Nwrite rsync://[user@]machine/path         uses rsync'
+     echo ':Nwrite scp://[user@]machine[[:#]port]/path uses scp'
+     echo ':Nwrite sftp://[user@]machine/path          uses sftp'
+     break
+ 
+    elseif match(choice,"^\"") != -1
+     if match(choice,"\"$") != -1
+       " case "..."
+      let choice=strpart(choice,1,strlen(choice)-2)
+     else
+      "  case "... ... ..."
+      let choice      = strpart(choice,1,strlen(choice)-1)
+      let wholechoice = ""
+ 
+      while match(choice,"\"$") == -1
+       let wholechoice= wholechoice . " " . choice
+       let ichoice    = ichoice + 1
+       if choice > a:0
+        echoerr "Unbalanced string in filename '". wholechoice ."'"
+"        call Dret("NetWrite")
+        return
+       endif
+       let choice= a:{ichoice}
+      endwhile
+      let choice= strpart(wholechoice,1,strlen(wholechoice)-1) . " " . strpart(choice,0,strlen(choice)-1)
+     endif
+    endif
+   endif
+"   call Decho("choice<" . choice . ">")
+   let ichoice= ichoice + 1
+ 
+   " fix up windows urls
+   if has("win32")
+    let choice= substitute(choice,'\\','/','ge')
+    "ER: see NetRead()
+    exe 'lcd ' . fnamemodify(tmpfile,':h')
+    let tmpfile = fnamemodify(tmpfile,':t')
+   endif
+ 
+   " Determine method of read (ftp, rcp, etc)
+   call s:NetMethod(choice)
+ 
+   " =============
+   " Perform Write
+   " =============
+ 
+   ".........................................
+   " rcp: NetWrite Method #1
+   if  b:netrw_method == 1	" write with rcp
+" Decho "write via rcp (method #1)"
+    if s:netrw_has_nt_rcp == 1
+     if exists("g:netrw_uid") &&  ( g:netrw_uid != "" )
+      let uid_machine = g:netrw_machine .'.'. g:netrw_uid
+     else
+      let uid_machine = g:netrw_machine .'.'. $USERNAME
+     endif
+    else
+     if exists("g:netrw_uid") &&  ( g:netrw_uid != "" )
+      let uid_machine = g:netrw_uid .'@'. g:netrw_machine
+     else
+      let uid_machine = g:netrw_machine
+     endif
+    endif
+"    call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".escape(b:netrw_fname,' ?&'))
+    exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".escape(b:netrw_fname,' ?&')
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " ftp + <.netrc>: NetWrite Method #2
+   elseif b:netrw_method == 2	" write with ftp + <.netrc>
+    let netrw_fname = b:netrw_fname
+    new
+    set ff=unix
     exe "put ='".g:netrw_ftpmode."'"
-    exe "put ='get ".netrw_fname." ".tmpfile."'"
+"    call Decho(" NetWrite: put ='".g:netrw_ftpmode."'")
+    exe "put ='put ".tmpfile." ".netrw_fname."'"
+"    call Decho("put ='put ".tmpfile." ".netrw_fname."'")
     if exists("g:netrw_port") && g:netrw_port != ""
 "     call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
      exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
@@ -310,579 +749,147 @@
     " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
     if getline(1) !~ "^$"
      echoerr getline(1)
+     let mod=1
     endif
     bd!
-    let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
     let b:netrw_lastfile = choice
-
-  ".........................................
-  " ftp + machine,id,passwd,filename:  NetRead Method #3
-  elseif b:netrw_method == 3		" read with ftp + machine, id, passwd, and fname
-   " Construct execution string (four lines) which will be passed through filter
-"  call Decho("read via ftp+mipf (method #3)")
-   let netrw_fname= b:netrw_fname
-   new
-   set ff=unix
-   if exists("g:netrw_port") && g:netrw_port != ""
-    put ='open '.g:netrw_machine.' '.g:netrw_port
-   else
-    put ='open '.g:netrw_machine
-   endif
-
-   if exists("g:netrw_ftp") && g:netrw_ftp == 1
-    put =g:netrw_uid
-    put =g:netrw_passwd
-   else
+ 
+   ".........................................
+   " ftp + machine, id, passwd, filename: NetWrite Method #3
+   elseif b:netrw_method == 3	" write with ftp + machine, id, passwd, and fname
+    let netrw_fname= b:netrw_fname
+    new
+    set ff=unix
+    if exists("g:netrw_port") && g:netrw_port != ""
+     put ='open '.g:netrw_machine.' '.g:netrw_port
+    else
+     put ='open '.g:netrw_machine
+    endif
+    if exists("g:netrw_ftp") && g:netrw_ftp == 1
+     put =g:netrw_uid
+     put =g:netrw_passwd
+    else
+     put ='user '.g:netrw_uid.' '.g:netrw_passwd
+    endif
+    put ='put '.tmpfile.' '.netrw_fname
+    " save choice/id/password for future use
+    let b:netrw_lastfile = choice
+ 
+    " perform ftp:
+    " -i       : turns off interactive prompting from ftp
+    " -n  unix : DON'T use <.netrc>, even though it exists
+    " -n  win32: quit being obnoxious about password
+"    call Decho('performing ftp -i -n')
+    norm 1Gdd
+"    call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
+    exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
+    " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
+    if getline(1) !~ "^$"
+     echoerr getline(1)
+     let mod=1
+    endif
+    bd!
+ 
+   ".........................................
+   " scp: NetWrite Method #4
+   elseif     b:netrw_method == 4	" write with scp
+    if exists("g:netrw_port") && g:netrw_port != ""
+     let useport= " -P ".g:netrw_port
+    else
+     let useport= ""
+    endif
+    if g:netrw_cygwin == 1
+     let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+"     call Decho("executing: !".g:netrw_scp_cmd.useport." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
+     exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
+    else
+"     call Decho("executing: !".g:netrw_scp_cmd.useport." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
+     exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
+    endif
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " http: NetWrite Method #5
+   elseif     b:netrw_method == 5
+    echoerr "***warning*** currently <netrw.vim> does not support writing using http:"
+ 
+   ".........................................
+   " dav: NetWrite Method #6
+   elseif     b:netrw_method == 6	" write with cadaver
+"    call Decho("write via cadaver (method #6)")
+ 
+    " Construct execution string (four lines) which will be passed through filter
+    let netrw_fname= b:netrw_fname
+    new
+    set ff=unix
+    if exists("g:netrw_port") && g:netrw_port != ""
+     put ='open '.g:netrw_machine.' '.g:netrw_port
+    else
+     put ='open '.g:netrw_machine
+    endif
     put ='user '.g:netrw_uid.' '.g:netrw_passwd
-   endif
-
-   if exists("g:netrw_ftpmode") && g:netrw_ftpmode != ""
-    put =g:netrw_ftpmode
-   endif
-   put ='get '.netrw_fname.' '.tmpfile
-
-   " perform ftp:
-   " -i       : turns off interactive prompting from ftp
-   " -n  unix : DON'T use <.netrc>, even though it exists
-   " -n  win32: quit being obnoxious about password
-"   call Decho('performing ftp -i -n')
-   norm 1Gdd
-"   call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
-   exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
-   " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
-   if getline(1) !~ "^$"
-    echoerr getline(1)
-   endif
-   bd!
-   let result		= s:NetGetFile(readcmd, tmpfile, b:netrw_method)
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " scp: NetRead Method #4
-  elseif     b:netrw_method  == 4	" read with scp
-"   call Decho("read via scp (method #4)")
-   if exists("g:netrw_port") && g:netrw_port != ""
-    let useport= " -P ".g:netrw_port
-   else
-    let useport= ""
-   endif
-   if g:netrw_cygwin == 1
-    let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
-"    call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
-    exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
-   else
-"    call Decho("executing: !".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
-    exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
-   endif
-   let result		= s:NetGetFile(readcmd, tmpfile, b:netrw_method)
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  elseif     b:netrw_method  == 5	" read with http (wget)
-"   call Decho("read via http (method #5)")
-   if g:netrw_http_cmd == ""
-    echoerr "neither wget nor fetch command is available"
-    exit
-   endif
-
-   if match(b:netrw_fname,"#") == -1
-    " simple wget
-"    call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.escape(b:netrw_fname,' ?&'))
-    exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.escape(b:netrw_fname,' ?&')
-    let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
-
-   else
-    " wget plus a jump to an in-page marker (ie. http://abc/def.html#aMarker)
-    let netrw_html= substitute(b:netrw_fname,"#.*$","","")
-    let netrw_tag = substitute(b:netrw_fname,"^.*#","","")
-"	call Decho("netrw_html<".netrw_html.">")
-"	call Decho("netrw_tag <".netrw_tag.">")
-"    call Decho("executing: !".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html)
-    exe g:netrw_silentxfer."!".g:netrw_http_cmd." ".tmpfile." http://".g:netrw_machine.netrw_html
-    let result = s:NetGetFile(readcmd, tmpfile, b:netrw_method)
-"    call Decho('<\s*a\s*name=\s*"'.netrw_tag.'"/')
-    exe 'norm! 1G/<\s*a\s*name=\s*"'.netrw_tag.'"/'."\<CR>"
-   endif
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " cadaver: NetRead Method #6
-  elseif     b:netrw_method  == 6	" read with cadaver
-"   call Decho("read via cadaver (method #6)")
-
-   " Construct execution string (four lines) which will be passed through filter
-   let netrw_fname= b:netrw_fname
-   new
-   set ff=unix
-   if exists("g:netrw_port") && g:netrw_port != ""
-    put ='open '.g:netrw_machine.' '.g:netrw_port
-   else
-    put ='open '.g:netrw_machine
-   endif
-   put ='user '.g:netrw_uid.' '.g:netrw_passwd
-
-   if g:netrw_cygwin == 1
-    let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
-    put ='get '.netrw_fname.' '.cygtmpfile
-   else
-    put ='get '.netrw_fname.' '.tmpfile
-   endif
-
-   " perform cadaver operation:
-   norm 1Gdd
-"   call Decho("executing: %!".g:netrw_dav_cmd)
-   exe g:netrw_silentxfer."%!".g:netrw_dav_cmd
-   bd!
-   let result		= s:NetGetFile(readcmd, tmpfile, b:netrw_method)
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " rsync: NetRead Method #7
-  elseif     b:netrw_method  == 7	" read with rsync
-"   call Decho("read via rsync (method #7)")
-   if g:netrw_cygwin == 1
-    let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
-"    call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
-    exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
-   else
-"    call Decho("executing: !".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
-    exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
-   endif
-   let result		= s:NetGetFile(readcmd,tmpfile, b:netrw_method)
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " fetch: NetRead Method #8
-  "    fetch://[user@]host[:http]/path
-  elseif     b:netrw_method  == 8	" read with fetch
-   if g:netrw_fetch_cmd == ""
-    echoerr "fetch command not available"
-    exit
-   endif
-   if exists("g:netrw_option") && g:netrw_option == ":http"
-    let netrw_option= "http"
-   else
-    let netrw_option= "ftp"
-   endif
-"   call Decho("read via fetch for ".netrw_option)
-
-   if exists("g:netrw_uid") && g:netrw_uid != "" && exists("g:netrw_passwd") && g:netrw_passwd != ""
-"    call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".escape(b:netrw_fname,' ?&'))
-    exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_uid.':'.g:netrw_passwd.'@'.g:netrw_machine."/".escape(b:netrw_fname,' ?&')
-   else
-"    call Decho("executing: !".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".escape(b:netrw_fname,' ?&'))
-    exe g:netrw_silentxfer."!".g:netrw_fetch_cmd." ".tmpfile." ".netrw_option."://".g:netrw_machine."/".escape(b:netrw_fname,' ?&')
-   endif
-
-   let result		= s:NetGetFile(readcmd,tmpfile, b:netrw_method)
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " sftp: NetRead Method #9
-  elseif     b:netrw_method  == 9	" read with sftp
-"   call Decho("read via sftp (method #4)")
-   if g:netrw_cygwin == 1
-    let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
-"    call Decho("!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
-"    call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile)
-    exe "!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".cygtmpfile
-   else
-"    call Decho("executing: !".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile)
-    exe g:netrw_silentxfer."!".g:netrw_sftp_cmd." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')." ".tmpfile
-   endif
-   let result		= s:NetGetFile(readcmd, tmpfile, b:netrw_method)
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  else " Complain
-   echo "***warning*** unable to comply with your request<" . choice . ">"
-  endif
- endwhile
-
- " cleanup
-" call Decho("cleanup")
- if exists("b:netrw_method")
-  unlet b:netrw_method
-  unlet g:netrw_machine
-  unlet b:netrw_fname
- endif
- call s:NetOptionRestore()
-
-" call Dret("NetRead")
-endfun
-" end of NetRead
-
-" ------------------------------------------------------------------------
-" NetGetFile: Function to read file "fname" with command "readcmd". {{{1
-fun! s:NetGetFile(readcmd, fname, method)
-""  call Dfunc("NetGetFile(readcmd<".a:readcmd.">,fname<".a:fname."> method<".a:method.">)")
-
- if exists("*NetReadFixup")
-  " for the use of NetReadFixup (not otherwise used internally)
-  let line2= line("$")
- endif
-
- " transform paths from / to \ for Windows, unless the shell is bash
- if &term == "win32"
-  if &shell == "bash"
-   let fname=a:fname
-""  call Decho("(win32 && bash) fname<".fname.">")
-  else
-   let fname=substitute(a:fname,'/','\\\\','ge')
-""  call Decho("(win32 && !bash) fname<".fname.">")
-  endif
- else
-  let fname= a:fname
-""  call Decho("(copied) fname<".fname.">")
- endif
-
- " get the file, but disable undo when reading a new buffer
- if a:readcmd[0] == '0'
-  let use_e_cmd = 0		" 1 when using ':edit'
-  let delline   = 0		" 1 when have to delete empty last line
-  if line("$") == 1 && getline(1) == ""
-   " Now being asked to 0r a file into an empty file.
-   " Safe to :e it instead, unless there is another window on the same buffer.
-   let curbufnr  = bufnr("%")
-   let use_e_cmd = 1
-   let delline   = 1
-   " Loop over all windows,
-   " reset use_e_cmd when another one is editing the current buffer.
-   let i = 1
-   while 1
-     if i != winnr() && winbufnr(i) == curbufnr
-       let use_e_cmd = 0
-       break
-     endif
-     let i = i + 1
-     if winbufnr(i) < 0
-       break
-     endif
-   endwhile
-  endif
-
-  if use_e_cmd > 0
-   " ':edit' the temp file, wipe out the old buffer and rename the buffer
-   let curfilename = expand("%")
-
-   let binlocal = &l:bin
-   let binglobal = &g:bin
-   if binlocal
-     setglobal bin		" Need to set 'bin' globally for ":e" command.
-   endif
-   silent exe "e! ".v:cmdarg." ".fname
-   if binlocal && !binglobal
-     setglobal nobin
-     setlocal bin
-   endif
-
-   exe curbufnr . "bwipe!"
-   exe "f ".curfilename
-   " the ":f newname" apparently leaves the temporary file as the alternate
-   " file in the buffer list (see :ls!).  The following command wipes it out.
-   exe bufnr("#")."bwipe!"
-  else
-   let oldul= &ul
-   set ul=-1
-   exe a:readcmd." ".v:cmdarg." ".fname
-   if delline > 0
-    " wipe out last line, which should be a blank line anyway
-    $del
-   endif
-   let &ul= oldul
-  endif
- else
-  exe a:readcmd." ".v:cmdarg." ".fname
- endif
-
- " User-provided (ie. optional) fix-it-up command
- if exists("*NetReadFixup")
-  let line1= line(".")
-  if a:readcmd == "r"
-   let line2= line("$") - line2 + line1
-  else
-   let line2= line("$") - line2
-  endif
-""  call Decho("calling NetReadFixup(method<".a:method."> line1=".line1." line2=".line2.")")
-  call NetReadFixup(a:method, line1, line2)
- endif
-"" call Decho("readcmd<".a:readcmd."> cmdarg<".v:cmdarg."> fname<".a:fname."> readable=".filereadable(a:fname))
-
-" insure that we have the right filetype and that its being displayed
- filetype detect
- redraw!
-"" call Dret("NetGetFile")
-endfun
-
-" ------------------------------------------------------------------------
-" NetWrite: responsible for writing a file over the net {{{1
-fun! s:NetWrite(...) range
-"" call Dfunc("NetWrite(a:0=".a:0.")")
-
- " option handling
- let mod= 0
- call s:NetOptionSave()
-
- " Get Temporary Filename
- let tmpfile= tempname()
-
- if a:0 == 0
-  let ichoice = 0
- else
-  let ichoice = 1
- endif
-
- " write (selected portion of) file to temporary
- silent exe a:firstline."," . a:lastline . "w! ".v:cmdarg." ".tmpfile
-
- while ichoice <= a:0
-
-  " attempt to repeat with previous host-file-etc
-  if exists("b:netrw_lastfile") && a:0 == 0
-""   call Decho("using b:netrw_lastfile<" . b:netrw_lastfile . ">")
-   let choice = b:netrw_lastfile
-   let ichoice= ichoice + 1
-  else
-   exe "let choice= a:" . ichoice
-
-   " Reconstruct Choice if choice starts with '"'
-   if match(choice,"?") == 0
-    echo 'NetWrite Usage:"'
-    echo ':Nwrite machine:path                        uses rcp'
-    echo ':Nwrite "machine path"                      uses ftp with <.netrc>'
-    echo ':Nwrite "machine id password path"          uses ftp'
-    echo ':Nwrite dav://[user@]machine/path           uses cadaver'
-    echo ':Nwrite fetch://[user@]machine/path         uses fetch'
-    echo ':Nwrite ftp://machine[#port]/path           uses ftp  (autodetects <.netrc>)'
-    echo ':Nwrite rcp://machine/path                  uses rcp'
-    echo ':Nwrite rsync://[user@]machine/path         uses rsync'
-    echo ':Nwrite scp://[user@]machine[[:#]port]/path uses scp'
-    echo ':Nwrite sftp://[user@]machine/path          uses sftp'
-    break
-
-   elseif match(choice,"^\"") != -1
-    if match(choice,"\"$") != -1
-      " case "..."
-     let choice=strpart(choice,1,strlen(choice)-2)
+ 
+    if g:netrw_cygwin == 1
+     let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+     put ='put '.cygtmpfile.' '.netrw_fname
     else
-     "  case "... ... ..."
-     let choice      = strpart(choice,1,strlen(choice)-1)
-     let wholechoice = ""
-
-     while match(choice,"\"$") == -1
-      let wholechoice= wholechoice . " " . choice
-      let ichoice    = ichoice + 1
-      if choice > a:0
-       echoerr "Unbalanced string in filename '". wholechoice ."'"
-""       call Dret("NetWrite")
-       return
-      endif
-      let choice= a:{ichoice}
-     endwhile
-     let choice= strpart(wholechoice,1,strlen(wholechoice)-1) . " " . strpart(choice,0,strlen(choice)-1)
+     put ='put '.tmpfile.' '.netrw_fname
     endif
-   endif
-  endif
-""  call Decho("choice<" . choice . ">")
-  let ichoice= ichoice + 1
-
-  " fix up windows urls
-  if has("win32")
-   let choice= substitute(choice,'\\','/','ge')
-   "ER: see NetRead()
-   exe 'lcd ' . fnamemodify(tmpfile,':h')
-   let tmpfile = fnamemodify(tmpfile,':t')
-  endif
-
-  " Determine method of read (ftp, rcp, etc)
-  call s:NetMethod(choice)
-
-  " =============
-  " Perform Write
-  " =============
-
-  ".........................................
-  " rcp: NetWrite Method #1
-  if  b:netrw_method == 1	" write with rcp
-""	Decho "write via rcp (method #1)"
-   if s:netrw_has_nt_rcp == 1
-    if exists("g:netrw_uid") &&  ( g:netrw_uid != "" )
-     let uid_machine = g:netrw_machine .'.'. g:netrw_uid
+ 
+    " perform cadaver operation:
+    norm 1Gdd
+"    call Decho("executing: %!".g:netrw_dav_cmd)
+    exe g:netrw_silentxfer."%!".g:netrw_dav_cmd
+    bd!
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " rsync: NetWrite Method #7
+   elseif     b:netrw_method == 7	" write with rsync
+    if g:netrw_cygwin == 1
+     let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
+"     call Decho("executing: !".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
+     exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
     else
-     let uid_machine = g:netrw_machine .'.'. $USERNAME
+"     call Decho("executing: !".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
+     exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
     endif
-   else
+    let b:netrw_lastfile = choice
+ 
+   ".........................................
+   " scp: NetWrite Method #9
+   elseif     b:netrw_method == 9	" write with sftp
+    let netrw_fname= b:netrw_fname
     if exists("g:netrw_uid") &&  ( g:netrw_uid != "" )
      let uid_machine = g:netrw_uid .'@'. g:netrw_machine
     else
      let uid_machine = g:netrw_machine
     endif
-   endif
-""   call Decho("executing: !".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".escape(b:netrw_fname,' ?&'))
-   exe g:netrw_silentxfer."!".g:netrw_rcp_cmd." ".s:netrw_rcpmode." ".tmpfile." ".uid_machine.":".escape(b:netrw_fname,' ?&')
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " ftp + <.netrc>: NetWrite Method #2
-  elseif b:netrw_method == 2	" write with ftp + <.netrc>
-   let netrw_fname = b:netrw_fname
-   new
-   set ff=unix
-   exe "put ='".g:netrw_ftpmode."'"
-""   call Decho(" NetWrite: put ='".g:netrw_ftpmode."'")
-   exe "put ='put ".tmpfile." ".netrw_fname."'"
-""   call Decho("put ='put ".tmpfile." ".netrw_fname."'")
-   if exists("g:netrw_port") && g:netrw_port != ""
-""    call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port)
-    exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine." ".g:netrw_port
-   else
-""    call Decho("executing: %!".g:netrw_ftp_cmd." -i ".g:netrw_machine)
-    exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i ".g:netrw_machine
-   endif
-   " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
-   if getline(1) !~ "^$"
-    echoerr getline(1)
-    let mod=1
-   endif
-   bd!
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " ftp + machine, id, passwd, filename: NetWrite Method #3
-  elseif b:netrw_method == 3	" write with ftp + machine, id, passwd, and fname
-   let netrw_fname= b:netrw_fname
-   new
-   set ff=unix
-   if exists("g:netrw_port") && g:netrw_port != ""
-    put ='open '.g:netrw_machine.' '.g:netrw_port
-   else
-    put ='open '.g:netrw_machine
-   endif
-   if exists("g:netrw_ftp") && g:netrw_ftp == 1
-    put =g:netrw_uid
-    put =g:netrw_passwd
-   else
-    put ='user '.g:netrw_uid.' '.g:netrw_passwd
-   endif
-   put ='put '.tmpfile.' '.netrw_fname
-   " save choice/id/password for future use
-   let b:netrw_lastfile = choice
-
-   " perform ftp:
-   " -i       : turns off interactive prompting from ftp
-   " -n  unix : DON'T use <.netrc>, even though it exists
-   " -n  win32: quit being obnoxious about password
-""   call Decho('performing ftp -i -n')
-   norm 1Gdd
-""   call Decho("executing: %!".g:netrw_ftp_cmd." -i -n")
-   exe g:netrw_silentxfer."%!".g:netrw_ftp_cmd." -i -n"
-   " If the result of the ftp operation isn't blank, show an error message (tnx to Doug Claar)
-   if getline(1) !~ "^$"
-    echoerr getline(1)
-    let mod=1
-   endif
-   bd!
-
-  ".........................................
-  " scp: NetWrite Method #4
-  elseif     b:netrw_method == 4	" write with scp
-   if exists("g:netrw_port") && g:netrw_port != ""
-    let useport= " -P ".g:netrw_port
-   else
-    let useport= ""
-   endif
-   if g:netrw_cygwin == 1
-    let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
-""    call Decho("executing: !".g:netrw_scp_cmd.useport." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
-    exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
-   else
-""    call Decho("executing: !".g:netrw_scp_cmd.useport." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
-    exe g:netrw_silentxfer."!".g:netrw_scp_cmd.useport." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
-   endif
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " http: NetWrite Method #5
-  elseif     b:netrw_method == 5
-   echoerr "***warning*** currently <netrw.vim> does not support writing using http:"
-
-  ".........................................
-  " dav: NetWrite Method #6
-  elseif     b:netrw_method == 6	" write with cadaver
-""   call Decho("write via cadaver (method #6)")
-
-   " Construct execution string (four lines) which will be passed through filter
-   let netrw_fname= b:netrw_fname
-   new
-   set ff=unix
-   if exists("g:netrw_port") && g:netrw_port != ""
-    put ='open '.g:netrw_machine.' '.g:netrw_port
-   else
-    put ='open '.g:netrw_machine
-   endif
-   put ='user '.g:netrw_uid.' '.g:netrw_passwd
-
-   if g:netrw_cygwin == 1
-    let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
-    put ='put '.cygtmpfile.' '.netrw_fname
-   else
+    new
+    set ff=unix
     put ='put '.tmpfile.' '.netrw_fname
+    norm 1Gdd
+"    call Decho("executing: %!".g:netrw_sftp_cmd.' '.uid_machine)
+    exe g:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.uid_machine
+    bd!
+    let b:netrw_lastfile= choice
+ 
+   ".........................................
+   else " Complain
+    echo "***warning*** unable to comply with your request<" . choice . ">"
    endif
-
-   " perform cadaver operation:
-   norm 1Gdd
-""   call Decho("executing: %!".g:netrw_dav_cmd)
-   exe g:netrw_silentxfer."%!".g:netrw_dav_cmd
-   bd!
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " rsync: NetWrite Method #7
-  elseif     b:netrw_method == 7	" write with rsync
-   if g:netrw_cygwin == 1
-    let cygtmpfile=substitute(tmpfile,'^\(\a\):','/cygdrive/\1/','e')
-""    call Decho("executing: !".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
-    exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".cygtmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
-   else
-""    call Decho("executing: !".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&'))
-    exe g:netrw_silentxfer."!".g:netrw_rsync_cmd." ".tmpfile." ".g:netrw_machine.":".escape(b:netrw_fname,' ?&')
-   endif
-   let b:netrw_lastfile = choice
-
-  ".........................................
-  " scp: NetWrite Method #9
-  elseif     b:netrw_method == 9	" write with sftp
-   let netrw_fname= b:netrw_fname
-   if exists("g:netrw_uid") &&  ( g:netrw_uid != "" )
-    let uid_machine = g:netrw_uid .'@'. g:netrw_machine
-   else
-    let uid_machine = g:netrw_machine
-   endif
-   new
-   set ff=unix
-   put ='put '.tmpfile.' '.netrw_fname
-   norm 1Gdd
-""   call Decho("executing: %!".g:netrw_sftp_cmd.' '.uid_machine)
-   exe g:netrw_silentxfer."%!".g:netrw_sftp_cmd.' '.uid_machine
-   bd!
-   let b:netrw_lastfile= choice
-
-  ".........................................
-  else " Complain
-   echo "***warning*** unable to comply with your request<" . choice . ">"
+  endwhile
+ 
+  " cleanup
+"  call Decho("cleanup")
+  let result=delete(tmpfile)
+  call s:NetOptionRestore()
+ 
+  if a:firstline == 1 && a:lastline == line("$")
+   let &mod= mod	" usually equivalent to set nomod
   endif
- endwhile
-
- " cleanup
-"" call Decho("cleanup")
- let result=delete(tmpfile)
- call s:NetOptionRestore()
-
- if a:firstline == 1 && a:lastline == line("$")
-  let &mod= mod	" usually equivalent to set nomod
- endif
-
-"" call Dret("NetWrite")
+ 
+"  call Dret("NetWrite")
 endfun
 " end of NetWrite
 
@@ -892,133 +899,150 @@
 "  g:netrw_list_cmd has a string, HOSTNAME, that needs to be substituted
 "  with the requested remote hostname first.
 fun! <SID>NetList(dirname)
-""  call Dfunc("NetList(dirname<".a:dirname.">)")
+"  call Dfunc("NetList(dirname<".a:dirname.">)")
 
-  " sanity maintenance
-  let dirname= a:dirname
-  if dirname !~ '/$' && (!exists("g:netrw_machine") || !exists("b:netlist_method") || !exists("b:netlist_path"))
-   let dirname= dirname."/"
+  " make this buffer modifiable
+  setlocal ma
+
+  " analyze a:dirname and g:netrw_list_cmd
+  let dirpat  = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$'
+  if a:dirname !~ dirpat
+   echoerr "NetList: I don't understand your dirname<".a:dirname.">"
+"   call Dret("NetList 0 : badly formatted dirname")
+   return 0
   endif
-  set ma
+  let method  = substitute(a:dirname,dirpat,'\1','')
+  let user    = substitute(a:dirname,dirpat,'\2','')
+  let machine = substitute(a:dirname,dirpat,'\3','')
+  let path    = substitute(a:dirname,dirpat,'\4','')
+  let fname   = substitute(a:dirname,'^.*/\ze.','','')
+"  call Decho("set up method <".method .">")
+"  call Decho("set up user   <".user   .">")
+"  call Decho("set up machine<".machine.">")
+"  call Decho("set up path   <".path   .">")
+"  call Decho("set up fname  <".fname  .">")
 
-  if dirname !~ '/$' && dirname !~ '^"'
+  let listcmd = substitute(g:netrw_list_cmd,'\<HOSTNAME\>',user.machine,'')
+"  call Decho("set up listcmd<".listcmd.">")
+
+  if fname =~ '@$' && fname !~ '^"'
+"   call Decho("attempt transfer of symlink as file")
+   call s:NetList(substitute(a:dirname,'@$','','e'))
+   redraw!
+"   call Dret("NetList 0 : symlink")
+   return 0
+
+  elseif fname !~ '/$' && fname !~ '^"'
    " looks like a regular file, attempt transfer
-""   call Decho("attempt transfer with regular file<".dirname.">")
-""   call Decho("netlist method<".b:netlist_method."> cmd<".b:netlist_cmd."> path<".b:netlist_path.">")
-   %d
+"   call Decho("attempt transfer as regular file<".a:dirname.">")
 
    " remove any filetype indicator from end of dirname, except for the
-   " "this is a directory" indicator (/)
-   let dirname= substitute(dirname,"[*=@|]$","","e")
-""   call Decho("modified dirname<".dirname.">")
+   " "this is a directory" indicator (/).  There shouldn't be one of those,
+   " anyway.
+   let path= substitute(path,'[*=@|]$','','e')
+"   call Decho("new path<".path.">")
 
    " remote-read the requested file into current buffer
-   let machine= g:netrw_machine
-   let method = b:netlist_method
-   let path   = b:netlist_path
    enew!
-   exe "file ".method."://".machine."/".path.dirname
-   exe "doau BufReadPre ".dirname
-   silent call s:NetRead(method."://".machine."/".path.dirname)
-   exe "doau BufReadPost ".dirname
+   exe "file ".method."://".machine."/".path
+   exe "silent doau BufReadPre ".fname
+   silent call s:NetRead(method."://".machine."/".path)
+   exe "silent doau BufReadPost ".fname
    1d
-   set nomod noma
+   set nomod
 
-   silent! unlet b:netlist_method
-   silent! unlet b:netlist_cmd
-   silent! unlet b:netlist_path
-""   call Dret("NetList")
-   return
+"   call Dret("NetList 0 : file<".fname.">")
+   return 0
+  endif
 
-  elseif dirname == './'
+  " ---------------------------------------------------------------------
+  "  Perform Directory Listing:
+"  call Decho("Perform directory listing...")
+  " set up new buffer and map
+  let bufname   = method.'://'.user.machine.'/'.path
+  let bufnamenr = bufnr(bufname)
+"  call Decho("bufname<".bufname."> bufnamenr=".bufnamenr)
+  if bufnamenr != -1
+   " buffer already exists, switch to it!
+   exe "b ".bufnamenr
+   if line("$") >= 5
+"    call Dret("NetList 1")
+    return 1
+   endif
+  else
+   enew!
+  endif
+  setlocal bt=nofile bh=wipe nobl
+  exe 'file '.bufname
+  set bt=nowrite bh=hide nobl
+  nnoremap <buffer> <cr>	:exe "norm! 0"<bar>call <SID>NetList(<SID>NetListChgDir(expand("%")))<cr>
+  setlocal ma
+
+"  call Decho("executing: r! ".listcmd." '".path."'")
+  keepjumps put ='\" =============================='
+  keepjumps put ='\" Netrw Remote Directory Listing'
+  keepjumps put ='\"   '.bufname
+  keepjumps put ='\" =============================='
+  exe "silent r! ".listcmd." '".path."'"
+  keepjumps 1d
+  set ft=netrwlist
+  if line("$") >= 5
+   keepjumps silent 5,$s/^\(.*\)\([/@]\)$/ \2\1/e
+   keepjumps silent 5,$call s:NetSort()
+   keepjumps silent 5,$s/^ \(.\)\(.*\)$/\2\1/e
+   keepjumps 5
+  endif
+  let prvbuf= bufnr(bufname)
+  if prvbuf != -1
+   exe "silent! b ".prvbuf
+  endif
+
+  setlocal noma nomod
+
+"  call Dret("NetList 1")
+  return 1
+endfun
+
+" ---------------------------------------------------------------------
+" NetListCombine:
+fun! <SID>NetListChgDir(dirname)
+  let newdir= expand("<cWORD>")
+"  call Dfunc("NetListChgDir(dirname<".a:dirname.">) newdir<".newdir.">")
+
+  let dirname= a:dirname
+
+  if newdir !~ '/$'
+   " handling a file
+   let dirname= dirname.newdir
+"   call Decho("handling a file: dirname<".dirname.">")
+
+  elseif newdir == './'
    " refresh the directory list
-""   call Decho("refresh directory listing")
-""   call Decho("netlist method<".b:netlist_method."> cmd<".b:netlist_cmd."> path<".b:netlist_path.">")
+"   call Decho("refresh directory listing")
    %d
 
-  elseif dirname == '../'
+  elseif newdir == '../'
    " go up one directory
+   let trailer= substitute(a:dirname,'^\(\w\+://\%(\w\+@\)\=\w\+/\)\(.*\)$','\2','')
 
-   if b:netlist_path !~ '/' && strlen(b:netlist_path) > 0
-    " go to top (rltv) directory
-""    call Decho("go up one directory : 1 path<".b:netlist_path.">")
-    let b:netlist_path= ""
-
-   elseif b:netlist_path !~ '^[./]\+$' && strlen(b:netlist_path) > 0
-    " remove a directory from the netlist_path
-""    call Decho("go up one directory : 2 path<".b:netlist_path.">")
-    if b:netlist_path =~ '^[^/]*/$'
-     let b:netlist_path= ""
-    else
-     let b:netlist_path= substitute(b:netlist_path,'^\(.*/\)[^/]*/$','\1','')
-    endif
+   if trailer =~ '^\%(\.\./\)*$'
+    " tack on a ../"
+    let dirname= dirname.'../'
 
    else
-    " append ../
-""    call Decho("go up one directory : 3 path<".b:netlist_path.">")
-    let b:netlist_path= b:netlist_path.'../'
+    " strip off a directory name from dirname
+    let dirname= substitute(dirname,'^\(.*/\)[^/]\+/','\1','')
    endif
-""   call Decho("netlist method<".b:netlist_method."> cmd<".b:netlist_cmd."> path<".b:netlist_path.">")
-   %d
+"   call Decho("go up one dir: dirname<".dirname."> trailer<".trailer.">")
 
-  elseif dirname !~ '^\w\+:' && dirname =~ '/$'
+  else
    " go down one directory
-""   call Decho("go down one directory<".dirname.">")
-   let b:netlist_path=b:netlist_path.dirname
-""   call Decho("netlist method<".b:netlist_method."> cmd<".b:netlist_cmd."> path<".b:netlist_path.">")
-   %d
-
-  else
-   " normal initial directory listing
-""   call Decho("normal initial directory listing")
-
-   let listcmd = substitute(g:netrw_list_cmd,'\<HOSTNAME\>',g:netrw_machine,'')
-   let method  = substitute(dirname,'^\(\w\+\):.*$','\1','')
-   let fname   = b:netrw_fname
-""   call Decho("set up listcmd<".listcmd.">")
-""   call Decho("set up method <".method.">")
-""   call Decho("set up fname  <".fname.">")
-
-   " set up window
-   if &mod == 1
-    wincmd s
-   endif
-   enew!
-   if v:version >= 602
-    setlocal bh=wipe
-   endif
-   
-   " set up buffer-local variables
-   let b:netlist_method = method
-   let b:netlist_cmd    = listcmd
-   let b:netlist_path   = fname
-
-   " set up buffer-local map
-   nnoremap <buffer> <cr>	:call <SID>NetList(expand("<cWORD>"))<cr>
-
-""   call Decho("netlist method<".b:netlist_method."> cmd<".b:netlist_cmd."> path<".b:netlist_path.">")
+   let dirname= dirname.newdir
+"   call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">")
   endif
 
-""  call Decho("executing: r! ".b:netlist_cmd." '".b:netlist_path."'")
-  put ='\" =============================='
-  put ='\" Netrw Remote Directory Listing'
-  put ='\"   '.g:netrw_machine.':'.b:netlist_path
-  put ='\" =============================='
-  exe "silent r! ".b:netlist_cmd." '".b:netlist_path."'"
-  1d
-  set ft=netrwlist
-  silent 5,$s/^\(.*\)\/$/ \1/e
-  silent 5,$call s:NetSort()
-  silent 5,$s/^ \(.*\)$/\1\//e
-  5
-  exe 'file ['.g:netrw_machine.':'.b:netlist_path.']'
-  if v:version >= 602
-   setlocal nomod bh=wipe bt=nofile nobl noma
-  else
-   setlocal nomod
-  endif
-
-""  call Dret("NetList")
+"  call Dret("NetListChgDir <".dirname.">")
+  return dirname
 endfun
 
 " ------------------------------------------------------------------------
@@ -1033,183 +1057,183 @@
 "	     8: fetch
 "	     9: sftp
 fun! s:NetMethod(choice)  " globals: method machine id passwd fname
-"" call Dfunc("NetMethod(a:choice<".a:choice.">)")
-
- " initialization
- let b:netrw_method  = 0
- let g:netrw_machine = ""
- let b:netrw_fname   = ""
- let g:netrw_port    = ""
-
- " Patterns:
- " mipf     : a:machine a:id password filename	    Use ftp
- " mf	    : a:machine filename		    Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd
- " ftpurm   : ftp://[user@]host[[#:]port]/filename  Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd
- " rcpurm   : rcp://[user@]host/filename	    Use rcp
- " rcphf    : [user@]host:filename		    Use rcp
- " scpurm   : scp://[user@]host[[#:]port]/filename  Use scp
- " httpurm  : http://[user@]host/filename	    Use wget
- " davurm   : dav://host[:port]/path                Use cadaver
- " rsyncurm : rsync://host[:port]/path              Use rsync
- " fetchurm : fetch://[user@]host[:http]/filename   Use fetch (defaults to ftp, override for http)
- " sftpurm  : sftp://[user@]host/filename  Use scp
- let mipf     = '^\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)$'
- let mf       = '^\(\S\+\)\s\+\(\S\+\)$'
- let ftpurm   = '^ftp://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
- let rcpurm   = '^rcp://\(\([^/@]\{-}\)@\)\=\([^/]\{-}\)/\(.*\)$'
- let rcphf    = '^\(\(\h\w*\)@\)\=\(\h\w*\):\([^@]\+\)$'
- let scpurm   = '^scp://\([^/]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
- let httpurm  = '^http://\([^/]\{-}\)\(/.*\)\=$'
- let davurm   = '^dav://\([^/]\{-}\)/\(.*\)\=$'
- let rsyncurm = '^rsync://\([^/]\{-}\)/\(.*\)\=$'
- let fetchurm = '^fetch://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$'
- let sftpurm  = '^sftp://\([^/]\{-}\)/\(.*\)\=$'
-
-"" call Decho("determine method:")
- " Determine Method
- " rcp://user@hostname/...path-to-file
- if match(a:choice,rcpurm) == 0
-""  call Decho("rcp://...")
-  let b:netrw_method = 1
-  let userid	     = substitute(a:choice,rcpurm,'\2',"")
-  let g:netrw_machine= substitute(a:choice,rcpurm,'\3',"")
-  let b:netrw_fname  = substitute(a:choice,rcpurm,'\4',"")
-  if userid != ""
-   let g:netrw_uid= userid
-  endif
-
- " scp://user@hostname/...path-to-file
- elseif match(a:choice,scpurm) == 0
-""  call Decho("scp://...")
-  let b:netrw_method = 4
-  let g:netrw_machine= substitute(a:choice,scpurm,'\1',"")
-  let b:netrw_port   = substitute(a:choice,scpurm,'\2',"")
-  let b:netrw_fname  = substitute(a:choice,scpurm,'\3',"")
-
- " http://user@hostname/...path-to-file
- elseif match(a:choice,httpurm) == 0
-""  call Decho("http://...")
-  let b:netrw_method = 5
-  let g:netrw_machine= substitute(a:choice,httpurm,'\1',"")
-  let b:netrw_fname  = substitute(a:choice,httpurm,'\2',"")
-
- " dav://hostname[:port]/..path-to-file..
- elseif match(a:choice,davurm) == 0
-""  call Decho("dav://...")
-  let b:netrw_method= 6
-  let g:netrw_machine= substitute(a:choice,davurm,'\1',"")
-  let b:netrw_fname  = substitute(a:choice,davurm,'\2',"")
-
- " rsync://user@hostname/...path-to-file
- elseif match(a:choice,rsyncurm) == 0
-""  call Decho("rsync://...")
-  let b:netrw_method = 7
-  let g:netrw_machine= substitute(a:choice,rsyncurm,'\1',"")
-  let b:netrw_fname  = substitute(a:choice,rsyncurm,'\2',"")
-
- " ftp://[user@]hostname[[:#]port]/...path-to-file
- elseif match(a:choice,ftpurm) == 0
-""  call Decho("ftp://...")
-  let userid	     = substitute(a:choice,ftpurm,'\2',"")
-  let g:netrw_machine= substitute(a:choice,ftpurm,'\3',"")
-  let g:netrw_port   = substitute(a:choice,ftpurm,'\4',"")
-  let b:netrw_fname  = substitute(a:choice,ftpurm,'\5',"")
-  if g:netrw_port != ""
-    let g:netrw_port = substitute(g:netrw_port,"[#:]","","")
-  endif
-  if userid != ""
-   let g:netrw_uid= userid
-  endif
-  if exists("g:netrw_uid") && exists("g:netrw_passwd")
-   let b:netrw_method = 3
-  else
-   if filereadable(expand("$HOME/.netrc")) && !exists("g:netrw_ignorenetrc")
-    let b:netrw_method= 2
-   else
-    if !exists("g:netrw_uid") || g:netrw_uid == ""
-     call NetUserPass()
-    elseif !exists("g:netrw_passwd") || g:netrw_passwd == ""
-     call NetUserPass(g:netrw_uid)
-   " else just use current g:netrw_uid and g:netrw_passwd
-    endif
-    let b:netrw_method= 3
+"   call Dfunc("NetMethod(a:choice<".a:choice.">)")
+ 
+  " initialization
+  let b:netrw_method  = 0
+  let g:netrw_machine = ""
+  let b:netrw_fname   = ""
+  let g:netrw_port    = ""
+ 
+  " Patterns:
+  " mipf     : a:machine a:id password filename	    Use ftp
+  " mf	    : a:machine filename		    Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd
+  " ftpurm   : ftp://[user@]host[[#:]port]/filename  Use ftp + <.netrc> or g:netrw_uid g:netrw_passwd
+  " rcpurm   : rcp://[user@]host/filename	    Use rcp
+  " rcphf    : [user@]host:filename		    Use rcp
+  " scpurm   : scp://[user@]host[[#:]port]/filename  Use scp
+  " httpurm  : http://[user@]host/filename	    Use wget
+  " davurm   : dav://host[:port]/path                Use cadaver
+  " rsyncurm : rsync://host[:port]/path              Use rsync
+  " fetchurm : fetch://[user@]host[:http]/filename   Use fetch (defaults to ftp, override for http)
+  " sftpurm  : sftp://[user@]host/filename  Use scp
+  let mipf     = '^\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)\s\+\(\S\+\)$'
+  let mf       = '^\(\S\+\)\s\+\(\S\+\)$'
+  let ftpurm   = '^ftp://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
+  let rcpurm   = '^rcp://\(\([^/@]\{-}\)@\)\=\([^/]\{-}\)/\(.*\)$'
+  let rcphf    = '^\(\(\h\w*\)@\)\=\(\h\w*\):\([^@]\+\)$'
+  let scpurm   = '^scp://\([^/]\{-}\)\([#:]\d\+\)\=/\(.*\)$'
+  let httpurm  = '^http://\([^/]\{-}\)\(/.*\)\=$'
+  let davurm   = '^dav://\([^/]\{-}\)/\(.*\)\=$'
+  let rsyncurm = '^rsync://\([^/]\{-}\)/\(.*\)\=$'
+  let fetchurm = '^fetch://\(\([^/@]\{-}\)@\)\=\([^/#:]\{-}\)\(:http\)\=/\(.*\)$'
+  let sftpurm  = '^sftp://\([^/]\{-}\)/\(.*\)\=$'
+ 
+"  call Decho("determine method:")
+  " Determine Method
+  " rcp://user@hostname/...path-to-file
+  if match(a:choice,rcpurm) == 0
+"   call Decho("rcp://...")
+   let b:netrw_method = 1
+   let userid	     = substitute(a:choice,rcpurm,'\2',"")
+   let g:netrw_machine= substitute(a:choice,rcpurm,'\3',"")
+   let b:netrw_fname  = substitute(a:choice,rcpurm,'\4',"")
+   if userid != ""
+    let g:netrw_uid= userid
    endif
-  endif
-
- elseif match(a:choice,fetchurm) == 0
-""  call Decho("fetch://...")
-  let b:netrw_method = 8
-  let g:netrw_userid = substitute(a:choice,fetchurm,'\2',"")
-  let g:netrw_machine= substitute(a:choice,fetchurm,'\3',"")
-  let b:netrw_option = substitute(a:choice,fetchurm,'\4',"")
-  let b:netrw_fname  = substitute(a:choice,fetchurm,'\5',"")
-
- " Issue an ftp : "machine id password [path/]filename"
- elseif match(a:choice,mipf) == 0
-""  call Decho("(ftp) host id pass file")
-  let b:netrw_method  = 3
-  let g:netrw_machine = substitute(a:choice,mipf,'\1',"")
-  let g:netrw_uid     = substitute(a:choice,mipf,'\2',"")
-  let g:netrw_passwd  = substitute(a:choice,mipf,'\3',"")
-  let b:netrw_fname   = substitute(a:choice,mipf,'\4',"")
-
- " Issue an ftp: "hostname [path/]filename"
- elseif match(a:choice,mf) == 0
-""  call Decho("(ftp) host file")
-  if exists("g:netrw_uid") && exists("g:netrw_passwd")
+ 
+  " scp://user@hostname/...path-to-file
+  elseif match(a:choice,scpurm) == 0
+"   call Decho("scp://...")
+   let b:netrw_method = 4
+   let g:netrw_machine= substitute(a:choice,scpurm,'\1',"")
+   let b:netrw_port   = substitute(a:choice,scpurm,'\2',"")
+   let b:netrw_fname  = substitute(a:choice,scpurm,'\3',"")
+ 
+  " http://user@hostname/...path-to-file
+  elseif match(a:choice,httpurm) == 0
+"   call Decho("http://...")
+   let b:netrw_method = 5
+   let g:netrw_machine= substitute(a:choice,httpurm,'\1',"")
+   let b:netrw_fname  = substitute(a:choice,httpurm,'\2',"")
+ 
+  " dav://hostname[:port]/..path-to-file..
+  elseif match(a:choice,davurm) == 0
+"   call Decho("dav://...")
+   let b:netrw_method= 6
+   let g:netrw_machine= substitute(a:choice,davurm,'\1',"")
+   let b:netrw_fname  = substitute(a:choice,davurm,'\2',"")
+ 
+  " rsync://user@hostname/...path-to-file
+  elseif match(a:choice,rsyncurm) == 0
+"   call Decho("rsync://...")
+   let b:netrw_method = 7
+   let g:netrw_machine= substitute(a:choice,rsyncurm,'\1',"")
+   let b:netrw_fname  = substitute(a:choice,rsyncurm,'\2',"")
+ 
+  " ftp://[user@]hostname[[:#]port]/...path-to-file
+  elseif match(a:choice,ftpurm) == 0
+"   call Decho("ftp://...")
+   let userid	     = substitute(a:choice,ftpurm,'\2',"")
+   let g:netrw_machine= substitute(a:choice,ftpurm,'\3',"")
+   let g:netrw_port   = substitute(a:choice,ftpurm,'\4',"")
+   let b:netrw_fname  = substitute(a:choice,ftpurm,'\5',"")
+   if g:netrw_port != ""
+     let g:netrw_port = substitute(g:netrw_port,"[#:]","","")
+   endif
+   if userid != ""
+    let g:netrw_uid= userid
+   endif
+   if exists("g:netrw_uid") && exists("g:netrw_passwd")
+    let b:netrw_method = 3
+   else
+    if filereadable(expand("$HOME/.netrc")) && !exists("g:netrw_ignorenetrc")
+     let b:netrw_method= 2
+    else
+     if !exists("g:netrw_uid") || g:netrw_uid == ""
+      call NetUserPass()
+     elseif !exists("g:netrw_passwd") || g:netrw_passwd == ""
+      call NetUserPass(g:netrw_uid)
+    " else just use current g:netrw_uid and g:netrw_passwd
+     endif
+     let b:netrw_method= 3
+    endif
+   endif
+ 
+  elseif match(a:choice,fetchurm) == 0
+"   call Decho("fetch://...")
+   let b:netrw_method = 8
+   let g:netrw_userid = substitute(a:choice,fetchurm,'\2',"")
+   let g:netrw_machine= substitute(a:choice,fetchurm,'\3',"")
+   let b:netrw_option = substitute(a:choice,fetchurm,'\4',"")
+   let b:netrw_fname  = substitute(a:choice,fetchurm,'\5',"")
+ 
+  " Issue an ftp : "machine id password [path/]filename"
+  elseif match(a:choice,mipf) == 0
+"   call Decho("(ftp) host id pass file")
    let b:netrw_method  = 3
-   let g:netrw_machine = substitute(a:choice,mf,'\1',"")
-   let b:netrw_fname   = substitute(a:choice,mf,'\2',"")
-
-  elseif filereadable(expand("$HOME/.netrc"))
-   let b:netrw_method  = 2
-   let g:netrw_machine = substitute(a:choice,mf,'\1',"")
-   let b:netrw_fname   = substitute(a:choice,mf,'\2',"")
+   let g:netrw_machine = substitute(a:choice,mipf,'\1',"")
+   let g:netrw_uid     = substitute(a:choice,mipf,'\2',"")
+   let g:netrw_passwd  = substitute(a:choice,mipf,'\3',"")
+   let b:netrw_fname   = substitute(a:choice,mipf,'\4',"")
+ 
+  " Issue an ftp: "hostname [path/]filename"
+  elseif match(a:choice,mf) == 0
+"   call Decho("(ftp) host file")
+   if exists("g:netrw_uid") && exists("g:netrw_passwd")
+    let b:netrw_method  = 3
+    let g:netrw_machine = substitute(a:choice,mf,'\1',"")
+    let b:netrw_fname   = substitute(a:choice,mf,'\2',"")
+ 
+   elseif filereadable(expand("$HOME/.netrc"))
+    let b:netrw_method  = 2
+    let g:netrw_machine = substitute(a:choice,mf,'\1',"")
+    let b:netrw_fname   = substitute(a:choice,mf,'\2',"")
+   endif
+ 
+  " sftp://user@hostname/...path-to-file
+  elseif match(a:choice,sftpurm) == 0
+"   call Decho("sftp://...")
+   let b:netrw_method = 9
+   let g:netrw_machine= substitute(a:choice,sftpurm,'\1',"")
+   let b:netrw_fname  = substitute(a:choice,sftpurm,'\2',"")
+ 
+  " Issue an rcp: hostname:filename"  (this one should be last)
+  elseif match(a:choice,rcphf) == 0
+"   call Decho("(rcp) [user@]host:file) rcphf<".rcphf.">")
+   let b:netrw_method = 1
+   let userid	     = substitute(a:choice,rcphf,'\2',"")
+   let g:netrw_machine= substitute(a:choice,rcphf,'\3',"")
+   let b:netrw_fname  = substitute(a:choice,rcphf,'\4',"")
+"   call Decho('\1<'.substitute(a:choice,rcphf,'\1',"").">")
+"   call Decho('\2<'.substitute(a:choice,rcphf,'\2',"").">")
+"   call Decho('\3<'.substitute(a:choice,rcphf,'\3',"").">")
+"   call Decho('\4<'.substitute(a:choice,rcphf,'\4',"").">")
+   if userid != ""
+    let g:netrw_uid= userid
+   endif
+   if has("win32")
+    " don't let PCs try <.netrc>
+    let b:netrw_method = 3
+   endif
+ 
+  else
+   echoerr "***error*** cannot determine method"
+   let b:netrw_method  = -1
   endif
-
- " sftp://user@hostname/...path-to-file
- elseif match(a:choice,sftpurm) == 0
-""  call Decho("sftp://...")
-  let b:netrw_method = 9
-  let g:netrw_machine= substitute(a:choice,sftpurm,'\1',"")
-  let b:netrw_fname  = substitute(a:choice,sftpurm,'\2',"")
-
- " Issue an rcp: hostname:filename"  (this one should be last)
- elseif match(a:choice,rcphf) == 0
-""  call Decho("(rcp) [user@]host:file) rcphf<".rcphf.">")
-  let b:netrw_method = 1
-  let userid	     = substitute(a:choice,rcphf,'\2',"")
-  let g:netrw_machine= substitute(a:choice,rcphf,'\3',"")
-  let b:netrw_fname  = substitute(a:choice,rcphf,'\4',"")
-""  call Decho('\1<'.substitute(a:choice,rcphf,'\1',"").">")
-""  call Decho('\2<'.substitute(a:choice,rcphf,'\2',"").">")
-""  call Decho('\3<'.substitute(a:choice,rcphf,'\3',"").">")
-""  call Decho('\4<'.substitute(a:choice,rcphf,'\4',"").">")
-  if userid != ""
-   let g:netrw_uid= userid
-  endif
-  if has("win32")
-   " don't let PCs try <.netrc>
-   let b:netrw_method = 3
-  endif
-
- else
-  echoerr "***error*** cannot determine method"
-  let b:netrw_method  = -1
- endif
-
-"" call Decho("a:choice       <".a:choice.">")
-"" call Decho("b:netrw_method <".b:netrw_method.">")
-"" call Decho("g:netrw_machine<".g:netrw_machine.">")
-"" call Decho("g:netrw_port   <".g:netrw_port.">")
-"" if exists("g:netrw_uid")		"Decho
-""  call Decho("g:netrw_uid    <".g:netrw_uid.">")
-"" endif					"Decho
-"" if exists("g:netrw_passwd")		"Decho
-""  call Decho("g:netrw_passwd <".g:netrw_passwd.">")
-"" endif					"Decho
-"" call Decho("b:netrw_fname  <".b:netrw_fname.">")
-"" call Dret("NetMethod")
+ 
+"  call Decho("a:choice       <".a:choice.">")
+"  call Decho("b:netrw_method <".b:netrw_method.">")
+"  call Decho("g:netrw_machine<".g:netrw_machine.">")
+"  call Decho("g:netrw_port   <".g:netrw_port.">")
+"  if exists("g:netrw_uid")		"Decho
+"   call Decho("g:netrw_uid    <".g:netrw_uid.">")
+"  endif					"Decho
+"  if exists("g:netrw_passwd")		"Decho
+"   call Decho("g:netrw_passwd <".g:netrw_passwd.">")
+"  endif					"Decho
+"  call Decho("b:netrw_fname  <".b:netrw_fname.">")
+"  call Dret("NetMethod")
 endfun
 " end of NetMethod
 
@@ -1222,83 +1246,83 @@
 
  " get/set userid
  if a:0 == 0
-""  call Dfunc("NetUserPass(a:0<".a:0.">)")
+"  call Dfunc("NetUserPass(a:0<".a:0.">)")
   if !exists("g:netrw_uid") || g:netrw_uid == ""
    " via prompt
    let g:netrw_uid= input('Enter username: ')
   endif
  else	" from command line
-""  call Dfunc("NetUserPass(a:1<".a:1.">) {")
+"  call Dfunc("NetUserPass(a:1<".a:1.">) {")
   let g:netrw_uid= a:1
  endif
 
  " get password
  if a:0 <= 1 " via prompt
-""  call Decho("a:0=".a:0." case <=1:")
+"  call Decho("a:0=".a:0." case <=1:")
   let g:netrw_passwd= inputsecret("Enter Password: ")
  else " from command line
-""  call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
+"  call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
   let g:netrw_passwd=a:2
  endif
-""  call Dret("NetUserPass")
+"  call Dret("NetUserPass")
 endfun
 " end NetUserPass
 
 " ------------------------------------------------------------------------
 " NetOptionSave: save options and set to "standard" form {{{1
 fun!s:NetOptionSave()
-"" call Dfunc("NetOptionSave()")
+"  call Dfunc("NetOptionSave()")
 
- " Get Temporary Filename
- let s:aikeep	= &ai
- let s:cinkeep	= &cin
- let s:cinokeep = &cino
- let s:comkeep	= &com
- let s:cpokeep	= &cpo
- let s:dirkeep	= getcwd()
- let s:gdkeep	= &gd
- let s:twkeep	= &tw
- set cino =
- set com  =
- set cpo -=aA
- set nocin noai
- set tw   =0
- if has("win32") && !has("win95")
-  let s:swfkeep= &swf
-  set noswf
-""  call Decho("setting s:swfkeep to <".&swf.">")
- endif
+  " Get Temporary Filename
+  let s:aikeep	= &ai
+  let s:cinkeep	= &cin
+  let s:cinokeep = &cino
+  let s:comkeep	= &com
+  let s:cpokeep	= &cpo
+  let s:dirkeep	= getcwd()
+  let s:gdkeep	= &gd
+  let s:twkeep	= &tw
+  set cino =
+  set com  =
+  set cpo -=aA
+  set nocin noai
+  set tw   =0
+  if has("win32") && !has("win95")
+   let s:swfkeep= &swf
+   set noswf
+"  call Decho("setting s:swfkeep to <".&swf.">")
+  endif
 
-"" call Dret("NetOptionSave")
+"  call Dret("NetOptionSave")
 endfun
 
 " ------------------------------------------------------------------------
 " NetOptionRestore: restore options {{{1
 fun! s:NetOptionRestore()
-"" call Dfunc("NetOptionRestore()")
-
- let &ai	= s:aikeep
- let &cin	= s:cinkeep
- let &cino	= s:cinokeep
- let &com	= s:comkeep
- let &cpo	= s:cpokeep
- exe "lcd ".s:dirkeep
- let &gd	= s:gdkeep
- let &tw	= s:twkeep
- if exists("s:swfkeep")
-  let &swf= s:swfkeep
-  unlet s:swfkeep
- endif
- unlet s:aikeep
- unlet s:cinkeep
- unlet s:cinokeep
- unlet s:comkeep
- unlet s:cpokeep
- unlet s:gdkeep
- unlet s:twkeep
- unlet s:dirkeep
-
-"" call Dret("NetOptionRestore")
+"  call Dfunc("NetOptionRestore()")
+ 
+  let &ai	= s:aikeep
+  let &cin	= s:cinkeep
+  let &cino	= s:cinokeep
+  let &com	= s:comkeep
+  let &cpo	= s:cpokeep
+  exe "lcd ".s:dirkeep
+  let &gd	= s:gdkeep
+  let &tw	= s:twkeep
+  if exists("s:swfkeep")
+   let &swf= s:swfkeep
+   unlet s:swfkeep
+  endif
+  unlet s:aikeep
+  unlet s:cinkeep
+  unlet s:cinokeep
+  unlet s:comkeep
+  unlet s:cpokeep
+  unlet s:gdkeep
+  unlet s:twkeep
+  unlet s:dirkeep
+ 
+"  call Dret("NetOptionRestore")
 endfun
 
 " ------------------------------------------------------------------------
@@ -1310,12 +1334,12 @@
 "               at the end of the transfer.
 if has("win95") && g:netrw_win95ftp
  fun! NetReadFixup(method, line1, line2)
-""   call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
+"   call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
    if method == 3   " ftp (no <.netrc>)
     let fourblanklines= line2 - 3
     silent fourblanklines.",".line2."g/^\s*/d"
    endif
-""   call Dret("NetReadFixup")
+"   call Dret("NetReadFixup")
  endfun
 endif
 
@@ -1340,8 +1364,8 @@
     endwhile
     " do insert
     if lo < i
-      exec i.'d_'
-      call append(lo - 1, i_val)
+      exe 'keepjumps '.i.'d_'
+      keepjumps call append(lo - 1, i_val)
     endif
     let i = i + 1
   endwhile
diff --git a/runtime/syntax/logtalk.vim b/runtime/syntax/logtalk.vim
index b8218da..3cc368d 100644
--- a/runtime/syntax/logtalk.vim
+++ b/runtime/syntax/logtalk.vim
@@ -2,7 +2,7 @@
 "
 " Language:	Logtalk
 " Maintainer:	Paulo Moura <pmoura@logtalk.org>
-" Last Change:	2004 May 16
+" Last Change:	2004 June 1
 
 
 " Quit when a syntax file was already loaded:
@@ -55,9 +55,7 @@
 
 " Logtalk closing entity directives
 
-syn match	logtalkCloseEntityDir	":- end_object\."
-syn match	logtalkCloseEntityDir	":- end_protocol\."
-syn match	logtalkCloseEntityDir	":- end_category\."
+syn match	logtalkCloseEntityDir	":- end_\(object\|protocol\|category\)\."
 
 
 " Logtalk entity relations
@@ -88,38 +86,24 @@
 
 " Logtalk built-in predicates
 
-syn match	logtalkBuiltIn		"\<current_object\ze("
-syn match	logtalkBuiltIn		"\<current_protocol\ze("
-syn match	logtalkBuiltIn		"\<current_category\ze("
+syn match	logtalkBuiltIn		"\<current_\(object\|protocol\|category\)\ze("
 
-syn match	logtalkBuiltIn		"\<create_object\ze("
-syn match	logtalkBuiltIn		"\<create_protocol\ze("
-syn match	logtalkBuiltIn		"\<create_category\ze("
+syn match	logtalkBuiltIn		"\<create_\(object\|protocol\|category\)\ze("
 
-syn match	logtalkBuiltIn		"\<object_property\ze("
-syn match	logtalkBuiltIn		"\<protocol_property\ze("
-syn match	logtalkBuiltIn		"\<category_property\ze("
+syn match	logtalkBuiltIn		"\<\(object\|protocol\|category\)_property\ze("
 
-syn match	logtalkBuiltIn		"\<abolish_object\ze("
-syn match	logtalkBuiltIn		"\<abolish_protocol\ze("
-syn match	logtalkBuiltIn		"\<abolish_category\ze("
+syn match	logtalkBuiltIn		"\<abolish_\(object\|protocol\|category\)\ze("
 
-syn match	logtalkBuiltIn		"\<extends_object\ze("
-syn match	logtalkBuiltIn		"\<extends_protocol\ze("
-syn match	logtalkBuiltIn		"\<implements_protocol\ze("
-syn match	logtalkBuiltIn		"\<instantiates_class\ze("
-syn match	logtalkBuiltIn		"\<specializes_class\ze("
-syn match	logtalkBuiltIn		"\<imports_category\ze("
+syn match	logtalkBuiltIn		"\<extends_\(object\|protocol\)\ze("
+syn match	logtalkBuiltIn		"\<imp\(orts_category\|lements_protocol\)\ze("
+syn match	logtalkBuiltIn		"\<\(instantiates\|specializes\)_class\ze("
 
-syn match	logtalkBuiltIn		"\<abolish_events\ze("
+syn match	logtalkBuiltIn		"\<\(abolish\|define\)_events\ze("
 syn match	logtalkBuiltIn		"\<current_event\ze("
-syn match	logtalkBuiltIn		"\<define_events\ze("
 
-syn match	logtalkBuiltIn		"\<current_logtalk_flag\ze("
-syn match	logtalkBuiltIn		"\<set_logtalk_flag\ze("
+syn match	logtalkBuiltIn		"\<\(current\|set\)_logtalk_flag\ze("
 
-syn match	logtalkBuiltIn		"\<logtalk_compile\ze("
-syn match	logtalkBuiltIn		"\<logtalk_load\ze("
+syn match	logtalkBuiltIn		"\<logtalk_\(compile\|load\)\ze("
 
 syn match	logtalkBuiltIn		"\<forall\ze("
 syn match	logtalkBuiltIn		"\<retractall\ze("
@@ -128,24 +112,20 @@
 " Logtalk built-in methods
 
 syn match	logtalkBuiltInMethod	"\<parameter\ze("
-syn match	logtalkBuiltInMethod	"\<self\ze("
-syn match	logtalkBuiltInMethod	"\<sender\ze("
+syn match	logtalkBuiltInMethod	"\<se\(lf\|nder\)\ze("
 syn match	logtalkBuiltInMethod	"\<this\ze("
 
 syn match	logtalkBuiltInMethod	"\<current_predicate\ze("
 syn match	logtalkBuiltInMethod	"\<predicate_property\ze("
 
 syn match	logtalkBuiltInMethod	"\<abolish\ze("
-syn match	logtalkBuiltInMethod	"\<asserta\ze("
-syn match	logtalkBuiltInMethod	"\<assertz\ze("
+syn match	logtalkBuiltInMethod	"\<assert\(a\|z\)\ze("
 syn match	logtalkBuiltInMethod	"\<clause\ze("
 syn match	logtalkBuiltInMethod	"\<retract\ze("
 syn match	logtalkBuiltInMethod	"\<retractall\ze("
 
-syn match	logtalkBuiltInMethod	"\<bagof\ze("
-syn match	logtalkBuiltInMethod	"\<findall\ze("
-syn match	logtalkBuiltInMethod	"\<forall\ze("
-syn match	logtalkBuiltInMethod	"\<setof\ze("
+syn match	logtalkBuiltInMethod	"\<\(bag\|set\)of\ze("
+syn match	logtalkBuiltInMethod	"\<f\(ind\|or\)all\ze("
 
 syn match	logtalkBuiltInMethod	"\<before\ze("
 syn match	logtalkBuiltInMethod	"\<after\ze("
@@ -163,13 +143,12 @@
 
 syn match	logtalkKeyword		"\<true\>"
 syn match	logtalkKeyword		"\<fail\>"
-syn match	logtalkKeyword		"\<call\ze("
+syn match	logtalkKeyword		"\<ca\(ll\|tch\)\ze("
 syn match	logtalkOperator		"!"
-syn match	logtalkOperator		","
+" syn match	logtalkOperator		","
 syn match	logtalkOperator		";"
 syn match	logtalkOperator		"-->"
 syn match	logtalkOperator		"->"
-syn match	logtalkKeyword		"\<catch\ze("
 syn match	logtalkKeyword		"\<throw\ze("
 
 
@@ -188,8 +167,7 @@
 syn match	logtalkKeyword		"\<float\ze("
 syn match	logtalkKeyword		"\<atomic\ze("
 syn match	logtalkKeyword		"\<compound\ze("
-syn match	logtalkKeyword		"\<nonvar\ze("
-syn match	logtalkKeyword		"\<number\ze("
+syn match	logtalkKeyword		"\<n\(onvar\|umber\)\ze("
 
 
 " Term comparison
@@ -227,10 +205,8 @@
 
 " Stream selection and control
 
-syn match	logtalkKeyword		"\<current_input\ze("
-syn match	logtalkKeyword		"\<current_output\ze("
-syn match	logtalkKeyword		"\<set_input\ze("
-syn match	logtalkKeyword		"\<set_output\ze("
+syn match	logtalkKeyword		"\<current_\(input\|output\)\ze("
+syn match	logtalkKeyword		"\<set_\(input\|output\)\ze("
 syn match	logtalkKeyword		"\<open\ze("
 syn match	logtalkKeyword		"\<close\ze("
 syn match	logtalkKeyword		"\<flush_output\ze("
@@ -241,33 +217,20 @@
 syn match	logtalkKeyword		"\<set_stream_position\ze("
 
 
-" Character input/output
+" Character and byte input/output
 
-syn match	logtalkKeyword		"\<get_char\ze("
-syn match	logtalkKeyword		"\<get_code\ze("
-syn match	logtalkKeyword		"\<peek_char\ze("
-syn match	logtalkKeyword		"\<peek_code\ze("
-syn match	logtalkKeyword		"\<put_char\ze("
-syn match	logtalkKeyword		"\<put_code\ze("
+syn match	logtalkKeyword		"\<\(get\|peek\|put\)_\(char\|code\|byte\)\ze("
 syn match	logtalkKeyword		"\<nl\ze("
 syn match	logtalkKeyword		"\<nl\>"
 
 
-" Byte input/output
-
-syn match	logtalkKeyword		"\<get_byte\ze("
-syn match	logtalkKeyword		"\<peek_byte\ze("
-syn match	logtalkKeyword		"\<put_byte\ze("
-
-
 " Term input/output
 
 syn match	logtalkKeyword		"\<read_term\ze("
 syn match	logtalkKeyword		"\<read\ze("
-syn match	logtalkKeyword		"\<write_term\ze("
 syn match	logtalkKeyword		"\<write\ze("
 syn match	logtalkKeyword		"\<writeq\ze("
-syn match	logtalkKeyword		"\<write_canonical\ze("
+syn match	logtalkKeyword		"\<write_\(canonical\|term\)\ze("
 syn match	logtalkKeyword		"\<op\ze("
 syn match	logtalkKeyword		"\<current_op\ze("
 syn match	logtalkKeyword		"\<char_conversion\ze("
@@ -283,20 +246,15 @@
 
 " Atomic term processing
 
-syn match	logtalkKeyword		"\<atom_length\ze("
-syn match	logtalkKeyword		"\<atom_concat\ze("
+syn match	logtalkKeyword		"\<atom_\(length\|concat\|chars\|codes\)\ze("
 syn match	logtalkKeyword		"\<sub_atom\ze("
-syn match	logtalkKeyword		"\<atom_chars\ze("
-syn match	logtalkKeyword		"\<atom_codes\ze("
 syn match	logtalkKeyword		"\<char_code\ze("
-syn match	logtalkKeyword		"\<number_chars\ze("
-syn match	logtalkKeyword		"\<number_codes\ze("
+syn match	logtalkKeyword		"\<number_\(chars\|codes\)\ze("
 
 
 " Implementation defined hooks functions
 
-syn match	logtalkKeyword		"\<set_prolog_flag\ze("
-syn match	logtalkKeyword		"\<current_prolog_flag\ze("
+syn match	logtalkKeyword		"\<\(current\|set\)_prolog_flag\ze("
 syn match	logtalkKeyword		"\<halt\ze("
 syn match	logtalkKeyword		"\<halt\>"
 
@@ -314,8 +272,7 @@
 syn match	logtalkKeyword		"\<mod\>"
 syn match	logtalkKeyword		"\<abs\ze("
 syn match	logtalkKeyword		"\<sign\ze("
-syn match	logtalkKeyword		"\<float_integer_part\ze("
-syn match	logtalkKeyword		"\<float_fractional_part\ze("
+syn match	logtalkKeyword		"\<float_\(integer\|fractional\)_part\ze("
 syn match	logtalkKeyword		"\<float\ze("
 syn match	logtalkKeyword		"\<floor\ze("
 syn match	logtalkKeyword		"\<truncate\ze("
@@ -326,12 +283,11 @@
 " Other arithemtic functors
 
 syn match	logtalkOperator		"\*\*"
-syn match	logtalkKeyword		"\<sin\ze("
+syn match	logtalkKeyword		"\<s\(in\|qrt\)\ze("
 syn match	logtalkKeyword		"\<cos\ze("
 syn match	logtalkKeyword		"\<atan\ze("
 syn match	logtalkKeyword		"\<exp\ze("
 syn match	logtalkKeyword		"\<log\ze("
-syn match	logtalkKeyword		"\<sqrt\ze("
 
 
 " Bitwise functors
diff --git a/runtime/syntax/texinfo.vim b/runtime/syntax/texinfo.vim
index c7d5d8e..134fc67 100644
--- a/runtime/syntax/texinfo.vim
+++ b/runtime/syntax/texinfo.vim
@@ -2,7 +2,7 @@
 " Language:	Texinfo (macro package for TeX)
 " Maintainer:	Sandor Kopanyi <sandor.kopanyi@mailbox.hu>
 " URL:		<->
-" Last Change:	2003 May 11
+" Last Change:	2004 Jun 23
 "
 " the file follows the Texinfo manual structure; this file is based
 " on manual for Texinfo version 4.0, 28 September 1999
@@ -351,7 +351,7 @@
 syn match  texinfoAtCmd "@refill"
 
 
-syn cluster texinfoAll contains=ALLBUT,{texinfoThisAtCmd,texinfoHFSpecialChar}
+syn cluster texinfoAll contains=ALLBUT,texinfoThisAtCmd,texinfoHFSpecialChar
 syn cluster texinfoReducedAll contains=texinfoSpecialChar,texinfoBrcPrmAtCmd
 "==============================================================================
 " highlighting