Update runtime files
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index ef98000..482eb5c 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -38,7 +38,7 @@
       with:
         languages: ${{ matrix.language }}
         # If you wish to specify custom queries, you can do so here or in a config file.
-        # By default, queries listed here will override any specified in a config file. 
+        # By default, queries listed here will override any specified in a config file.
         # Prefix the list here with "+" to use these queries and those in the config file.
         # queries: ./path/to/local/query, your-org/your-repo/queries@main
 
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ef518f8..4918d5a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -57,7 +57,7 @@
 improvement, please first try to contact the maintainer directly.
 Look in the header of the file for the name and email address.
 
-The maintainer will take care of issues and send updates to Bram for 
+The maintainer will take care of issues and send updates to Bram for
 distribution with Vim.
 
 If the maintainer does not respond, contact the vim-dev maillist.
diff --git a/README.md b/README.md
index 1cb89fc..5c8403c 100644
--- a/README.md
+++ b/README.md
@@ -46,7 +46,7 @@
 documentation, syntax files and other files that are used at runtime.  To run
 Vim you must get either one of the binary archives or a source archive.
 Which one you need depends on the system you want to run it on and whether you
-want or must compile it yourself.  Check http://www.vim.org/download.php for
+want or must compile it yourself.  Check https://www.vim.org/download.php for
 an overview of currently available distributions.
 
 Some popular places to get the latest Vim:
@@ -86,7 +86,7 @@
 started as `vimtutor`.  See `:help tutor` for more information.
 
 The best is to use `:help` in Vim.  If you don't have an executable yet, read
-[`runtime/doc/help.txt`](/runtime/doc/help.txt). 
+[`runtime/doc/help.txt`](/runtime/doc/help.txt).
 It contains pointers to the other documentation files.
 The User Manual reads like a book and is recommended to learn to use
 Vim.  See `:help user-manual`.
@@ -117,7 +117,7 @@
 at the same time donations increase Bram's motivation to keep working on Vim!
 
 For the most recent information about sponsoring look on the Vim web site:
-	http://www.vim.org/sponsor/
+	https://www.vim.org/sponsor/
 
 
 ## Contributing ##
@@ -129,15 +129,15 @@
 ## Information ##
 
 The latest news about Vim can be found on the Vim home page:
-	http://www.vim.org/
+	https://www.vim.org/
 
 If you have problems, have a look at the Vim documentation or tips:
-	http://www.vim.org/docs.php
-	http://vim.wikia.com/wiki/Vim_Tips_Wiki
+	https://www.vim.org/docs.php
+	https://vim.fandom.com/wiki/Vim_Tips_Wiki
 
 If you still have problems or any other questions, use one of the mailing
 lists to discuss them with Vim users and developers:
-	http://www.vim.org/maillist.php
+	https://www.vim.org/maillist.php
 
 If nothing else works, report bugs directly:
 	Bram Moolenaar <Bram@vim.org>
diff --git a/README.txt b/README.txt
index ead022b..54f207c 100644
--- a/README.txt
+++ b/README.txt
@@ -33,7 +33,7 @@
 documentation, syntax files and other files that are used at runtime.  To run
 Vim you must get either one of the binary archives or a source archive.
 Which one you need depends on the system you want to run it on and whether you
-want or must compile it yourself.  Check "http://www.vim.org/download.php" for
+want or must compile it yourself.  Check "https://www.vim.org/download.php" for
 an overview of currently available distributions.
 
 Some popular places to get the latest Vim:
@@ -101,7 +101,7 @@
 
 For the most recent information about sponsoring look on the Vim web site:
 
-	http://www.vim.org/sponsor/
+	https://www.vim.org/sponsor/
 
 
 CONTRIBUTING
@@ -112,15 +112,15 @@
 INFORMATION
 
 The latest news about Vim can be found on the Vim home page:
-	http://www.vim.org/
+	https://www.vim.org/
 
 If you have problems, have a look at the Vim documentation or tips:
-	http://www.vim.org/docs.php
-	http://vim.wikia.com/wiki/Vim_Tips_Wiki
+	https://www.vim.org/docs.php
+	https://vim.fandom.com/wiki/Vim_Tips_Wiki
 
 If you still have problems or any other questions, use one of the mailing
 lists to discuss them with Vim users and developers:
-	http://www.vim.org/maillist.php
+	https://www.vim.org/maillist.php
 
 If nothing else works, report bugs directly:
 	Bram Moolenaar <Bram@vim.org>
diff --git a/README_VIM9.md b/README_VIM9.md
index e4d2914..b3ca49f 100644
--- a/README_VIM9.md
+++ b/README_VIM9.md
@@ -337,7 +337,7 @@
 echo Python()
 echo 'Python: ' .. reltimestr(reltime(start))
 bwipe!
- 
+
 new
 call setline(1, range(100000))
 let start = reltime()
diff --git a/nsis/lang/turkish.nsi b/nsis/lang/turkish.nsi
index 43cdb52..4c966c5 100644
--- a/nsis/lang/turkish.nsi
+++ b/nsis/lang/turkish.nsi
@@ -10,7 +10,7 @@
         "$(^Name) Setup"
 LangString ^UninstallCaption ${LANG_TURKISH} \
         "$(^Name) Uninstall"
-        
+
 LangString str_show_readme          ${LANG_TURKISH} \
     "Kurulum bittikten sonra README dosyasını aç"
 
@@ -23,7 +23,7 @@
 
 LangString str_type_full            ${LANG_TURKISH} \
     "Tam"
-    
+
 ##############################################################################
 # Section Titles & Description                                            {{{1
 ##############################################################################
@@ -62,12 +62,12 @@
     "Başlat Menüsü - Programlar klasöründe"
 LangString str_desc_start_menu      ${LANG_TURKISH} \
     "Vim kısayolunu Başlat Menüsüne ekler."
-    
+
 LangString str_section_edit_with    ${LANG_TURKISH} \
     "Vim ile Aç"
 LangString str_desc_edit_with       ${LANG_TURKISH} \
     "Vim'i $\"Birlikte aç$\" sağ tık menüsüne ekler."
-    
+
  LangString str_section_vim_rc       ${LANG_TURKISH} \
     "Bir yapılandırma dosyası oluştur"
 LangString str_desc_vim_rc          ${LANG_TURKISH} \
@@ -93,7 +93,7 @@
 LangString str_section_vis_vim      ${LANG_TURKISH} \
     "VisVim eklentisi"
 LangString str_desc_vis_vim         ${LANG_TURKISH} \
-    "Microsoft Visual Studio entegrasyonu için VisVim eklentisi" 
+    "Microsoft Visual Studio entegrasyonu için VisVim eklentisi"
 
 LangString str_section_nls          ${LANG_TURKISH} \
     "Ek dil desteği"
@@ -129,14 +129,14 @@
     "Vim kök dizinini kaldır"
 LangString str_desc_rm_rootdir      ${LANG_TURKISH} \
     "Vim kök dizinini kaldırır. Bu dizin Vim yapılandırma dosyalarını içerir!"
-    
+
  LangString str_msg_install_fail  ${LANG_TURKISH} \
     "Yükleme başarısız oldu. Yeniden deneyin."
 
 LangString str_msg_rm_exe_fail   ${LANG_TURKISH} \
     "$0 içindeki bazı dosyalar silinemedi!$\r$\n\
      Bu dosyaları el ile kaldırmalısınız."
-     
+
  LangString str_msg_uninstalling  ${LANG_TURKISH} \
     "Eski sürüm kaldırılıyor..."
 
diff --git a/pixmaps/gen-inline-pixbufs.sh b/pixmaps/gen-inline-pixbufs.sh
index 8e11a23..616c547 100644
--- a/pixmaps/gen-inline-pixbufs.sh
+++ b/pixmaps/gen-inline-pixbufs.sh
@@ -3,11 +3,9 @@
 prefix=stock_
 list=
 
-for file in "$@"
-do
-    name=`echo "$file" | sed 's|-|_|g; s|^.*/||; s|\..*$||'`
+for file in "$@"; do
+    name=$(echo "$file" | sed 's|-|_|g; s|^.*/||; s|\..*$||')
     list="$list $prefix$name $file"
 done
 
 gdk-pixbuf-csource --raw --static --build-list $list
-
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index d095f6d..5ea8319 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -1,7 +1,7 @@
 " netrw.vim: Handles file transfer and remote directory listing across
 "            AUTOLOAD SECTION
-" Date:		Sep 18, 2020
-" Version:	170
+" Date:		Aug 16, 2021
+" Version:	171
 " Maintainer:	Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
 " Copyright:    Copyright (C) 2016 Charles E. Campbell {{{1
@@ -43,7 +43,7 @@
  endfor
 endif
 
-let g:loaded_netrw = "v170"
+let g:loaded_netrw = "v171"
 if !exists("s:NOTE")
  let s:NOTE    = 0
  let s:WARNING = 1
@@ -93,7 +93,7 @@
    else
     let msg= level.a:msg
    endif
-   let s:popuperr_id  = popup_beval(msg,{})
+   let s:popuperr_id  = popup_atcursor(msg,{})
    let s:popuperr_text= ""
  elseif g:netrw_use_errorwindow
    " (default) netrw creates a one-line window to show error/warning
@@ -322,6 +322,7 @@
 call s:NetrwInit("g:netrw_browse_split", 0)
 call s:NetrwInit("g:netrw_bufsettings" , "noma nomod nonu nobl nowrap ro nornu")
 call s:NetrwInit("g:netrw_chgwin"      , -1)
+call s:NetrwInit("g:netrw_clipboard"   , 1)
 call s:NetrwInit("g:netrw_compress"    , "gzip")
 call s:NetrwInit("g:netrw_ctags"       , "ctags")
 if exists("g:netrw_cursorline") && !exists("g:netrw_cursor")
@@ -331,6 +332,7 @@
 call s:NetrwInit("g:netrw_cursor"      , 2)
 let s:netrw_usercul = &cursorline
 let s:netrw_usercuc = &cursorcolumn
+"call Decho("(netrw) COMBAK: cuc=".&l:cuc." cul=".&l:cul." initialization of s:netrw_cu[cl]")
 call s:NetrwInit("g:netrw_cygdrive","/cygdrive")
 " Default values - d-g ---------- {{{3
 call s:NetrwInit("s:didstarstar",0)
@@ -703,7 +705,7 @@
   endif
 
   " save registers
-  if has("clipboard")
+  if has("clipboard") && g:netrw_clipboard
 "   call Decho("(netrw#Explore) save @* and @+",'~'.expand("<slnum>"))
    sil! let keepregstar = @*
    sil! let keepregplus = @+
@@ -931,7 +933,7 @@
 "     call Decho("..case Nexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("<slnum>"))
      if !exists("w:netrw_explore_list") " sanity check
       NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or <s-down> improperly; see help for netrw-starstar",40)
-      if has("clipboard")
+      if has("clipboard") && g:netrw_clipboard
 "       call Decho("(netrw#Explore) restore @* and @+",'~'.expand("<slnum>"))
        if @* != keepregstar | sil! let @* = keepregstar | endif
        if @+ != keepregplus | sil! let @+ = keepregplus | endif
@@ -957,7 +959,7 @@
 "     call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("<slnum>"))
      if !exists("w:netrw_explore_list") " sanity check
       NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or <s-up> improperly; see help for netrw-starstar",41)
-      if has("clipboard")
+      if has("clipboard") && g:netrw_clipboard
 "       call Decho("(netrw#Explore) restore @* and @+",'~'.expand("<slnum>"))
        if @* != keepregstar | sil! let @* = keepregstar | endif
        if @+ != keepregplus | sil! let @+ = keepregplus | endif
@@ -1013,7 +1015,7 @@
       catch /^Vim\%((\a\+)\)\=:E480/
        keepalt call netrw#ErrorMsg(s:WARNING,'no files matched pattern<'.pattern.'>',45)
        if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif
-       if has("clipboard")
+       if has("clipboard") && g:netrw_clipboard
 "        call Decho("(netrw#Explore) restore @* and @+",'~'.expand("<slnum>"))
         if @* != keepregstar | sil! let @* = keepregstar | endif
         if @+ != keepregplus | sil! let @+ = keepregplus | endif
@@ -1050,7 +1052,7 @@
 
      if w:netrw_explore_listlen == 0 || (w:netrw_explore_listlen == 1 && w:netrw_explore_list[0] =~ '\*\*\/')
       keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"no files matched",42)
-      if has("clipboard")
+      if has("clipboard") && g:netrw_clipboard
 "       call Decho("(netrw#Explore) restore @* and @+",'~'.expand("<slnum>"))
         if @* != keepregstar | sil! let @* = keepregstar | endif
         if @+ != keepregplus | sil! let @+ = keepregplus | endif
@@ -1099,7 +1101,7 @@
     if !exists("g:netrw_quiet")
      keepalt NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your vim needs the +path_extra feature for Exploring with **!",44)
     endif
-    if has("clipboard")
+    if has("clipboard") && g:netrw_clipboard
 "     call Decho("(netrw#Explore) restore @* and @+",'~'.expand("<slnum>"))
       if @* != keepregstar | sil! let @* = keepregstar | endif
       if @+ != keepregplus | sil! let @+ = keepregplus | endif
@@ -1173,7 +1175,7 @@
   " there's no danger of a late FocusGained event on initialization.
   " Consequently, set s:netrw_events to 2.
   let s:netrw_events= 2
-  if has("clipboard")
+  if has("clipboard") && g:netrw_clipboard
 "   call Decho("(netrw#Explore) restore @* and @+",'~'.expand("<slnum>"))
    if @* != keepregstar | sil! let @* = keepregstar | endif
    if @+ != keepregplus | sil! let @+ = keepregplus | endif
@@ -1641,7 +1643,8 @@
 fun! s:NetrwOptionsSave(vt)
 "  call Dfunc("s:NetrwOptionsSave(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname(bufnr("%")).">"." winnr($)=".winnr("$")." mod=".&mod." ma=".&ma)
 "  call Decho(a:vt."netrw_optionsave".(exists("{a:vt}netrw_optionsave")? ("=".{a:vt}netrw_optionsave) : " doesn't exist"),'~'.expand("<slnum>"))
-"  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
+"  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt." hid=".&hid,'~'.expand("<slnum>"))
+"  call Decho("(s:NetrwOptionsSave) lines=".&lines)
 
   if !exists("{a:vt}netrw_optionsave")
    let {a:vt}netrw_optionsave= 1
@@ -1667,6 +1670,9 @@
   let {a:vt}netrw_cinokeep  = &l:cino
   let {a:vt}netrw_comkeep   = &l:com
   let {a:vt}netrw_cpokeep   = &l:cpo
+  let {a:vt}netrw_cuckeep   = &l:cuc
+  let {a:vt}netrw_culkeep   = &l:cul
+"  call Decho("(s:NetrwOptionsSave) COMBAK: cuc=".&l:cuc." cul=".&l:cul)
   let {a:vt}netrw_diffkeep  = &l:diff
   let {a:vt}netrw_fenkeep   = &l:fen
   if !exists("g:netrw_ffkeep") || g:netrw_ffkeep
@@ -1674,9 +1680,11 @@
   endif
   let {a:vt}netrw_fokeep    = &l:fo           " formatoptions
   let {a:vt}netrw_gdkeep    = &l:gd           " gdefault
+  let {a:vt}netrw_gokeep    = &l:go           " guioptions
   let {a:vt}netrw_hidkeep   = &l:hidden
   let {a:vt}netrw_imkeep    = &l:im
   let {a:vt}netrw_iskkeep   = &l:isk
+  let {a:vt}netrw_lines     = &lines
   let {a:vt}netrw_lskeep    = &l:ls
   let {a:vt}netrw_makeep    = &l:ma
   let {a:vt}netrw_magickeep = &l:magic
@@ -1702,12 +1710,13 @@
    let {a:vt}netrw_dirkeep  = getcwd()
 "   call Decho("saving to ".a:vt."netrw_dirkeep<".{a:vt}netrw_dirkeep.">",'~'.expand("<slnum>"))
   endif
-  if has("clipboard")
+  if has("clipboard") && g:netrw_clipboard
    sil! let {a:vt}netrw_starkeep = @*
    sil! let {a:vt}netrw_pluskeep = @+
   endif
   sil! let {a:vt}netrw_slashkeep= @/
 
+"  call Decho("(s:NetrwOptionsSave) lines=".&lines)
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
 "  call Dret("s:NetrwOptionsSave : tab#".tabpagenr()." win#".winnr())
 endfun
@@ -1732,12 +1741,17 @@
   endif
   call s:NetrwSetSafeSetting("&l:ci",0)
   call s:NetrwSetSafeSetting("&l:cin",0)
-  call s:NetrwSetSafeSetting("&l:bh","hide")
+  if g:netrw_fastbrowse > a:islocal
+   call s:NetrwSetSafeSetting("&l:bh","hide")
+  else
+   call s:NetrwSetSafeSetting("&l:bh","delete")
+  endif
   call s:NetrwSetSafeSetting("&l:cino","")
   call s:NetrwSetSafeSetting("&l:com","")
   if &cpo =~ 'a' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'a','','g')) | endif
   if &cpo =~ 'A' | call s:NetrwSetSafeSetting("&cpo",substitute(&cpo,'A','','g')) | endif
   setl fo=nroql2
+  call s:NetrwSetSafeSetting("&go","begmr")
   call s:NetrwSetSafeSetting("&l:hid",0)
   call s:NetrwSetSafeSetting("&l:im",0)
   setl isk+=@ isk+=* isk+=/
@@ -1751,7 +1765,10 @@
   call s:NetrwSetSafeSetting("&l:tw",0)
   call s:NetrwSetSafeSetting("&l:wig","")
   setl cedit&
-  call s:NetrwCursor()
+
+  " set up cuc and cul based on g:netrw_cursor and listing style
+  " COMBAK -- cuc cul related
+  call s:NetrwCursor(0)
 
   " allow the user to override safe options
 "  call Decho("ft<".&ft."> ei=".&ei,'~'.expand("<slnum>"))
@@ -1769,11 +1786,14 @@
 " s:NetrwOptionsRestore: restore options (based on prior s:NetrwOptionsSave) {{{2
 fun! s:NetrwOptionsRestore(vt)
 "  call Dfunc("s:NetrwOptionsRestore(vt<".a:vt.">) win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> winnr($)=".winnr("$"))
+"  call Decho("(s:NetrwOptionsRestore) lines=".&lines)
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
   if !exists("{a:vt}netrw_optionsave")
 "   call Decho("case ".a:vt."netrw_optionsave : doesn't exist",'~'.expand("<slnum>"))
-"   call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
-"   call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
+"   call Decho("..doing filetype detect anyway")
+   filetype detect
+"   call Decho("..settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
+"   call Decho("..ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("<slnum>"))
 "   call Dret("s:NetrwOptionsRestore : ".a:vt."netrw_optionsave doesn't exist")
    return
   endif
@@ -1790,41 +1810,53 @@
     endif
    endif
   endif
+"  call Decho("(s:NetrwOptionsRestore) #1 lines=".&lines)
   call s:NetrwRestoreSetting(a:vt."netrw_aikeep","&l:ai")
   call s:NetrwRestoreSetting(a:vt."netrw_awkeep","&l:aw")
   call s:NetrwRestoreSetting(a:vt."netrw_blkeep","&l:bl")
   call s:NetrwRestoreSetting(a:vt."netrw_btkeep","&l:bt")
   call s:NetrwRestoreSetting(a:vt."netrw_bombkeep","&l:bomb")
+"  call Decho("(s:NetrwOptionsRestore) #2 lines=".&lines)
   call s:NetrwRestoreSetting(a:vt."netrw_cedit","&cedit")
   call s:NetrwRestoreSetting(a:vt."netrw_cikeep","&l:ci")
   call s:NetrwRestoreSetting(a:vt."netrw_cinkeep","&l:cin")
   call s:NetrwRestoreSetting(a:vt."netrw_cinokeep","&l:cino")
   call s:NetrwRestoreSetting(a:vt."netrw_comkeep","&l:com")
+"  call Decho("(s:NetrwOptionsRestore) #3 lines=".&lines)
   call s:NetrwRestoreSetting(a:vt."netrw_cpokeep","&l:cpo")
   call s:NetrwRestoreSetting(a:vt."netrw_diffkeep","&l:diff")
   call s:NetrwRestoreSetting(a:vt."netrw_fenkeep","&l:fen")
   if exists("g:netrw_ffkeep") && g:netrw_ffkeep
    call s:NetrwRestoreSetting(a:vt."netrw_ffkeep")","&l:ff")
   endif
-  call s:NetrwRestoreSetting(a:vt."netrw_fokeep","&l:fo")
-  call s:NetrwRestoreSetting(a:vt."netrw_gdkeep","&l:gd")
-  call s:NetrwRestoreSetting(a:vt."netrw_hidkeep","&l:hidden")
-  call s:NetrwRestoreSetting(a:vt."netrw_imkeep","&l:im")
-  call s:NetrwRestoreSetting(a:vt."netrw_iskkeep","&l:isk")
-  call s:NetrwRestoreSetting(a:vt."netrw_lskeep","&l:ls")
-  call s:NetrwRestoreSetting(a:vt."netrw_makeep","&l:ma")
+"  call Decho("(s:NetrwOptionsRestore) #4 lines=".&lines)
+  call s:NetrwRestoreSetting(a:vt."netrw_fokeep"   ,"&l:fo")
+  call s:NetrwRestoreSetting(a:vt."netrw_gdkeep"   ,"&l:gd")
+  call s:NetrwRestoreSetting(a:vt."netrw_gokeep"   ,"&l:go")
+  call s:NetrwRestoreSetting(a:vt."netrw_hidkeep"  ,"&l:hidden")
+"  call Decho("(s:NetrwOptionsRestore) #5 lines=".&lines)
+  call s:NetrwRestoreSetting(a:vt."netrw_imkeep"   ,"&l:im")
+  call s:NetrwRestoreSetting(a:vt."netrw_iskkeep"  ,"&l:isk")
+"  call Decho("(s:NetrwOptionsRestore) #6 lines=".&lines)
+  call s:NetrwRestoreSetting(a:vt."netrw_lines"    ,"&lines")
+"  call Decho("(s:NetrwOptionsRestore) #7 lines=".&lines)
+  call s:NetrwRestoreSetting(a:vt."netrw_lskeep"   ,"&l:ls")
+  call s:NetrwRestoreSetting(a:vt."netrw_makeep"   ,"&l:ma")
   call s:NetrwRestoreSetting(a:vt."netrw_magickeep","&l:magic")
-  call s:NetrwRestoreSetting(a:vt."netrw_modkeep","&l:mod")
-  call s:NetrwRestoreSetting(a:vt."netrw_nukeep","&l:nu")
-  call s:NetrwRestoreSetting(a:vt."netrw_rnukeep","&l:rnu")
-  call s:NetrwRestoreSetting(a:vt."netrw_repkeep","&l:report")
-  call s:NetrwRestoreSetting(a:vt."netrw_rokeep","&l:ro")
-  call s:NetrwRestoreSetting(a:vt."netrw_selkeep","&l:sel")
+  call s:NetrwRestoreSetting(a:vt."netrw_modkeep"  ,"&l:mod")
+  call s:NetrwRestoreSetting(a:vt."netrw_nukeep"   ,"&l:nu")
+"  call Decho("(s:NetrwOptionsRestore) #8 lines=".&lines)
+  call s:NetrwRestoreSetting(a:vt."netrw_rnukeep"  ,"&l:rnu")
+  call s:NetrwRestoreSetting(a:vt."netrw_repkeep"  ,"&l:report")
+  call s:NetrwRestoreSetting(a:vt."netrw_rokeep"   ,"&l:ro")
+  call s:NetrwRestoreSetting(a:vt."netrw_selkeep"  ,"&l:sel")
+"  call Decho("(s:NetrwOptionsRestore) #9 lines=".&lines)
   call s:NetrwRestoreSetting(a:vt."netrw_spellkeep","&l:spell")
-  call s:NetrwRestoreSetting(a:vt."netrw_twkeep","&l:tw")
-  call s:NetrwRestoreSetting(a:vt."netrw_wigkeep","&l:wig")
-  call s:NetrwRestoreSetting(a:vt."netrw_wrapkeep","&l:wrap")
+  call s:NetrwRestoreSetting(a:vt."netrw_twkeep"   ,"&l:tw")
+  call s:NetrwRestoreSetting(a:vt."netrw_wigkeep"  ,"&l:wig")
+  call s:NetrwRestoreSetting(a:vt."netrw_wrapkeep" ,"&l:wrap")
   call s:NetrwRestoreSetting(a:vt."netrw_writekeep","&l:write")
+"  call Decho("(s:NetrwOptionsRestore) #10 lines=".&lines)
   call s:NetrwRestoreSetting("s:yykeep","@@")
   " former problem: start with liststyle=0; press <i> : result, following line resets l:ts.
   " Fixed; in s:PerformListing, when w:netrw_liststyle is s:LONGLIST, will use a printf to pad filename with spaces
@@ -1855,7 +1887,7 @@
     unlet {a:vt}netrw_dirkeep
    endif
   endif
-  if has("clipboard")
+  if has("clipboard") && g:netrw_clipboard
 "   call Decho("has clipboard",'~'.expand("<slnum>"))
    call s:NetrwRestoreSetting(a:vt."netrw_starkeep","@*")
    call s:NetrwRestoreSetting(a:vt."netrw_pluskeep","@+")
@@ -1871,9 +1903,11 @@
   " were having their filetype detect-generated settings overwritten by
   " NetrwOptionRestore.
   if &ft != "netrw"
-"   call Decho("filetype detect  (ft=".&ft.")",'~'.expand("<slnum>"))
+"   call Decho("before: filetype detect  (ft=".&ft.")",'~'.expand("<slnum>"))
    filetype detect
+"   call Decho("after : filetype detect  (ft=".&ft.")",'~'.expand("<slnum>"))
   endif
+"  call Decho("(s:NetrwOptionsRestore) lines=".&lines)
 "  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." a:vt=".a:vt,'~'.expand("<slnum>"))
 "  call Dret("s:NetrwOptionsRestore : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly)
 endfun
@@ -1923,7 +1957,7 @@
   " typically called from s:NetrwOptionsRestore
   "   call s:NetrwRestoreSettings(keep-option-variable-name,'associated-option')
   "   ex. call s:NetrwRestoreSetting(a:vt."netrw_selkeep","&l:sel")
-  "  Restores option (if different) from a keepvar
+  "  Restores option (but only if different) from a:keepvar
   if exists(a:keepvar)
    exe "let keepvarval= ".a:keepvar
    exe "let setting= ".a:setting
@@ -2845,14 +2879,16 @@
 "  call Decho("inittreetop<".(exists("inittreetop")? inittreetop : "n/a").">")
 
   if (a:iscmd == 0 || a:1 == "") && exists("inittreetop")
-   let treedir= s:NetrwTreePath(inittreetop)
+   let treedir         = s:NetrwTreePath(inittreetop)
 "   call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
   else
    if isdirectory(s:NetrwFile(a:1))
 "    call Decho("a:1<".a:1."> is a directory",'~'.expand("<slnum>"))
-    let treedir= a:1
+    let treedir         = a:1
+    let s:netrw_treetop = treedir
    elseif exists("b:netrw_curdir") && (isdirectory(s:NetrwFile(b:netrw_curdir."/".a:1)) || a:1 =~ '^\a\{3,}://')
-    let treedir= b:netrw_curdir."/".a:1
+    let treedir         = b:netrw_curdir."/".a:1
+    let s:netrw_treetop = treedir
 "    call Decho("a:1<".a:1."> is NOT a directory, using treedir<".treedir.">",'~'.expand("<slnum>"))
    else
     " normally the cursor is left in the message window.
@@ -2860,7 +2896,8 @@
     let netrwbuf= bufnr("%")
     call netrw#ErrorMsg(s:ERROR,"sorry, ".a:1." doesn't seem to be a directory!",95)
     exe bufwinnr(netrwbuf)."wincmd w"
-    let treedir= "."
+    let treedir         = "."
+    let s:netrw_treetop = getcwd()
    endif
   endif
 "  call Decho("treedir<".treedir.">",'~'.expand("<slnum>"))
@@ -4115,6 +4152,7 @@
    elseif g:netrw_sizestyle =~# 'h'
     let lsopt= "-lsadh --si"
    endif
+"   call Decho("(s:NetrwFileInfo) lsopt<".lsopt.">")
    if (has("unix") || has("macunix")) && executable("/bin/ls")
 
     if getline(".") == "../"
@@ -4176,9 +4214,10 @@
 " s:NetrwGetBuffer: [get a new|find an old netrw] buffer for a netrw listing {{{2
 "   returns 0=cleared buffer
 "           1=re-used buffer (buffer not cleared)
+"  Nov 09, 2020: tst952 shows that when user does :set hidden that NetrwGetBuffer will come up with a [No Name] buffer (hid fix)
 fun! s:NetrwGetBuffer(islocal,dirname)
 "  call Dfunc("s:NetrwGetBuffer(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".g:netrw_liststyle)
-"  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo,'~'.expand("<slnum>"))
+"  call Decho("settings buf#".bufnr("%")."<".bufname("%").">: ".((&l:ma == 0)? "no" : "")."ma ".((&l:mod == 0)? "no" : "")."mod ".((&l:bl == 0)? "no" : "")."bl ".((&l:ro == 0)? "no" : "")."ro fo=".&l:fo." hid=".&hid,'~'.expand("<slnum>"))
 "  call Decho("netrwbuf dictionary=".(exists("s:netrwbuf")? string(s:netrwbuf) : 'n/a'),'~'.expand("<slnum>"))
 "  call Dredir("ls!","s:NetrwGetBuffer")
   let dirname= a:dirname
@@ -4228,17 +4267,26 @@
   endif
 "  call Decho("  bufnum#".bufnum,'~'.expand("<slnum>"))
 
-  " highjack the current buffer if
-  "   it has the desired name
-  "   it is empty
-"  call Decho("deciding if I can highjack the current buffer#".bufnr("%"),'~'.expand("<slnum>"))
-"  call Decho("..dirname<".dirname.">",'~'.expand("<slnum>"))
-"  call Decho("..bufname<".bufname("%").">",'~'.expand("<slnum>"))
-"  call Decho("..getline($)<".getline("$").">",'~'.expand("<slnum>"))
-  if dirname == bufname("%") && line("$") == 1 && getline("%") == ""
+  " highjack the current buffer
+  "   IF the buffer already has the desired name
+  "   AND it is empty
+  let curbuf = bufname("%")
+  if curbuf == '.'
+   let curbuf = getcwd()
+  endif
+"  call Dredir("ls!","NetrwGetFile (renamed buffer back to remote filename<".rfile."> : expand(%)<".expand("%").">)")
+"  call Decho("deciding if netrw may highjack the current buffer#".bufnr("%")."<".curbuf.">",'~'.expand("<slnum>"))
+"  call Decho("..dirname<".dirname.">  IF dirname == bufname",'~'.expand("<slnum>"))
+"  call Decho("..curbuf<".curbuf.">",'~'.expand("<slnum>"))
+"  call Decho("..line($)=".line("$")." AND this is 1",'~'.expand("<slnum>"))
+"  call Decho("..getline(%)<".getline("%").">  AND this line is empty",'~'.expand("<slnum>"))
+  if dirname == curbuf && line("$") == 1 && getline("%") == ""
 "   call Dret("s:NetrwGetBuffer 0<cleared buffer> : highjacking buffer#".bufnr("%"))
    return 0
+  else  " DEBUG
+"   call Decho("..did NOT highjack buffer",'~'.expand("<slnum>"))
   endif
+  " Aug 14, 2021: was thinking about looking for a [No Name] buffer here and using it, but that might cause problems
 
   " get enew buffer and name it -or- re-use buffer {{{3
   if bufnum < 0      " get enew buffer and name it
@@ -4563,7 +4611,7 @@
   " refresh the listing
 "  call Decho("refresh the listing",'~'.expand("<slnum>"))
   NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./'))
-  NetrwKeepj call s:NetrwCursor()
+  NetrwKeepj call s:NetrwCursor(0)
 
   " repoint t:netrw_lexbufnr if appropriate
   if exists("repointlexbufnr")
@@ -4769,7 +4817,7 @@
   endif
 "  call Decho("b:netrw_curdir<".b:netrw_curdir.">")
 
-  " NetrwBrowseChgDir: save options and initialize {{{3
+  " NetrwBrowseChgDir; save options and initialize {{{3
 "  call Decho("saving options",'~'.expand("<slnum>"))
   call s:SavePosn(s:netrw_posn)
   NetrwKeepj call s:NetrwOptionsSave("s:")
@@ -4837,6 +4885,8 @@
    if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") && newdir !~ '^\(/\|\a:\)'
 "    call Decho("edit-a-file: handle tree listing: w:netrw_treedict<".(exists("w:netrw_treedict")? string(w:netrw_treedict) : 'n/a').">",'~'.expand("<slnum>"))
 "    call Decho("edit-a-file: newdir<".newdir.">",'~'.expand("<slnum>"))
+"    let newdir = s:NetrwTreePath(s:netrw_treetop)
+"    call Decho("edit-a-file: COMBAK why doesn't this recognize file1's directory???")
     let dirname= s:NetrwTreeDir(a:islocal)
     "COMBAK : not working for a symlink -- but what about a regular file? a directory?
 "    call Decho("COMBAK : not working for a symlink -- but what about a regular file? a directory?")
@@ -4950,7 +5000,8 @@
       exe "NetrwKeepj e ".fnameescape(dirname)
      endif
 "     call Decho("edit-a-file: after e! ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("<slnum>"))
-     call s:NetrwCursor()
+     " COMBAK -- cuc cul related
+     call s:NetrwCursor(1)
      if &hidden || &bufhidden == "hide"
       " file came from vim's hidden storage.  Don't "restore" options with it.
       let dorestore= 0
@@ -4971,8 +5022,8 @@
      elseif type(g:Netrw_funcref) == 3
 "      call Decho("edit-a-file: handling a list of g:Netrw_funcrefs",'~'.expand("<slnum>"))
       for Fncref in g:Netrw_funcref
-       if type(FncRef) == 2
-        NetrwKeepj call FncRef()
+       if type(Fncref) == 2
+        NetrwKeepj call Fncref()
        endif
       endfor
      endif
@@ -5264,6 +5315,12 @@
   endif
 "  call Decho("not a local file nor a webpage request",'~'.expand("<slnum>"))
 
+  if exists("g:netrw_browsex_viewer") && exists("g:netrw_browsex_support_remote") && !g:netrw_browsex_support_remote
+    let remote = a:remote
+  else
+    let remote = 0
+  endif
+
   let ykeep      = @@
   let screenposn = winsaveview()
 "  call Decho("saving posn to screenposn<".string(screenposn).">",'~'.expand("<slnum>"))
@@ -5308,9 +5365,9 @@
   endif
 "  call Decho("exten<".exten.">",'~'.expand("<slnum>"))
 
-  if a:remote == 1
+  if remote == 1
    " create a local copy
-"   call Decho("remote: a:remote=".a:remote.": create a local copy of <".a:fname.">",'~'.expand("<slnum>"))
+"   call Decho("remote: remote=".remote.": create a local copy of <".a:fname.">",'~'.expand("<slnum>"))
    setl bh=delete
    call netrw#NetRead(3,a:fname)
    " attempt to rename tempfile
@@ -5332,7 +5389,7 @@
     let fname= s:netrw_tmpfile
    endif
   else
-"   call Decho("local: a:remote=".a:remote.": handling local copy of <".a:fname.">",'~'.expand("<slnum>"))
+"   call Decho("local: remote=".remote.": handling local copy of <".a:fname.">",'~'.expand("<slnum>"))
    let fname= a:fname
    " special ~ handler for local
    if fname =~ '^\~' && expand("$HOME") != ""
@@ -5426,8 +5483,8 @@
    if a:fname =~ '^https\=://'
     " atril does not appear to understand how to handle html -- so use gvim to edit the document
     let use_ctrlo= 0
-"    call Decho("(COMBAK) fname<".fname.">")
-"    call Decho("(COMBAK) a:fname<".a:fname.">")
+"    call Decho("fname<".fname.">")
+"    call Decho("a:fname<".a:fname.">")
     call s:NetrwExe("sil! !gvim ".fname.' -c "keepj keepalt file '.fnameescape(a:fname).'"')
 
    else
@@ -5475,12 +5532,12 @@
   "          return to prior buffer (directory listing)
   "          Feb 12, 2008: had to de-activiate removal of
   "          temporary file because it wasn't getting seen.
-"  if a:remote == 1 && fname != a:fname
+"  if remote == 1 && fname != a:fname
 ""   call Decho("deleting temporary file<".fname.">",'~'.expand("<slnum>"))
 "   call s:NetrwDelete(fname)
 "  endif
 
-  if a:remote == 1
+  if remote == 1
    setl bh=delete bt=nofile
    if g:netrw_use_noswf
     setl noswf
@@ -5539,7 +5596,7 @@
    let b:junk= 1
 "   call Decho("rename buffer: sil! keepj keepalt file ".fnameescape(a:newname),'~'.expand("<slnum>"))
    exe 'sil! keepj keepalt file '.fnameescape(a:newname)
-"   call Dredir("ls!","s:NetrwBufRename (before bwipe)")
+"   call Dredir("ls!","s:NetrwBufRename (before bwipe)~".expand("<slnum>"))
    let oldbufnr= bufnr(oldbufname)
 "   call Decho("oldbufname<".oldbufname."> oldbufnr#".oldbufnr,'~'.expand("<slnum>"))
 "   call Decho("bufnr(%)=".bufnr("%"),'~'.expand("<slnum>"))
@@ -5548,6 +5605,9 @@
     exe "bwipe! ".oldbufnr
 "   else " Decho
 "    call Decho("did *not* bwipe buf#".oldbufnr,'~'.expand("<slnum>"))
+"    call Decho("..reason: if oldbufname<".oldbufname."> is empty",'~'.expand("<slnum>"))"
+"    call Decho("..reason: if oldbufnr#".oldbufnr." is -1",'~'.expand("<slnum>"))"
+"    call Decho("..reason: if oldbufnr#".oldbufnr." != bufnr(%)#".bufnr("%"),'~'.expand("<slnum>"))"
    endif
 "   call Dredir("ls!","s:NetrwBufRename (after rename)")
 "  else " Decho
@@ -6536,7 +6596,7 @@
    if !hasmapto('<Plug>NetrwRefresh')
     nmap <buffer> <unique> <c-l> <Plug>NetrwRefresh
    endif
-   nnoremap <buffer> <silent> <Plug>NetrwRefresh		<c-l>:call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,(w:netrw_liststyle == 3)? w:netrw_treetop : './'))<cr>
+   nnoremap <buffer> <silent> <Plug>NetrwRefresh		<c-l>:call <SID>NetrwRefresh(1,<SID>NetrwBrowseChgDir(1,(exists("w:netrw_liststyle") && exists("w:netrw_treetop") && w:netrw_liststyle == 3)? w:netrw_treetop : './'))<cr>
    if s:didstarstar || !mapcheck("<s-down>","n")
     nnoremap <buffer> <silent> <s-down>	:Nexplore<cr>
    endif
@@ -8164,6 +8224,23 @@
   call inputsave()
   let fname= input("Enter filename: ")
   call inputrestore()
+"  call Decho("(s:NetrwOpenFile) fname<".fname.">",'~'.expand("<slnum>"))
+
+  " determine if Lexplore is in use
+  if exists("t:netrw_lexbufnr")
+   " check if t:netrw_lexbufnr refers to a netrw window
+"   call Decho("(s:netrwOpenFile) ..t:netrw_lexbufnr=".t:netrw_lexbufnr,'~'.expand("<slnum>"))
+   let lexwinnr = bufwinnr(t:netrw_lexbufnr)
+   if lexwinnr != -1 && exists("g:netrw_chgwin") && g:netrw_chgwin != -1
+"    call Decho("(s:netrwOpenFile) ..Lexplore in use",'~'.expand("<slnum>"))
+    exe "NetrwKeepj keepalt ".g:netrw_chgwin."wincmd w"
+    exe "NetrwKeepj e ".fnameescape(fname)
+    let @@= ykeep
+"    call Dret("s:NetrwOpenFile : creating a file with Lexplore mode")
+   endif
+  endif
+
+  " Does the filename contain a path?
   if fname !~ '[/\\]'
    if exists("b:netrw_curdir")
     if exists("g:netrw_quiet")
@@ -8502,6 +8579,7 @@
   let lastwinnr = winnr("$")
   let curword   = s:NetrwGetWord()
   let choice    = 0
+  let s:prevwinopen= 1	" lets s:NetrwTreeDir() know that NetrwPrevWinOpen called it
   let s:treedir = s:NetrwTreeDir(a:islocal)
   let curdir    = s:treedir
 "  call Decho("winnr($)#".lastwinnr." curword<".curword.">",'~'.expand("<slnum>"))
@@ -8829,7 +8907,7 @@
     "    0 :             1: top       -- preview window is horizontally split off and on the top
     "    0 :             0: bot       -- preview window is horizontally split off and on the bottom
     "
-    " Note that the file being previewed is already known to not be a directory, hence we can avoid doing a LocalBrowse() check via
+    " Note that the file being previewed is already known to not be a directory, hence we can avoid doing a LocalBrowseCheck() check via
     " the BufEnter event set up in netrwPlugin.vim
 "    call Decho("exe ".(g:netrw_alto? "top " : "bot ").(g:netrw_preview? "vert " : "")."pedit ".fnameescape(a:path),'~'.expand("<slnum>"))
     let eikeep = &ei
@@ -9264,14 +9342,20 @@
 "  call Decho("g:netrw_keepdir  =".(exists("g:netrw_keepdir")?   g:netrw_keepdir   : 'n/a'),'~'.expand("<slnum>"))
 "  call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("<slnum>"))
 "  call Decho("w:netrw_treetop  =".(exists("w:netrw_treetop")?   w:netrw_treetop   : 'n/a'),'~'.expand("<slnum>"))
+"  call Decho("current line<".getline(".").">")
 
-  if exists("s:treedir")
+  if exists("s:treedir") && exists("s:prevwinopen")
    " s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early
+"   call Decho('s:NetrwPrevWinOpen opens a "previous" window -- and thus needs to and does call s:NetrwTreeDir early')
    let treedir= s:treedir
    unlet s:treedir
-"   call Dret("s:NetrwTreeDir ".treedir)
+   unlet s:prevwinopen
+"   call Dret("s:NetrwTreeDir ".treedir.": early return since s:treedir existed previously")
    return treedir
   endif
+  if exists("s:prevwinopen")
+   unlet s:prevwinopen
+  endif
 
   if !exists("b:netrw_curdir") || b:netrw_curdir == ""
    let b:netrw_curdir= getcwd()
@@ -9478,20 +9562,29 @@
 "                     Called by s:PerformListing()
 fun! s:NetrwTreeListing(dirname)
   if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST
-"   call Dfunc("NetrwTreeListing() bufname<".expand("%").">")
+"   call Dfunc("s:NetrwTreeListing() bufname<".expand("%").">")
 "   call Decho("curdir<".a:dirname.">",'~'.expand("<slnum>"))
 "   call Decho("win#".winnr().": w:netrw_treetop ".(exists("w:netrw_treetop")? "exists" : "doesn't exist")." w:netrw_treedict ".(exists("w:netrw_treedict")? "exists" : "doesn't exit"),'~'.expand("<slnum>"))
 "   call Decho("g:netrw_banner=".g:netrw_banner.": banner ".(g:netrw_banner? "enabled" : "suppressed").": (line($)=".line("$")." byte2line(1)=".byte2line(1)." bannercnt=".w:netrw_bannercnt.")",'~'.expand("<slnum>"))
 
    " update the treetop
-"   call Decho("update the treetop",'~'.expand("<slnum>"))
    if !exists("w:netrw_treetop")
+"    call Decho("update the treetop  (w:netrw_treetop doesn't exist yet)",'~'.expand("<slnum>"))
     let w:netrw_treetop= a:dirname
+    let s:netrw_treetop= w:netrw_treetop
 "    call Decho("w:netrw_treetop<".w:netrw_treetop."> (reusing)",'~'.expand("<slnum>"))
    elseif (w:netrw_treetop =~ ('^'.a:dirname) && s:Strlen(a:dirname) < s:Strlen(w:netrw_treetop)) || a:dirname !~ ('^'.w:netrw_treetop)
+"    call Decho("update the treetop  (override w:netrw_treetop with a:dirname<".a:dirname.">)",'~'.expand("<slnum>"))
     let w:netrw_treetop= a:dirname
+    let s:netrw_treetop= w:netrw_treetop
 "    call Decho("w:netrw_treetop<".w:netrw_treetop."> (went up)",'~'.expand("<slnum>"))
    endif
+   if exists("w:netrw_treetop")
+    let s:netrw_treetop= w:netrw_treetop
+   else
+    let w:netrw_treetop= getcwd()
+    let s:netrw_treetop= w:netrw_treetop
+   endif
 
    if !exists("w:netrw_treedict")
     " insure that we have a treedict, albeit empty
@@ -9529,7 +9622,7 @@
 
    exe "setl ".g:netrw_bufsettings
 
-"   call Dret("NetrwTreeListing : bufname<".expand("%").">")
+"   call Dret("s:NetrwTreeListing : bufname<".expand("%").">")
    return
   endif
 endfun
@@ -9637,7 +9730,7 @@
    let newcolstart = w:netrw_bannercnt + fpc
    let newcolend   = newcolstart + fpc - 1
 "   call Decho("bannercnt=".w:netrw_bannercnt." fpl=".w:netrw_fpl." fpc=".fpc." newcol[".newcolstart.",".newcolend."]",'~'.expand("<slnum>"))
-   if has("clipboard")
+   if has("clipboard") && g:netrw_clipboard
 "    call Decho("(s:NetrwWideListing) save @* and @+",'~'.expand("<slnum>"))
     sil! let keepregstar = @*
     sil! let keepregplus = @+
@@ -10683,7 +10776,7 @@
 " ---------------------------------------------------------------------
 " netrw#LocalBrowseCheck: {{{2
 fun! netrw#LocalBrowseCheck(dirname)
-  " This function is called by netrwPlugin.vim's s:LocalBrowse(), s:NetrwRexplore(),
+  " This function is called by netrwPlugin.vim's s:LocalBrowseCheck(), s:NetrwRexplore(),
   " and by <cr> when atop a listed file/directory (via a buffer-local map)
   "
   " unfortunate interaction -- split window debugging can't be used here, must use
@@ -10834,7 +10927,7 @@
 "  Hiding   a buffer means that it will be re-used   when examined, hence "fast".
 "                       (re-using a buffer may not be as accurate)
 "
-"  s:netrw_events : doesn't exist, s:LocalFastBrowser() will install autocmds whena med or fast browsing
+"  s:netrw_events : doesn't exist, s:LocalFastBrowser() will install autocmds with medium-speed or fast browsing
 "                   =1: autocmds installed, but ignore next FocusGained event to avoid initial double-refresh of listing.
 "                       BufEnter may be first event, then a FocusGained event.  Ignore the first FocusGained event.
 "                       If :Explore used: it sets s:netrw_events to 2, so no FocusGained events are ignored.
@@ -10996,13 +11089,14 @@
      let sz= s:NetrwHumanReadable(sz)
     endif
     let longfile= printf("%-".(g:netrw_maxfilenamelen+1)."s",pfile)
-    let pfile   = longfile.fsz." ".strftime(g:netrw_timefmt,getftime(filename))
+    let pfile   = longfile.sz." ".strftime(g:netrw_timefmt,getftime(filename))
 "    call Decho("longlist support: sz=".sz." fsz=".fsz,'~'.expand("<slnum>"))
    endif
 
    if     g:netrw_sort_by =~# "^t"
     " sort by time (handles time up to 1 quintillion seconds, US)
     " Decorate listing by prepending a timestamp/  .  Sorting will then be done based on time.
+"    call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (time)")
 "    call Decho("getftime(".filename.")=".getftime(filename),'~'.expand("<slnum>"))
     let t  = getftime(filename)
     let ft = strpart("000000000000000000",1,18-strlen(t)).t
@@ -11012,6 +11106,7 @@
 
    elseif g:netrw_sort_by =~ "^s"
     " sort by size (handles file sizes up to 1 quintillion bytes, US)
+"    call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (size)")
 "    call Decho("getfsize(".filename.")=".getfsize(filename),'~'.expand("<slnum>"))
     let sz   = getfsize(filename)
     if g:netrw_sizestyle =~# "[hH]"
@@ -11024,6 +11119,7 @@
 
    else
     " sort by name
+"    call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (name)")
 "    call Decho("exe NetrwKeepj put ='".pfile."'",'~'.expand("<slnum>"))
     sil! NetrwKeepj put=pfile
    endif
@@ -11746,19 +11842,32 @@
 
 " ---------------------------------------------------------------------
 " s:NetrwCursor: responsible for setting cursorline/cursorcolumn based upon g:netrw_cursor {{{2
-fun! s:NetrwCursor()
+fun! s:NetrwCursor(editfile)
   if !exists("w:netrw_liststyle")
    let w:netrw_liststyle= g:netrw_liststyle
   endif
 "  call Dfunc("s:NetrwCursor() ft<".&ft."> liststyle=".w:netrw_liststyle." g:netrw_cursor=".g:netrw_cursor." s:netrw_usercuc=".s:netrw_usercuc." s:netrw_usercul=".s:netrw_usercul)
 
+"  call Decho("(s:NetrwCursor) COMBAK: cuc=".&l:cuc." cul=".&l:cul)
+
   if &ft != "netrw"
    " if the current window isn't a netrw directory listing window, then use user cursorline/column
    " settings.  Affects when netrw is used to read/write a file using scp/ftp/etc.
 "   call Decho("case ft!=netrw: use user cul,cuc",'~'.expand("<slnum>"))
-   let &l:cursorline   = s:netrw_usercul
-   let &l:cursorcolumn = s:netrw_usercuc
 
+  elseif g:netrw_cursor == 8
+   if w:netrw_liststyle == s:WIDELIST
+    setl cursorline
+    setl cursorcolumn
+   else
+    setl cursorline
+   endif
+  elseif g:netrw_cursor == 7
+    setl cursorline
+  elseif g:netrw_cursor == 6
+   if w:netrw_liststyle == s:WIDELIST
+    setl cursorline
+   endif
   elseif g:netrw_cursor == 4
    " all styles: cursorline, cursorcolumn
 "   call Decho("case g:netrw_cursor==4: setl cul cuc",'~'.expand("<slnum>"))
@@ -11775,26 +11884,22 @@
    else
 "    call Decho("case g:netrw_cursor==3 and not wide: setl cul (use user's cuc)",'~'.expand("<slnum>"))
     setl cursorline
-    let &l:cursorcolumn   = s:netrw_usercuc
    endif
 
   elseif g:netrw_cursor == 2
    " thin-long-tree: cursorline, user's cursorcolumn
    " wide          : cursorline, user's cursorcolumn
 "   call Decho("case g:netrw_cursor==2: setl cuc (use user's cul)",'~'.expand("<slnum>"))
-   let &l:cursorcolumn = s:netrw_usercuc
    setl cursorline
 
   elseif g:netrw_cursor == 1
    " thin-long-tree: user's cursorline, user's cursorcolumn
    " wide          : cursorline,        user's cursorcolumn
-   let &l:cursorcolumn = s:netrw_usercuc
    if w:netrw_liststyle == s:WIDELIST
 "    call Decho("case g:netrw_cursor==2 and wide: setl cul (use user's cuc)",'~'.expand("<slnum>"))
     setl cursorline
    else
 "    call Decho("case g:netrw_cursor==2 and not wide: (use user's cul,cuc)",'~'.expand("<slnum>"))
-    let &l:cursorline   = s:netrw_usercul
    endif
 
   else
@@ -11804,6 +11909,7 @@
    let &l:cursorcolumn = s:netrw_usercuc
   endif
 
+" call Decho("(s:NetrwCursor) COMBAK: cuc=".&l:cuc." cul=".&l:cul)
 "  call Dret("s:NetrwCursor : l:cursorline=".&l:cursorline." l:cursorcolumn=".&l:cursorcolumn)
 endfun
 
@@ -11817,6 +11923,7 @@
   if exists("s:netrw_usercuc")
    let &l:cursorcolumn = s:netrw_usercuc
   endif
+"  call Decho("(s:RestoreCursorline) COMBAK: cuc=".&l:cuc." cul=".&l:cul)
 "  call Dret("s:RestoreCursorline : restored cul=".&l:cursorline." cuc=".&l:cursorcolumn)
 endfun
 
@@ -11852,11 +11959,37 @@
 endfun
 
 " ---------------------------------------------------------------------
+" s:NetrwBufRemover: removes a buffer that: {{{2s
+"                    has buffer-id > 1
+"                    is unlisted
+"                    is unnamed
+"                    does not appear in any window
+fun! s:NetrwBufRemover(bufid)
+"  call Dfunc("s:NetrwBufRemover(".a:bufid.")")
+"  call Decho("buf#".a:bufid."           ".((a:bufid > 1)? ">" : "≯")." must be >1 for removal","~".expand("<slnum>"))
+"  call Decho("buf#".a:bufid." is        ".(buflisted(a:bufid)? "listed" : "unlisted"),"~".expand("<slnum>"))
+"  call Decho("buf#".a:bufid." has name <".bufname(a:bufid).">","~".expand("<slnum>"))
+"  call Decho("buf#".a:bufid." has winid#".bufwinid(a:bufid),"~".expand("<slnum>"))
+
+  if a:bufid > 1 && !buflisted(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1
+"   call Decho("(s:NetrwBufRemover) removing buffer#".a:bufid,"~".expand("<slnum>"))
+   exe "bd! ".a:bufid
+  endif
+
+"  call Dret("s:NetrwBufRemover")
+endfun
+
+" ---------------------------------------------------------------------
 " s:NetrwEnew: opens a new buffer, passes netrw buffer variables through {{{2
 fun! s:NetrwEnew(...)
 "  call Dfunc("s:NetrwEnew() a:0=".a:0." win#".winnr()." winnr($)=".winnr("$")." bufnr($)=".bufnr("$")." expand(%)<".expand("%").">")
 "  call Decho("curdir<".((a:0>0)? a:1 : "")."> buf#".bufnr("%")."<".bufname("%").">",'~'.expand("<slnum>"))
 
+  " Clean out the last buffer: 
+  " Check if the last buffer has # > 1, is unlisted, is unnamed, and does not appear in a window
+  " If so, delete it.
+  call s:NetrwBufRemover(bufnr("$"))
+
   " grab a function-local-variable copy of buffer variables
 "  call Decho("make function-local copy of netrw variables",'~'.expand("<slnum>"))
   if exists("b:netrw_bannercnt")      |let netrw_bannercnt       = b:netrw_bannercnt      |endif
diff --git a/runtime/autoload/netrwSettings.vim b/runtime/autoload/netrwSettings.vim
index bed5cfc..61c0ef7 100644
--- a/runtime/autoload/netrwSettings.vim
+++ b/runtime/autoload/netrwSettings.vim
@@ -1,7 +1,7 @@
 " netrwSettings.vim: makes netrw settings simpler
-" Date:		Nov 09, 2016
+" Date:		Aug 12, 2021
 " Maintainer:	Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
-" Version:	16
+" Version:	17	ASTRO-ONLY
 " Copyright:    Copyright (C) 1999-2007 Charles E. Campbell {{{1
 "               Permission is hereby granted to use and distribute this code,
 "               with or without modifications, provided that this copyright
@@ -19,7 +19,7 @@
 if exists("g:loaded_netrwSettings") || &cp
   finish
 endif
-let g:loaded_netrwSettings = "v16"
+let g:loaded_netrwSettings = "v17"
 if v:version < 700
  echohl WarningMsg
  echo "***warning*** this version of netrwSettings needs vim 7.0"
@@ -31,7 +31,7 @@
 " NetrwSettings: {{{1
 fun! netrwSettings#NetrwSettings()
   " this call is here largely just to insure that netrw has been loaded
-  call netrw#SavePosn()
+  call netrw#WinPath("")
   if !exists("g:loaded_netrw")
    echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
    return
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 93ff416..e1e9a1b 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt*	For Vim version 8.2.  Last change: 2021 Aug 13
+*eval.txt*	For Vim version 8.2.  Last change: 2021 Aug 16
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -8529,6 +8529,21 @@
 <		{only available when compiled with the |+python| or the
 		|+python3| feature}
 
+rand([{expr}])						*rand()* *random*
+		Return a pseudo-random Number generated with an xoshiro128**
+		algorithm using seed {expr}.  The returned number is 32 bits,
+		also on 64 bits systems, for consistency.
+		{expr} can be initialized by |srand()| and will be updated by
+		rand().  If {expr} is omitted, an internal seed value is used
+		and updated.
+
+		Examples: >
+			:echo rand()
+			:let seed = srand()
+			:echo rand(seed)
+			:echo rand(seed) % 16  " random number 0 - 15
+<
+
 							*E726* *E727*
 range({expr} [, {max} [, {stride}]])				*range()*
 		Returns a |List| with Numbers:
@@ -8552,21 +8567,6 @@
 			GetExpr()->range()
 <
 
-rand([{expr}])						*rand()* *random*
-		Return a pseudo-random Number generated with an xoshiro128**
-		algorithm using seed {expr}.  The returned number is 32 bits,
-		also on 64 bits systems, for consistency.
-		{expr} can be initialized by |srand()| and will be updated by
-		rand().  If {expr} is omitted, an internal seed value is used
-		and updated.
-
-		Examples: >
-			:echo rand()
-			:let seed = srand()
-			:echo rand(seed)
-			:echo rand(seed) % 16  " random number 0 - 15
-<
-
 readblob({fname})					*readblob()*
 		Read file {fname} in binary mode and return a |Blob|.
 		When the file can't be opened an error message is given and
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index 6fdfb85..683afe4 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt*     For Vim version 8.2.  Last change: 2021 Jun 19
+*index.txt*     For Vim version 8.2.  Last change: 2021 Aug 27
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 7f836e8..1caf084 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 8.2.  Last change: 2021 Jul 31
+*insert.txt*    For Vim version 8.2.  Last change: 2021 Aug 27
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index a181ecb..26b6683 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt*	For Vim version 8.2.  Last change: 2021 Jul 22
+*options.txt*	For Vim version 8.2.  Last change: 2021 Aug 28
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -195,11 +195,18 @@
 This sets the 'titlestring' option to "hi" and 'iconstring' to "there": >
    :set titlestring=hi|set iconstring=there
 
-Similarly, the double quote character starts a comment.  To include the '"' in
-the option value, use '\"' instead.  This example sets the 'titlestring'
-option to 'hi "there"': >
+Similarly, in legacy script the double quote character starts a comment.  To
+include the '"' in the option value, use '\"' instead.  This example sets the
+'titlestring' option to 'hi "there"': >
    :set titlestring=hi\ \"there\"
 
+In |Vim9| script it's simpler, comments start with a '#' character, and only
+when preceded by white space.  A backslash is needed less often: >
+   vim9script
+   set titlestring=hi\ "there"
+   set titlestring=hi#there#
+   set titlestring=hi\ \#there#
+
 For 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
diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt
index 421b12f..c90e0bc 100644
--- a/runtime/doc/pi_netrw.txt
+++ b/runtime/doc/pi_netrw.txt
@@ -1,4 +1,4 @@
-*pi_netrw.txt*  For Vim version 8.2.  Last change: 2020 Sep 19
+*pi_netrw.txt*  For Vim version 8.2.  Last change: 2021 Aug 16
 
 	    ------------------------------------------------
 	    NETRW REFERENCE MANUAL    by Charles E. Campbell
@@ -54,6 +54,7 @@
       Browsing With A Horizontally Split Window...........|netrw-o|
       Browsing With A New Tab.............................|netrw-t|
       Browsing With A Vertically Split Window.............|netrw-v|
+      Change File Permission..............................|netrw-gp|
       Change Listing Style.(thin wide long tree)..........|netrw-i|
       Changing To A Bookmarked Directory..................|netrw-gb|
       Changing To A Predecessor Directory.................|netrw-u|
@@ -1095,6 +1096,7 @@
 	   gf	Force treatment as file                              |netrw-gf|
 	   gh	Quick hide/unhide of dot-files                       |netrw-gh|
 	   gn	Make top of tree the directory below the cursor      |netrw-gn|
+	   gp	Change local-only file permissions                   |netrw-gp|
 	   i	Cycle between thin, long, wide, and tree listings    |netrw-i|
 	   I	Toggle the displaying of the banner                  |netrw-I|
 	   mb	Bookmark current directory                           |netrw-mb|
@@ -1510,6 +1512,8 @@
     If g:netrw_browsex_viewer == '-', then netrwFileHandlers#Invoke() will be
     used instead (see |netrw_filehandler|).
 
+    If the viewer you wish to use does not support handling of a remote URL
+    directory, set |g:netrw_browsex_support_remote| to 0.
   * for Windows 32 or 64, the URL and FileProtocolHandler dlls are used.
   * for Gnome (with gnome-open): gnome-open is used.
   * for KDE (with kfmclient)   : kfmclient is used
@@ -2104,8 +2108,8 @@
 set Vim's notion of the current directory to netrw's current browsing
 directory.
 
-|netrw-cd|: This map's name was changed from "c" to cd (see |netrw-cd|).
-          This change was done to allow for |netrw-cb| and |netrw-cB| maps.
+|netrw-cd| : This map's name was changed from "c" to cd (see |netrw-cd|).
+           This change was done to allow for |netrw-cb| and |netrw-cB| maps.
 
 Associated setting variable: |g:netrw_keepdir|
 
@@ -2607,13 +2611,29 @@
 				a script/function to handle the given
 				extension.  (see |netrw_filehandler|).
 
+  *g:netrw_browsex_support_remote*
+				specify if the specified viewer supports a
+				remote URL.  (see |netrw-handler|).
+
   *g:netrw_chgperm*		Unix/Linux: "chmod PERM FILENAME"
 				Windows:    "cacls FILENAME /e /p PERM"
 				Used to change access permission for a file.
 
+  *g:netrw_clipboard*		=1
+  				By default, netrw will attempt to insure that
+				the clipboard's values will remain unchanged.
+				However, some users report that they have
+				speed problems with this; consequently, this
+				option, when set to zero,  lets such users
+				prevent netrw from saving and restoring the
+				clipboard (the latter is done only as needed).
+				That means that if the clipboard is changed
+				(inadvertently) by normal netrw operation that
+				it will not be restored to its prior state.
+
   *g:netrw_compress*		="gzip"
-				    Will compress marked files with this
-				    command
+				Will compress marked files with this
+				command
 
   *g:Netrw_corehandler*		Allows one to specify something additional
 				to do when handling <core> files via netrw's
@@ -2639,12 +2659,23 @@
 				 =2        cul u-cuc        cul u-cuc
 				 =3        cul u-cuc        cul   cuc
 				 =4        cul   cuc        cul   cuc
+				 =5      U-cul U-cuc      U-cul U-cuc
+				 =6      U-cul U-cuc        cul U-cuc
+				 =7        cul U-cuc        cul U-cuc
+				 =8        cul U-cuc        cul   cuc
 
 				Where
-				  u-cul : user's |'cursorline'|   setting used
-				  u-cuc : user's |'cursorcolumn'| setting used
-				  cul   : |'cursorline'|  locally set
-				  cuc   : |'cursorcolumn'| locally set
+				  u-cul : user's |'cursorline'|   initial setting used
+				  u-cuc : user's |'cursorcolumn'| initial setting used
+				  U-cul : user's |'cursorline'|   current setting used
+				  U-cuc : user's |'cursorcolumn'| current setting used
+				  cul   : |'cursorline'|   will be locally set
+				  cuc   : |'cursorcolumn'| will be locally set
+
+				  The "initial setting" means the values of
+				  the |'cuc'| and |'cul'| settings in effect when
+				  netrw last saw |g:netrw_cursor| >= 5 or when
+				  netrw was initially run.
 
   *g:netrw_decompress*		= { ".gz"  : "gunzip" ,
 				    ".bz2" : "bunzip2" ,
@@ -2654,7 +2685,7 @@
 				  decompression programs.
 
   *g:netrw_dirhistmax*            =10: controls maximum quantity of past
-                                     history.  May be zero to supppress
+                                     history.  May be zero to suppress
 				     history.
 				     (related: |netrw-qb| |netrw-u| |netrw-U|)
 
@@ -3142,6 +3173,9 @@
 will query the user for a new filename; an empty file by that name will
 be placed in the netrw's current directory (ie. b:netrw_curdir).
 
+If Lexplore (|netrw-:Lexplore|) is in use, the new file will be generated
+in the |g:netrw_chgwin| window.
+
 Related topics:               |netrw-d|
 
 
@@ -3809,7 +3843,7 @@
 	  Decho.vim is provided as a "vimball"; see |vimball-intro|.  You
 	  should edit the Decho.vba.gz file and source it in: >
 
-		vim Decho.vba.gz
+	  	vim Decho.vba.gz
 		:so %
 		:q
 <
@@ -3877,6 +3911,32 @@
 ==============================================================================
 12. History						*netrw-history* {{{1
 
+	v171:	Oct 09, 2020	* included code in s:NetrwOptionsSafe()
+				  to allow |'bh'| to be set to delete when
+				  rather than hide when g:netrw_fastbrowse
+				  was zero.
+				* Installed |g:netrw_clipboard| setting
+				* Installed option bypass for |'guioptions'|
+				  a/A settings
+				* Changed popup_beval() to |popup_atcursor|()
+				  in netrw#ErrorMsg (lacygoill). Apparently
+				  popup_beval doesn't reliably close the
+				  popup when the mouse is moved.
+				* VimEnter() now using win_execute to examine
+				  buffers for an attempt to open a directory.
+				  Avoids issues with popups/terminal from
+				  command line. (lacygoill)
+		Jun 28, 2021	* (zeertzjq) provided a patch for use of
+				  xmap,xno instead of vmap,vno in
+				  netrwPlugin.vim. Avoids entanglement with
+				  select mode.
+		Jul 14, 2021	* Fixed problem addressed by tst976; opening
+				  a file using tree mode, going up a
+				  directory, and opening a file there was
+				  opening the file in the wrong directory.
+		Jul 28, 2021	* (Ingo Karkat) provided a patch fixing an
+				  E488 error with netrwPlugin.vim
+				  (occurred for vim versions < 8.02)
 	v170:	Mar 11, 2020	* (reported by Reiner Herrmann) netrw+tree
 				  would not hide with the ^\..* pattern
 				  correctly.
@@ -3893,7 +3953,7 @@
 		Jun 07, 2020	* (reported by Jo Totland) repeatedly invoking
 				  :Lexplore and quitting it left unused
 				  hidden buffers.  Netrw will now set netrw
-				  buffers created by :Lexplore to |bh|=wipe.
+				  buffers created by :Lexplore to |'bh'|=wipe.
 	v169:	Dec 20, 2019	* (reported by amkarthik) that netrw's x
 				  (|netrw-x|) would throw an error when
 				  attempting to open a local directory.
diff --git a/runtime/doc/popup.txt b/runtime/doc/popup.txt
index c582d4c..af7dc70 100644
--- a/runtime/doc/popup.txt
+++ b/runtime/doc/popup.txt
@@ -1,4 +1,4 @@
-*popup.txt*  For Vim version 8.2.  Last change: 2021 Aug 03
+*popup.txt*  For Vim version 8.2.  Last change: 2021 Aug 15
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -260,6 +260,7 @@
 		Can also be used as a |method|: >
 			GetPopup()->popup_close()
 
+
 popup_create({what}, {options})				*popup_create()*
 		Open a popup window showing {what}, which is either:
 		- a buffer number
@@ -284,6 +285,7 @@
 		Can also be used as a |method|: >
 			GetText()->popup_create({})
 
+
 popup_dialog({what}, {options})				*popup_dialog()*
 		Just like |popup_create()| but with these default options: >
 			call popup_create({what}, #{
@@ -307,6 +309,7 @@
 		Can also be used as a |method|: >
 			GetText()->popup_dialog({})
 
+
 popup_filter_menu({id}, {key})				*popup_filter_menu()*
 		Filter that can be used for a popup. These keys can be used:
 		    j <Down> <C-N>	select item below
@@ -386,6 +389,7 @@
 		Can also be used as a |method|: >
 			GetPopup()->popup_getoptions()
 
+
 popup_getpos({id})					*popup_getpos()*
 		Return the position and size of popup {id}.  Returns a Dict
 		with these entries:
@@ -414,6 +418,7 @@
 		Can also be used as a |method|: >
 			GetPopup()->popup_getpos()
 
+
 popup_hide({id})						*popup_hide()*
 		If {id} is a displayed popup, hide it now. If the popup has a
 		filter it will not be invoked for so long as the popup is
@@ -425,6 +430,7 @@
 		Can also be used as a |method|: >
 			GetPopup()->popup_hide()
 
+
 popup_list()						 *popup_list()*
 		Return a List with the |window-ID| of all existing popups.
 
@@ -468,6 +474,7 @@
 <		Can also be used as a |method|: >
 			GetChoices()->popup_menu({})
 
+
 popup_move({id}, {options})					*popup_move()*
 		Move popup {id} to the position specified with {options}.
 		{options} may contain the items from |popup_create()| that
@@ -486,6 +493,7 @@
 		Can also be used as a |method|: >
 			GetPopup()->popup_move(options)
 
+
 popup_notification({what}, {options})			 *popup_notification()*
 		Show the {what} for 3 seconds at the top of the Vim window.
 		This works like: >
@@ -515,12 +523,6 @@
 		Can also be used as a |method|: >
 			GetText()->popup_notification({})
 
-popup_show({id})						*popup_show()*
-		If {id} is a hidden popup, show it now.
-		For {id} see `popup_hide()`.
-		If {id} is the info popup it will be positioned next to the
-		current popup menu item.
-
 
 popup_setoptions({id}, {options})			*popup_setoptions()*
 		Override options in popup {id} with entries in {options}.
@@ -557,6 +559,7 @@
 		Can also be used as a |method|: >
 			GetPopup()->popup_setoptions(options)
 
+
 popup_settext({id}, {text})				*popup_settext()*
 		Set the text of the buffer in popup win {id}. {text} is the
 		same as supplied to |popup_create()|, except that a buffer
@@ -567,6 +570,14 @@
 		Can also be used as a |method|: >
 			GetPopup()->popup_settext('hello')
 
+
+popup_show({id})						*popup_show()*
+		If {id} is a hidden popup, show it now.
+		For {id} see `popup_hide()`.
+		If {id} is the info popup it will be positioned next to the
+		current popup menu item.
+
+
 ==============================================================================
 3. Usage						*popup-usage*
 
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index e781f99..1ade9e9 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1,4 +1,4 @@
-*syntax.txt*	For Vim version 8.2.  Last change: 2021 Jul 02
+*syntax.txt*	For Vim version 8.2.  Last change: 2021 Aug 16
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -1132,11 +1132,13 @@
 
 CPP						*cpp.vim* *ft-cpp-syntax*
 
-Most of things are same as |ft-c-syntax|.
+Most things are the same as |ft-c-syntax|.
 
 Variable		Highlight ~
 cpp_no_cpp11		don't highlight C++11 standard items
 cpp_no_cpp14		don't highlight C++14 standard items
+cpp_no_cpp17		don't highlight C++17 standard items
+cpp_no_cpp20		don't highlight C++20 standard items
 
 
 CSH						*csh.vim* *ft-csh-syntax*
@@ -5201,9 +5203,8 @@
 LineNrBelow	Line number for when the 'relativenumber'
 		option is set, below the cursor line.
 							*hl-CursorLineNr*
-CursorLineNr	Like LineNr when 'cursorline' is set and 'cursorlineopt' is
-		set to "number" or "both", or 'relativenumber' is set, for
-		the cursor line.
+CursorLineNr	Like LineNr when 'cursorline' is set and 'cursorlineopt'
+		contains "number" or is "both", for the cursor line.
 							*hl-MatchParen*
 MatchParen	The character under the cursor or just before it, if it
 		is a paired bracket, and its match. |pi_paren.txt|
diff --git a/runtime/doc/tags b/runtime/doc/tags
index 3682a40..aa7475f 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -6834,10 +6834,12 @@
 g:netrw_banner	pi_netrw.txt	/*g:netrw_banner*
 g:netrw_bannerbackslash	pi_netrw.txt	/*g:netrw_bannerbackslash*
 g:netrw_browse_split	pi_netrw.txt	/*g:netrw_browse_split*
+g:netrw_browsex_support_remote	pi_netrw.txt	/*g:netrw_browsex_support_remote*
 g:netrw_browsex_viewer	pi_netrw.txt	/*g:netrw_browsex_viewer*
 g:netrw_bufsettings	pi_netrw.txt	/*g:netrw_bufsettings*
 g:netrw_chgperm	pi_netrw.txt	/*g:netrw_chgperm*
 g:netrw_chgwin	pi_netrw.txt	/*g:netrw_chgwin*
+g:netrw_clipboard	pi_netrw.txt	/*g:netrw_clipboard*
 g:netrw_compress	pi_netrw.txt	/*g:netrw_compress*
 g:netrw_ctags	pi_netrw.txt	/*g:netrw_ctags*
 g:netrw_cursor	pi_netrw.txt	/*g:netrw_cursor*
@@ -8625,6 +8627,7 @@
 promptbuffer-functions	usr_41.txt	/*promptbuffer-functions*
 pronounce	intro.txt	/*pronounce*
 prop_add()	textprop.txt	/*prop_add()*
+prop_add_list()	textprop.txt	/*prop_add_list()*
 prop_clear()	textprop.txt	/*prop_clear()*
 prop_find()	textprop.txt	/*prop_find()*
 prop_list()	textprop.txt	/*prop_list()*
@@ -9788,6 +9791,7 @@
 tips	tips.txt	/*tips*
 tips.txt	tips.txt	/*tips.txt*
 tmux	syntax.txt	/*tmux*
+tmux-integration	term.txt	/*tmux-integration*
 todo	todo.txt	/*todo*
 todo.txt	todo.txt	/*todo.txt*
 toggle	options.txt	/*toggle*
@@ -10215,6 +10219,7 @@
 vim9-lambda-arguments	vim9.txt	/*vim9-lambda-arguments*
 vim9-mix	vim9.txt	/*vim9-mix*
 vim9-namespace	vim9.txt	/*vim9-namespace*
+vim9-no-dict-function	vim9.txt	/*vim9-no-dict-function*
 vim9-rationale	vim9.txt	/*vim9-rationale*
 vim9-reload	vim9.txt	/*vim9-reload*
 vim9-scopes	vim9.txt	/*vim9-scopes*
diff --git a/runtime/doc/term.txt b/runtime/doc/term.txt
index 811d507..d6f31d3 100644
--- a/runtime/doc/term.txt
+++ b/runtime/doc/term.txt
@@ -1,4 +1,4 @@
-*term.txt*      For Vim version 8.2.  Last change: 2021 Jan 14
+*term.txt*      For Vim version 8.2.  Last change: 2021 Aug 29
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -127,6 +127,37 @@
 	  exec "set t_PE=\e[201~"
 	endif
 <
+							*tmux-integration*
+If you experience issues when running Vim inside tmux, here are a few hints.
+You can comment-out parts if something doesn't work (it may depend on the
+terminal that tmux is running in): >
+
+    if !has('gui_running') && &term =~ '^\%(screen\|tmux\)'
+        " Better mouse support, see  :help 'ttymouse'
+        set ttymouse=sgr
+
+        " Enable true colors, see  :help xterm-true-color
+        let &termguicolors = v:true
+        let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
+        let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
+
+        " Enable bracketed paste mode, see  :help xterm-bracketed-paste
+        let &t_BE = "\<Esc>[?2004h"
+        let &t_BD = "\<Esc>[?2004l"
+        let &t_PS = "\<Esc>[200~"
+        let &t_PE = "\<Esc>[201~"
+
+        " Enable focus event tracking, see  :help xterm-focus-event
+        let &t_fe = "\<Esc>[?1004h"
+        let &t_fd = "\<Esc>[?1004l"
+
+        " Enable modified arrow keys, see  :help xterm-modifier-keys
+        execute "silent! set <xUp>=\<Esc>[@;*A"
+        execute "silent! set <xDown>=\<Esc>[@;*B"
+        execute "silent! set <xRight>=\<Esc>[@;*C"
+        execute "silent! set <xLeft>=\<Esc>[@;*D"
+    endif
+<
 							*cs7-problem*
 Note: If the terminal settings are changed after running Vim, you might have
 an illegal combination of settings.  This has been reported on Solaris 2.5
@@ -559,6 +590,11 @@
 If you would like to disable this feature, add the following to your .vimrc:
 	`set t_fd=`
 	`set t_fe=`
+If your terminal does support this but Vim does not recognize the terminal,
+you may have to set the options yourself: >
+	let &t_fe = "\<Esc>[?1004h"
+	let &t_fd = "\<Esc>[?1004l"
+If this causes garbage to show when Vim starts up then it doesn't work.
 
 							*termcap-colors*
 Note about colors: The 't_Co' option tells Vim the number of colors available.
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt
index 15e9357..2f2556a 100644
--- a/runtime/doc/terminal.txt
+++ b/runtime/doc/terminal.txt
@@ -1,4 +1,4 @@
-*terminal.txt*	For Vim version 8.2.  Last change: 2021 Aug 10
+*terminal.txt*	For Vim version 8.2.  Last change: 2021 Aug 15
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -752,18 +752,6 @@
 			GetBufnr()->term_sendkeys(keys)
 
 
-term_setapi({buf}, {expr})				*term_setapi()*
-		Set the function name prefix to be used for the |terminal-api|
-		function in terminal {buf}.  For example: >
-		    :call term_setapi(buf, "Myapi_")
-		    :call term_setapi(buf, "")
-<
-		The default is "Tapi_".  When {expr} is an empty string then
-		no |terminal-api| function can be used for {buf}.
-
-		When used as a method the base is used for {buf}: >
-			GetBufnr()->term_setapi({expr})
-
 term_setansicolors({buf}, {colors})			*term_setansicolors()*
 		Set the ANSI color palette used by terminal {buf}.
 		{colors} must be a List of 16 valid color names or hexadecimal
@@ -799,6 +787,20 @@
 <		{only available with GUI enabled and/or the |+termguicolors|
 		feature}
 
+
+term_setapi({buf}, {expr})				*term_setapi()*
+		Set the function name prefix to be used for the |terminal-api|
+		function in terminal {buf}.  For example: >
+		    :call term_setapi(buf, "Myapi_")
+		    :call term_setapi(buf, "")
+<
+		The default is "Tapi_".  When {expr} is an empty string then
+		no |terminal-api| function can be used for {buf}.
+
+		When used as a method the base is used for {buf}: >
+			GetBufnr()->term_setapi({expr})
+
+
 term_setkill({buf}, {how})				*term_setkill()*
 		When exiting Vim or trying to close the terminal window in
 		another way, {how} defines whether the job in the terminal can
diff --git a/runtime/doc/testing.txt b/runtime/doc/testing.txt
index 18f6b19..5094d51 100644
--- a/runtime/doc/testing.txt
+++ b/runtime/doc/testing.txt
@@ -1,4 +1,4 @@
-*testing.txt*	For Vim version 8.2.  Last change: 2021 Jul 07
+*testing.txt*	For Vim version 8.2.  Last change: 2021 Aug 15
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -46,6 +46,7 @@
 		Can also be used as a |method|: >
 			GetAllocId()->test_alloc_fail()
 
+
 test_autochdir()					*test_autochdir()*
 		Set a flag to enable the effect of 'autochdir' before Vim
 		startup has finished.
@@ -59,6 +60,7 @@
 		Can also be used as a |method|: >
 			GetText()->test_feedinput()
 
+
 test_garbagecollect_now()			 *test_garbagecollect_now()*
 		Like garbagecollect(), but executed right away.  This must
 		only be called directly to avoid any structure to exist
@@ -132,6 +134,7 @@
 		Can also be used as a |method|: >
 			GetErrorText()->test_ignore_error()
 
+
 test_null_blob()					*test_null_blob()*
 		Return a |Blob| that is null. Only useful for testing.
 
@@ -166,13 +169,6 @@
 		Return a |String| that is null. Only useful for testing.
 
 
-test_unknown()						*test_unknown()*
-		Return a value with unknown type. Only useful for testing.
-
-test_void()						*test_void()*
-		Return a value with void type. Only useful for testing.
-
-
 test_option_not_set({name})				*test_option_not_set()*
 		Reset the flag that indicates option {name} was set.  Thus it
 		looks like it still has the default value. Use like this: >
@@ -224,6 +220,7 @@
 <		Can also be used as a |method|: >
 			GetOverrideVal()-> test_override('starting')
 
+
 test_refcount({expr})					*test_refcount()*
 		Return the reference count of {expr}.  When {expr} is of a
 		type that does not have a reference count, returns -1.  Only
@@ -253,6 +250,7 @@
 		Can also be used as a |method|: >
 			GetValue()->test_scrollbar('right', 0)
 
+
 test_setmouse({row}, {col})				*test_setmouse()*
 		Set the mouse position to be used for the next mouse action.
 		{row} and {col} are one based.
@@ -260,6 +258,7 @@
 			call test_setmouse(4, 20)
 			call feedkeys("\<LeftMouse>", "xt")
 
+
 test_settime({expr})					*test_settime()*
 		Set the time Vim uses internally.  Currently only used for
 		timestamps in the history, as they are used in viminfo, and
@@ -272,10 +271,19 @@
 		Can also be used as a |method|: >
 			GetTime()->test_settime()
 
+
 test_srand_seed([seed])					*test_srand_seed()*
 		When [seed] is given this sets the seed value used by
 		`srand()`.  When omitted the test seed is removed.
 
+
+test_unknown()						*test_unknown()*
+		Return a value with unknown type. Only useful for testing.
+
+
+test_void()						*test_void()*
+		Return a value with void type. Only useful for testing.
+
 ==============================================================================
 3. Assert functions				*assert-functions-details*
 
diff --git a/runtime/doc/textprop.txt b/runtime/doc/textprop.txt
index c742293..ac0d310 100644
--- a/runtime/doc/textprop.txt
+++ b/runtime/doc/textprop.txt
@@ -1,4 +1,4 @@
-*textprop.txt*  For Vim version 8.2.  Last change: 2021 May 26
+*textprop.txt*  For Vim version 8.2.  Last change: 2021 Aug 16
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index e1e530b..b7972c0 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt*      For Vim version 8.2.  Last change: 2021 Aug 14
+*todo.txt*      For Vim version 8.2.  Last change: 2021 Aug 25
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -44,6 +44,7 @@
 - For builtin functions using tv_get_string*() use check_for_string() to be
   more strict about the argument type (not a bool).
     done: balloon_()
+- Disallow using numbered function with "g:123" in Vim9 script?  #8760
 - Check many more builtin function arguments at compile time.
     map() could check that the return type of the function argument matches
     the type of the list or dict member. (#8092)
@@ -75,6 +76,7 @@
   evaluation.
   Use the location where the option was set for deciding whether it's to be
   evaluated in Vim9 script context.
+- Handle command that is only a range more efficient than calling ISN_EXEC
 - implement :type, "import type"
 - implement enum,  "import enum".
 - implement class and interface: See |vim9-classes|
@@ -241,6 +243,8 @@
 Memory leak in test_alot with expand()
 Memory leaks in test_channel? (or is it because of fork())
 
+Idea: when typing ":e /some/dir/" and "dir" does not exist, highlight in red.
+
 ":set &shellpipe" and ":set &shellredir" should use the logic from
 initialization to figure out the default value from 'shell'.  Add a test for
 this.
diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt
index 27e4d66..43775bd 100644
--- a/runtime/doc/version6.txt
+++ b/runtime/doc/version6.txt
@@ -12232,7 +12232,7 @@
 
 Patch 6.2.348
 Problem:    Win32: "vim c:\dir\(test)" doesn't work, because the 'isfname'
-	    default value doesn't contain parenthesis.
+	    default value doesn't contain parentheses.
 Solution:   Temporarily add '(' and ')' to 'isfname' when expanding file name
 	    arguments.
 Files:	    src/main.c
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index 1628e9c..346189b 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1,4 +1,4 @@
-*vim9.txt*	For Vim version 8.2.  Last change: 2021 Aug 11
+*vim9.txt*	For Vim version 8.2.  Last change: 2021 Aug 23
 
 
 		  VIM REFERENCE MANUAL	  by Bram Moolenaar
@@ -106,6 +106,9 @@
   or curly-braces names.
 - A range before a command must be prefixed with a colon: >
 	:%s/this/that
+- Executing a register with "@r" does not work, you can prepend a colon or use
+  `:exe`: >
+  	:exe @a
 - Unless mentioned specifically, the highest |scriptversion| is used.
 
 
@@ -154,7 +157,7 @@
   function was defined
 - `:disassemble` is used for the function.
 - a function that is compiled calls the function or uses it as a function
-  reference
+  reference (so that the argument and return types can be checked)
 							*E1091*
 If compilation fails it is not tried again on the next call, instead this
 error is given: "E1091: Function is not compiled: {name}".
@@ -168,7 +171,7 @@
 "closure".  A `:def` function always aborts on an error (unless `:silent!` was
 used for the command or inside a `:try` block), does not get a range passed
 cannot be a "dict" function, and can always be a closure.
-
+						*vim9-no-dict-function*
 Later classes will be added, which replaces the "dict function" mechanism.
 For now you will need to pass the dictionary explicitly: >
 	def DictFunc(d: dict<any>, arg: string)
@@ -477,7 +480,7 @@
 If the expression starts with "!" this is interpreted as a shell command, not
 negation of a condition.  Thus this is a shell command: >
 	!shellCommand->something
-Put the expression in parenthesis to use the "!" for negation: >
+Put the expression in parentheses to use the "!" for negation: >
 	(!expression)->Method()
 
 Note that while variables need to be defined before they can be used,
@@ -741,8 +744,8 @@
 	      arg	   # OK
 	      )
 
-White space space is not allowed in a `:set` command between the option name
-and a following "&", "!", "<", "=", "+=", "-=" or "^=".
+White space is not allowed in a `:set` command between the option name and a
+following "&", "!", "<", "=", "+=", "-=" or "^=".
 
 
 No curly braces expansion ~
diff --git a/runtime/filetype.vim b/runtime/filetype.vim
index 6144b5f..06038e9 100644
--- a/runtime/filetype.vim
+++ b/runtime/filetype.vim
@@ -1,7 +1,7 @@
 " Vim support file to detect file types
 "
 " Maintainer:	Bram Moolenaar <Bram@vim.org>
-" Last Change:	2021 Jul 03
+" Last Change:	2021 Aug 23
 
 " Listen very carefully, I will say this only once
 if exists("did_load_filetypes")
diff --git a/runtime/ftplugin/scala.vim b/runtime/ftplugin/scala.vim
index 18e16f1..b484df9 100644
--- a/runtime/ftplugin/scala.vim
+++ b/runtime/ftplugin/scala.vim
@@ -3,7 +3,7 @@
 " Maintainer:           Derek Wyatt
 " URL:                  https://github.com/derekwyatt/vim-scala
 " License:              Same as Vim
-" Last Change:          02 August 2016
+" Last Change:          11 August 2021
 " ----------------------------------------------------------------------------
 
 if exists('b:did_ftplugin') || &cp
@@ -26,8 +26,8 @@
 
 setlocal shiftwidth=2 softtabstop=2 expandtab
 
-setlocal include='^\s*import'
-setlocal includeexpr='substitute(v:fname,"\\.","/","g")'
+setlocal include=^\\s*import
+setlocal includeexpr=substitute(v:fname,'\\.','/','g')
 
 setlocal path+=src/main/scala,src/test/scala
 setlocal suffixesadd=.scala
diff --git a/runtime/indent/scala.vim b/runtime/indent/scala.vim
index 6fd8ca9..b5eba29 100644
--- a/runtime/indent/scala.vim
+++ b/runtime/indent/scala.vim
@@ -20,7 +20,10 @@
 let s:keepcpo= &cpo
 set cpo&vim
 
-let s:defMatcher = '\%(\%(private\|protected\)\%(\[[^\]]*\]\)\?\s\+\|abstract\s\+\|override\s\+\)*\<def\>'
+let s:annotationMatcher = '@[A-Za-z._]\+\s\+'
+let s:modifierMatcher = s:annotationMatcher . '\|\%(private\|protected\)\%(\[[^\]]*\]\)\?\s\+\|abstract\s\+\|override\s\+\|final\s\+'
+let s:defMatcher = '\%(' . s:modifierMatcher . '\)*\<def\>'
+let s:valMatcher = '\%(' . s:modifierMatcher . '\|lazy\s\+\)*\<va[lr]\>'
 let s:funcNameMatcher = '\w\+'
 let s:typeSpecMatcher = '\%(\s*\[\_[^\]]*\]\)'
 let s:defArgMatcher = '\%((\_.\{-})\)'
@@ -184,7 +187,7 @@
 endfunction
 
 function! scala#MatchesIncompleteDefValr(line)
-  if a:line =~ '^\s*\%(' . s:defMatcher . '\|\<va[lr]\>\).*[=({]\s*$'
+  if a:line =~ '^\s*\%(' . s:defMatcher . '\|' . s:valMatcher . '\).*[=({]\s*$'
     return 1
   else
     return 0
@@ -434,7 +437,7 @@
   " If 'val', 'var', 'def' end with =, this is a one-line block
   if (prevline =~ '^\s*\<\%(\%(}\?\s*else\s\+\)\?if\|for\|while\)\>.*[)=]\s*$' && scala#NumberOfBraceGroups(prevline) <= 1)
         \ || prevline =~ '^\s*' . s:defMatcher . '.*=\s*$'
-        \ || prevline =~ '^\s*\<va[lr]\>.*[=]\s*$'
+        \ || prevline =~ '^\s*' . s:valMatcher . '.*[=]\s*$'
         \ || prevline =~ '^\s*\%(}\s*\)\?\<else\>\s*$'
         \ || prevline =~ '=\s*$'
     call scala#ConditionalConfirm("4")
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 3b9002a..a7b6953 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
Binary files differ
diff --git a/runtime/plugin/netrwPlugin.vim b/runtime/plugin/netrwPlugin.vim
index 217a779..d309f81 100644
--- a/runtime/plugin/netrwPlugin.vim
+++ b/runtime/plugin/netrwPlugin.vim
@@ -1,9 +1,9 @@
 " netrwPlugin.vim: Handles file transfer and remote directory listing across a network
 "            PLUGIN SECTION
-" Date:		Feb 08, 2016 - Jan 07, 2020
+" Date:		Feb 09, 2021
 " Maintainer:	Charles E Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
-" Copyright:    Copyright (C) 1999-2013 Charles E. Campbell {{{1
+" Copyright:    Copyright (C) 1999-2021 Charles E. Campbell {{{1
 "               Permission is hereby granted to use and distribute this code,
 "               with or without modifications, provided that this copyright
 "               notice is copied with it. Like anything else that's free,
@@ -20,7 +20,7 @@
 if &cp || exists("g:loaded_netrwPlugin")
  finish
 endif
-let g:loaded_netrwPlugin = "v170"
+let g:loaded_netrwPlugin = "v171"
 let s:keepcpo = &cpo
 set cpo&vim
 "DechoRemOn
@@ -83,11 +83,11 @@
   endif
   nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX()))<cr>
  endif
- if maparg('gx','v') == ""
+ if maparg('gx','x') == ""
   if !hasmapto('<Plug>NetrwBrowseXVis')
-   vmap <unique> gx <Plug>NetrwBrowseXVis
+   xmap <unique> gx <Plug>NetrwBrowseXVis
   endif
-  vno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr>
+  xno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr>
  endif
 endif
 if exists("g:netrw_usetab") && g:netrw_usetab
@@ -129,7 +129,9 @@
   elseif isdirectory(a:dirname)
 "   call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft."  (isdirectory, not amiga)")
 "   call Dredir("LocalBrowse ft last set: ","verbose set ft")
-   sil! call netrw#LocalBrowseCheck(a:dirname)
+   " Jul 13, 2021: for whatever reason, preceding the following call with
+   " a   sil!  causes an unbalanced if-endif vim error
+   call netrw#LocalBrowseCheck(a:dirname)
    if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
     exe w:netrw_bannercnt
    endif
@@ -151,10 +153,22 @@
 "             has already been called.
 fun! s:VimEnter(dirname)
 "  call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">")
+  if has('nvim') || v:version < 802
+  " Johann Höchtl: reported that the call range... line causes an E488: Trailing characters
+  "                error with neovim. I suspect its because neovim hasn't updated with recent
+  "                vim patches. As is, this code will have problems with popup terminals
+  "                instantiated before the VimEnter event runs.
+  " Ingo Karkat  : E488 also in Vim 8.1.1602
   let curwin       = winnr()
   let s:vimentered = 1
   windo call s:LocalBrowse(expand("%:p"))
   exe curwin."wincmd w"
+ else
+  " the following complicated expression comes courtesy of lacygoill; largely does the same thing as the windo and 
+  " wincmd which are commented out, but avoids some side effects. Allows popup terminal before VimEnter.
+  let s:vimentered = 1
+  call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')})
+ endif
 "  call Dret("s:VimEnter")
 endfun
 
diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim
index 3ad79d5..5437580 100644
--- a/runtime/syntax/cpp.vim
+++ b/runtime/syntax/cpp.vim
@@ -2,7 +2,7 @@
 " Language:	C++
 " Current Maintainer:	vim-jp (https://github.com/vim-jp/vim-cpp)
 " Previous Maintainer:	Ken Shan <ccshan@post.harvard.edu>
-" Last Change:	2021 May 04
+" Last Change:	2021 Aug 23
 
 " quit when a syntax file was already loaded
 if exists("b:current_syntax")
@@ -60,7 +60,7 @@
   syn match cppFloat		display contained "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
   syn match cppFloat		display contained "\<\.\d\+\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
   syn match cppFloat		display contained "\<\d\+e[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
-  syn region cppString		start=+\(L\|u\|u8\|U\|R\|LR\|u8R\|uR\|UR\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"\(sv\|s\|_\i*\)\=+ end='$' contains=cSpecial,cFormat,@Spell
+  syn region cppString		start=+\(L\|u\|u8\|U\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"\(sv\|s\|_\i*\)\=+ end='$' contains=cSpecial,cFormat,@Spell
 endif
 
 " C++ 17 extensions
@@ -69,6 +69,20 @@
   syn match cppCast		"\<reinterpret_pointer_cast\s*$"
   syn match cppFloat		display contained "\<0x\x*\.\x\+p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
   syn match cppFloat		display contained "\<0x\x\+\.\=p[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
+
+  " TODO: push this up to c.vim if/when supported in C23
+  syn match cppCharacter	"u8'[^\\]'"
+  syn match cppCharacter	"u8'[^']*'" contains=cSpecial
+  if exists("c_gnu")
+    syn match cppSpecialError	  "u8'\\[^'\"?\\abefnrtv]'"
+    syn match cppSpecialCharacter "u8'\\['\"?\\abefnrtv]'"
+  else
+    syn match cppSpecialError	  "u8'\\[^'\"?\\abfnrtv]'"
+    syn match cppSpecialCharacter "u8'\\['\"?\\abfnrtv]'"
+  endif
+  syn match cppSpecialCharacter display "u8'\\\o\{1,3}'"
+  syn match cppSpecialCharacter display "u8'\\x\x\+'"
+
 endif
 
 " C++ 20 extensions
@@ -99,6 +113,9 @@
 hi def link cppStorageClass	StorageClass
 hi def link cppStructure		Structure
 hi def link cppBoolean		Boolean
+hi def link cppCharacter		cCharacter
+hi def link cppSpecialCharacter		cSpecialCharacter
+hi def link cppSpecialError		cSpecialError
 hi def link cppConstant		Constant
 hi def link cppRawStringDelimiter	Delimiter
 hi def link cppRawString		String
diff --git a/runtime/syntax/gemtext.vim b/runtime/syntax/gemtext.vim
new file mode 100644
index 0000000..8c2bd29
--- /dev/null
+++ b/runtime/syntax/gemtext.vim
@@ -0,0 +1,24 @@
+" Vim syntax file
+" Language:             Gemtext markup language
+" Maintainer:           Suneel Freimuth <suneelfreimuth1@gmail.com>
+" Latest Revision:      2020-11-21
+" Filenames:            *.gmi
+
+if exists('b:current_syntax')
+    finish
+endif
+
+syntax match  Heading  /^#\{1,3}.\+$/
+syntax match  List     /^\* /
+syntax match  LinkURL  /^=>\s*\S\+/
+syntax match  Quote    /^>.\+/
+syntax region Preformatted start=/^```/ end=/```/
+
+highlight default link Heading  Special
+highlight default link List     Statement
+highlight default link LinkURL  Underlined
+highlight default link Quote    Constant
+highlight default link Preformatted Identifier
+
+let b:current_syntax = 'gemtext'
+
diff --git a/runtime/syntax/scala.vim b/runtime/syntax/scala.vim
index 89a936a..16e1147 100644
--- a/runtime/syntax/scala.vim
+++ b/runtime/syntax/scala.vim
@@ -3,8 +3,7 @@
 " Maintainer:           Derek Wyatt
 " URL:                  https://github.com/derekwyatt/vim-scala
 " License:              Same as Vim
-" Last Change:          2021 Aug 11
-"                       by Jesse Atkinson, PR #8746
+" Last Change:          23 August 2021
 " ----------------------------------------------------------------------------
 
 if !exists('main_syntax')
@@ -103,9 +102,9 @@
 syn match scalaTypeTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite
 syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite
 syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
-syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite
+syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeTypeDeclaration skipwhite
 syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite
-syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite
+syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeTypePostDeclaration skipwhite
 hi link scalaTypeTypeDeclaration Type
 hi link scalaTypeTypeExtension Keyword
 hi link scalaTypeTypePostDeclaration Special
@@ -114,21 +113,23 @@
 syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite
 syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite
 syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite
-syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeDeclaration skipwhite
+syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained contains=scalaTypeOperator nextgroup=scalaTypeDeclaration skipwhite
 hi link scalaTypeDeclaration Type
 hi link scalaTypeExtension Keyword
 hi link scalaTypePostExtension Keyword
 
 syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration contains=scalaRoundBrackets
 syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration
-hi link scalaTypeAnnotation Normal
+hi clear scalaTypeAnnotation
 
-syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained
-syn match scalaCaseFollowing /`[^`]\+`/ contained
+syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained contains=scalaCapitalWord
+syn match scalaCaseFollowing /`[^`]\+`/ contained contains=scalaCapitalWord
 hi link scalaCaseFollowing Special
 
-syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super
+syn keyword scalaKeywordModifier abstract override final lazy implicit private protected sealed null super
+syn keyword scalaSpecialFunction implicitly require
 hi link scalaKeywordModifier Function
+hi link scalaSpecialFunction Function
 
 syn keyword scalaSpecial this true false ne eq
 syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite
@@ -152,14 +153,14 @@
 syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained
 exe 'syn region scalaInterpolationB matchgroup=scalaInterpolationBoundary start=/\${/ end=/}/ contained contains=' . s:ContainedGroup()
 hi link scalaInterpolation Function
-hi link scalaInterpolationB Normal
+hi clear scalaInterpolationB
 
 syn region scalaFString matchgroup=scalaInterpolationBrackets start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
 syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained
 exe 'syn region scalaFInterpolationB matchgroup=scalaInterpolationBoundary start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup()
 hi link scalaFString String
 hi link scalaFInterpolation Function
-hi link scalaFInterpolationB Normal
+hi clear scalaFInterpolationB
 
 syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar
 syn region scalaTripleFString matchgroup=scalaInterpolationBrackets start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar
@@ -200,7 +201,6 @@
 hi link scalaParameterAnnotation Function
 hi link scalaParamAnnotationValue Keyword
 hi link scalaCommentAnnotation Function
-hi link scalaCommentCodeBlockBrackets String
 hi link scalaCommentCodeBlock String
 hi link scalaTodo Todo
 
diff --git a/runtime/syntax/structurizr.vim b/runtime/syntax/structurizr.vim
new file mode 100644
index 0000000..73629b1
--- /dev/null
+++ b/runtime/syntax/structurizr.vim
@@ -0,0 +1,76 @@
+" Vim syntax file
+" Language:      Structurizr DSL
+" Maintainer:    Bastian Venthur <venthur@debian.org>
+" Last Change:   2021-08-16
+" Remark:        For a language reference, see
+"                https://github.com/structurizr/dsl
+
+
+if exists("b:current_syntax")
+    finish
+endif
+
+syn case ignore
+
+" comments
+syn match scomment "#.*$"
+syn match scomment "//.*$"
+syn region scomment start="/\*" end="\*/"
+
+" keywords
+syn keyword skeyword animation
+syn keyword skeyword autoLayout
+syn keyword skeyword branding
+syn keyword skeyword component
+syn keyword skeyword configuration
+syn keyword skeyword container
+syn keyword skeyword containerinstance
+syn keyword skeyword custom
+syn keyword skeyword deployment
+syn keyword skeyword deploymentenvironment
+syn keyword skeyword deploymentgroup
+syn keyword skeyword deploymentnode
+syn keyword skeyword dynamic
+syn keyword skeyword element
+syn keyword skeyword enterprise
+syn keyword skeyword exclude
+syn keyword skeyword filtered
+syn keyword skeyword group
+syn keyword skeyword healthcheck
+syn keyword skeyword impliedrelationships
+syn keyword skeyword include
+syn keyword skeyword infrastructurenode
+syn keyword skeyword model
+syn keyword skeyword person
+syn keyword skeyword perspectives
+syn keyword skeyword properties
+syn keyword skeyword relationship
+syn keyword skeyword softwaresystem
+syn keyword skeyword softwaresysteminstance
+syn keyword skeyword styles
+syn keyword skeyword systemcontext
+syn keyword skeyword systemlandscape
+syn keyword skeyword tags
+syn keyword skeyword terminology
+syn keyword skeyword theme
+syn keyword skeyword title
+syn keyword skeyword url
+syn keyword skeyword users
+syn keyword skeyword views
+syn keyword skeyword workspace
+
+syn match skeyword "\!adrs\s\+"
+syn match skeyword "\!constant\s\+"
+syn match skeyword "\!docs\s\+"
+syn match skeyword "\!identifiers\s\+"
+syn match skeyword "\!include\s\+"
+
+syn region sstring oneline start='"' end='"'
+
+syn region sblock start='{' end='}' fold transparent
+
+hi def link sstring string
+hi def link scomment comment
+hi def link skeyword keyword
+
+let b:current_syntax = "structurizr"
diff --git a/runtime/tutor/tutor b/runtime/tutor/tutor
index 9c5402d..bbad00d 100644
--- a/runtime/tutor/tutor
+++ b/runtime/tutor/tutor
@@ -143,12 +143,12 @@
 
   !! NOTE: Before executing any of the steps below, read this entire lesson!!
 
-  1. Exit this tutor as you did in lesson 1.2:  :q!
-     Or, if you have access to another terminal, do the following there.
+  1.  If you have access to another terminal, do the following there.
+      Otherwise, exit this tutor as you did in lesson 1.2:  :q!
 
-  2. At the shell prompt type this command:  vim tutor <ENTER>
-     'vim' is the command to start the Vim editor, 'tutor' is the name of the
-     file you wish to edit.  Use a file that may be changed.
+  2. At the shell prompt type this command:  vim file.txt <ENTER>
+     'vim' is the command to start the Vim editor, 'file.txt' is the name of
+     the file you wish to edit.  Use the name of a file that you can change.
 
   3. Insert and delete text as you learned in the previous lessons.
 
diff --git a/runtime/tutor/tutor.utf-8 b/runtime/tutor/tutor.utf-8
index 9c5402d..bbad00d 100644
--- a/runtime/tutor/tutor.utf-8
+++ b/runtime/tutor/tutor.utf-8
@@ -143,12 +143,12 @@
 
   !! NOTE: Before executing any of the steps below, read this entire lesson!!
 
-  1. Exit this tutor as you did in lesson 1.2:  :q!
-     Or, if you have access to another terminal, do the following there.
+  1.  If you have access to another terminal, do the following there.
+      Otherwise, exit this tutor as you did in lesson 1.2:  :q!
 
-  2. At the shell prompt type this command:  vim tutor <ENTER>
-     'vim' is the command to start the Vim editor, 'tutor' is the name of the
-     file you wish to edit.  Use a file that may be changed.
+  2. At the shell prompt type this command:  vim file.txt <ENTER>
+     'vim' is the command to start the Vim editor, 'file.txt' is the name of
+     the file you wish to edit.  Use the name of a file that you can change.
 
   3. Insert and delete text as you learned in the previous lessons.
 
diff --git a/src/INSTALL b/src/INSTALL
index df7aa88..0515341 100644
--- a/src/INSTALL
+++ b/src/INSTALL
@@ -44,6 +44,7 @@
 	% sudo apt install git
 	% sudo apt install make
 	% sudo apt install clang
+	% sudo apt install libtool-bin
 	
 	Build Vim with default features:
 	% git clone https://github.com/vim/vim.git
diff --git a/src/gvimtutor b/src/gvimtutor
index c452043..36ca7bc 100644
--- a/src/gvimtutor
+++ b/src/gvimtutor
@@ -5,4 +5,4 @@
 # Usage: gvimtutor [xx]
 # See vimtutor for usage.
 
-exec `dirname $0`/vimtutor -g "$@"
+exec $(dirname $0)/vimtutor -g "$@"
diff --git a/src/vimtutor b/src/vimtutor
index 1e8769b..3b154f2 100755
--- a/src/vimtutor
+++ b/src/vimtutor
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
 
 # Start Vim on a copy of the tutor file.
 
@@ -13,11 +13,11 @@
 # have Vim installed with its version number.
 # We anticipate up to a future Vim 8.1 version :-).
 seq="vim vim81 vim80 vim8 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi"
-if test "$1" = "-g"; then 
-  # Try to use the GUI version of Vim if possible, it will fall back
-  # on Vim if Gvim is not installed.
-  seq="gvim gvim81 gvim80 gvim8 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq"
-  shift
+if test "$1" = "-g"; then
+    # Try to use the GUI version of Vim if possible, it will fall back
+    # on Vim if Gvim is not installed.
+    seq="gvim gvim81 gvim80 gvim8 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq"
+    shift
 fi
 
 xx=$1
@@ -53,17 +53,17 @@
 trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15
 
 for i in $seq; do
-	testvim=`which $i 2>/dev/null`
-	if test -f "$testvim"; then
-		VIM=$i
-		break
-	fi
+    testvim=$(which $i 2>/dev/null)
+    if test -f "$testvim"; then
+        VIM=$i
+        break
+    fi
 done
 
 # When no Vim version was found fall back to "vim", you'll get an error message
 # below.
 if test -z "$VIM"; then
-	VIM=vim
+    VIM=vim
 fi
 
 # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
@@ -71,4 +71,4 @@
 $VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim'
 
 # Start vim without any .vimrc, set 'nocompatible' and 'showcmd'
-$VIM -f -u NONE -c "set nocp showcmd" $TUTORCOPY
+$VIM -f -u NONE -c "set nocp showcmd" "$TUTORCOPY"
diff --git a/vimtutor.bat b/vimtutor.bat
index e3b3167..0387e98 100644
--- a/vimtutor.bat
+++ b/vimtutor.bat
@@ -11,7 +11,7 @@
 
 :: Use Vim to copy the tutor, it knows the value of $VIMRUNTIME
 FOR %%d in (. %TMP% %TEMP%) DO (
-    call :test_dir_writable %0 %%d
+    call :test_dir_writable %~dpf0 %%d
     IF NOT ERRORLEVEL 1 GOTO dir_ok
 )