diff --git a/usr/bin/diffstat.exe b/usr/bin/diffstat.exe index 68b37f96f81..81220e667c9 100644 Binary files a/usr/bin/diffstat.exe and b/usr/bin/diffstat.exe differ diff --git a/usr/bin/ex.exe b/usr/bin/ex.exe index 93d111a7770..70c9866289e 100755 Binary files a/usr/bin/ex.exe and b/usr/bin/ex.exe differ diff --git a/usr/bin/gapplication.exe b/usr/bin/gapplication.exe index 89475652aea..dee57d98809 100644 Binary files a/usr/bin/gapplication.exe and b/usr/bin/gapplication.exe differ diff --git a/usr/bin/gdbus.exe b/usr/bin/gdbus.exe index c13f573fc13..e19c9d50f5e 100644 Binary files a/usr/bin/gdbus.exe and b/usr/bin/gdbus.exe differ diff --git a/usr/bin/gio-querymodules.exe b/usr/bin/gio-querymodules.exe index dcd4b9dd9a3..24dec1f1c56 100644 Binary files a/usr/bin/gio-querymodules.exe and b/usr/bin/gio-querymodules.exe differ diff --git a/usr/bin/gio.exe b/usr/bin/gio.exe index 4ed0c36e59b..817f6d15cbe 100644 Binary files a/usr/bin/gio.exe and b/usr/bin/gio.exe differ diff --git a/usr/bin/glib-compile-schemas.exe b/usr/bin/glib-compile-schemas.exe index 3a31e0aaaa5..93818f5d876 100644 Binary files a/usr/bin/glib-compile-schemas.exe and b/usr/bin/glib-compile-schemas.exe differ diff --git a/usr/bin/gresource.exe b/usr/bin/gresource.exe index 3b6c640d6ca..d40a7d8de1b 100644 Binary files a/usr/bin/gresource.exe and b/usr/bin/gresource.exe differ diff --git a/usr/bin/gsettings.exe b/usr/bin/gsettings.exe index d728cffe2c7..ba141cecae6 100644 Binary files a/usr/bin/gsettings.exe and b/usr/bin/gsettings.exe differ diff --git a/usr/bin/msys-gio-2.0-0.dll b/usr/bin/msys-gio-2.0-0.dll index 435bf37c9b4..67b85128ad0 100644 Binary files a/usr/bin/msys-gio-2.0-0.dll and b/usr/bin/msys-gio-2.0-0.dll differ diff --git a/usr/bin/msys-girepository-2.0-0.dll b/usr/bin/msys-girepository-2.0-0.dll index 762104006a8..0200fc8d606 100644 Binary files a/usr/bin/msys-girepository-2.0-0.dll and b/usr/bin/msys-girepository-2.0-0.dll differ diff --git a/usr/bin/msys-glib-2.0-0.dll b/usr/bin/msys-glib-2.0-0.dll index 3de0262d7c3..2833feb2386 100644 Binary files a/usr/bin/msys-glib-2.0-0.dll and b/usr/bin/msys-glib-2.0-0.dll differ diff --git a/usr/bin/msys-gmodule-2.0-0.dll b/usr/bin/msys-gmodule-2.0-0.dll index 161de8d8ba1..3d7b4183e37 100644 Binary files a/usr/bin/msys-gmodule-2.0-0.dll and b/usr/bin/msys-gmodule-2.0-0.dll differ diff --git a/usr/bin/msys-gobject-2.0-0.dll b/usr/bin/msys-gobject-2.0-0.dll index fdaad1e320c..26bca30baf8 100644 Binary files a/usr/bin/msys-gobject-2.0-0.dll and b/usr/bin/msys-gobject-2.0-0.dll differ diff --git a/usr/bin/msys-gthread-2.0-0.dll b/usr/bin/msys-gthread-2.0-0.dll index ad74bcb3998..8daa81d95bc 100644 Binary files a/usr/bin/msys-gthread-2.0-0.dll and b/usr/bin/msys-gthread-2.0-0.dll differ diff --git a/usr/bin/rview.exe b/usr/bin/rview.exe index 93d111a7770..70c9866289e 100755 Binary files a/usr/bin/rview.exe and b/usr/bin/rview.exe differ diff --git a/usr/bin/rvim.exe b/usr/bin/rvim.exe index 93d111a7770..70c9866289e 100755 Binary files a/usr/bin/rvim.exe and b/usr/bin/rvim.exe differ diff --git a/usr/bin/view.exe b/usr/bin/view.exe index 93d111a7770..70c9866289e 100755 Binary files a/usr/bin/view.exe and b/usr/bin/view.exe differ diff --git a/usr/bin/vim.exe b/usr/bin/vim.exe index 93d111a7770..70c9866289e 100755 Binary files a/usr/bin/vim.exe and b/usr/bin/vim.exe differ diff --git a/usr/bin/vimdiff.exe b/usr/bin/vimdiff.exe index 93d111a7770..70c9866289e 100755 Binary files a/usr/bin/vimdiff.exe and b/usr/bin/vimdiff.exe differ diff --git a/usr/bin/vimtutor b/usr/bin/vimtutor index 3b154f28831..409c10c0474 100755 --- a/usr/bin/vimtutor +++ b/usr/bin/vimtutor @@ -2,61 +2,195 @@ # Start Vim on a copy of the tutor file. -# Usage: vimtutor [-g] [xx] -# Where optional argument -g starts vimtutor in gvim (GUI) instead of vim. -# and xx is a language code like "es" or "nl". -# When an argument is given, it tries loading that tutor. -# When this fails or no argument was given, it tries using 'v:lang' -# When that also fails, it uses the English version. +# Type "man vimtutor" (or "vimtutor --help") to learn more about the supported +# command-line options. +# +# Tutors in several human languages are distributed. Type "vimtutor" to use +# a tutor in the language of the current locale (:help v:lang), if available; +# otherwise fall back to using the English tutor. To request any bundled +# tutor, specify its ISO639 name as an argument, e.g. "vimtutor nl". # Vim could be called "vim" or "vi". Also check for "vimN", for people who # 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" +seq="vim vim91 vim90 vim81 vim80 vim8 vim74 vim73 vim72 vim71 vim70 vim7 vim6 vi" + +usage() +{ + echo "==USAGE=========================================================================================" + echo "${0##*/} [[-(-l)anguage] ISO639] [-(-c)hapter NUMBER] [-(-g)ui] | [-(-h)elp] | [--list]" + printf "\twhere:\n" + printf "\t\tISO639 (default=en) is a 2 or 3 character language code\n" + printf "\t\tNUMBER (default=1) is a chapter number (1 or 2)\n" + printf "\texamples:\n" + printf "\t\tvimtutor -l es -c 2 -g\n" + printf "\t\tvimtutor --language de --chapter 2\n" + printf "\t\tvimtutor fr\n" + echo "More information at 'man vimtutor'" + echo "================================================================================================" +} + +listOptions() +{ + echo "==OPTIONS=======================================================================================" + echo "Chapter: 1" + printf "\tLang: %-3s => %s\n" \ +bar Bavarian \ +bg Bulgarian \ +ca Catalan \ +cs Czech \ +da Danish \ +de German \ +el Greek \ +en English\(default\) \ +eo Esperanto \ +es Spanish \ +fr French \ +hr Croatian \ +hu Hungarian \ +it Italian \ +ja Japanese \ +ko Korean \ +lv Latvian \ +nb Bokmål \ +nl Dutch \ +no Norwegian \ +pl Polish \ +pt Portuguese \ +ru Russian \ +sk Slovak \ +sr Serbian \ +sv Swedish \ +tr Turkish \ +uk English \ +vi Vietnamese \ +zh Chinese + + echo "Chapter: 2" + printf "\tLang: %-3s => %s\n" \ +en English\(default\) + echo "================================================================================================" +} + +validateLang() +{ + case "$xx" in + '' | *[!a-z]* ) + echo "Error: iso639 code must contain only [a-z]" + exit 1 + esac + + case "${#xx}" in + [23] ) + ;; + * ) + echo "Error: iso639 code must be 2 or 3 characters only" + exit 1 + esac + + export xx +} + +validateChapter() +{ + case "$cc" in + '' | *[!0-9]* ) + echo "Error: chapter argument must contain digits only" + exit 1 + ;; + [12] ) + ;; + * ) + echo "Error: invalid chapter number: [12]" + exit 1 + esac + + export CHAPTER="$cc" +} + +while [ "$1" != "" ]; do + case "$1" in + -g | --gui ) + seq="gvim gvim91 gvim90 gvim81 gvim80 gvim8 gvim74 gvim73 gvim72 gvim71 gvim70 gvim7 gvim6 $seq" + ;; + -l | --language ) + shift + xx="$1" + validateLang + ;; + -l[a-z][a-z][a-z] | -l[a-z][a-z] ) + export xx="${1#*l}" + ;; + --language[a-z][a-z][a-z] | --language[a-z][a-z] ) + export xx="${1#*e}" + ;; + [a-z][a-z][a-z] | [a-z][a-z] ) + export xx="$1" + ;; + -c | --chapter ) + shift + cc="$1" + validateChapter + ;; + -c[12] ) + export CHAPTER="${1#*c}" + ;; + --chapter[12] ) + export CHAPTER="${1#*r}" + ;; + -h | --help ) + usage + exit + ;; + --list ) + listOptions + exit + ;; + "" ) + ;; + * ) + usage + exit 1 + esac + shift -fi +done -xx=$1 -export xx # We need a temp file for the copy. First try using a standard command. tmp="${TMPDIR-/tmp}" -TUTORCOPY=`mktemp $tmp/tutorXXXXXX || tempfile -p tutor || echo none` +# shellcheck disable=SC2186 +TUTORCOPY=$(mktemp "$tmp/tutorXXXXXX" || tempfile -p tutor || echo none) # If the standard commands failed then create a directory to put the copy in. # That is a secure way to make a temp file. if test "$TUTORCOPY" = none; then - tmpdir=$tmp/vimtutor$$ - OLD_UMASK=`umask` - umask 077 - getout=no - mkdir $tmpdir || getout=yes - umask $OLD_UMASK - if test $getout = yes; then - echo "Could not create directory for tutor copy, exiting." - exit 1 - fi - TUTORCOPY=$tmpdir/tutorcopy - touch $TUTORCOPY - TODELETE=$tmpdir + tmpdir="$tmp/vimtutor$$" + OLD_UMASK=$(umask) + umask 077 + getout=no + mkdir "$tmpdir" || getout=yes + umask "$OLD_UMASK" + if test "$getout" = yes; then + echo "Could not create directory for tutor copy, exiting." + exit 1 + fi + TUTORCOPY="$tmpdir/tutorcopy" + touch "$TUTORCOPY" + TODELETE="$tmpdir" else - TODELETE=$TUTORCOPY + TODELETE="$TUTORCOPY" fi export TUTORCOPY # remove the copy of the tutor on exit -trap "rm -rf $TODELETE" 0 1 2 3 9 11 13 15 +trap 'rm -rf "$TODELETE"' EXIT HUP INT QUIT SEGV PIPE TERM for i in $seq; do - testvim=$(which $i 2>/dev/null) + testvim=$(command -v "$i" 2>/dev/null) if test -f "$testvim"; then - VIM=$i - break + VIM="$i" + break fi done @@ -68,7 +202,10 @@ fi # Use Vim to copy the tutor, it knows the value of $VIMRUNTIME # The script tutor.vim tells Vim which file to copy -$VIM -f -u NONE -c 'so $VIMRUNTIME/tutor/tutor.vim' + +$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:sw=4:ts=8:noet:nosta: diff --git a/usr/bin/xxd.exe b/usr/bin/xxd.exe index 7eab5fc8eef..1bfed6f085a 100755 Binary files a/usr/bin/xxd.exe and b/usr/bin/xxd.exe differ diff --git a/usr/libexec/gio-launch-desktop.exe b/usr/libexec/gio-launch-desktop.exe index 0cf2892cfda..22452423591 100644 Binary files a/usr/libexec/gio-launch-desktop.exe and b/usr/libexec/gio-launch-desktop.exe differ diff --git a/usr/share/licenses/diffstat/LICENSE b/usr/share/licenses/diffstat/LICENSE index d681f2ca817..46cca434545 100644 --- a/usr/share/licenses/diffstat/LICENSE +++ b/usr/share/licenses/diffstat/LICENSE @@ -2,54 +2,33 @@ Upstream source http://invisible-island.net/diffstat/diffstat.html /****************************************************************************** * Copyright 1994-2023,2024 by Thomas E. Dickey * - * All Rights Reserved. * * * - * Permission to use, copy, modify, and distribute this software and its * - * documentation for any purpose and without fee is hereby granted, provided * - * that the above copyright notice appear in all copies and that both that * - * copyright notice and this permission notice appear in supporting * - * documentation, and that the name of the above listed copyright holder(s) * - * not be used in advertising or publicity pertaining to distribution of the * - * software without specific, written prior permission. * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the "Software"), * + * to deal in the Software without restriction, including without limitation * + * the rights to use, copy, modify, merge, publish, distribute, sublicense, * + * and/or sell copies of the Software, and to permit persons to whom the * + * Software is furnished to do so, subject to the following conditions: * * * - * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD * - * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * - * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE * - * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR * - * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * + * The above copyright notice and this permission notice shall be included in * + * all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * + * THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * + * DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the sale, * + * use or other dealings in this Software without prior written * + * authorization. * ******************************************************************************/ ------------------------------------------------------------------------------- -Files: aclocal.m4 -Licence: other-BSD -Copyright: 2003-2023,2024 by Thomas E. Dickey - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, distribute with modifications, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR - THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name(s) of the above copyright - holders shall not be used in advertising or otherwise to promote the - sale, use or other dealings in this Software without prior written - authorization. - Files: install-sh Copyright: 1994 X Consortium Licence: other-BSD @@ -86,24 +65,30 @@ Licence: other-BSD shared with many OS's install programs. Files: debian/* -Copyright: 2010-2019,2021 Thomas E. Dickey +Copyright: 2010-2021,2024 Thomas E. Dickey Licence: other-BSD - Permission to use, copy, modify, and distribute this software and its - documentation for any purpose and without fee is hereby granted, - provided that the above copyright notice appear in all copies and that - both that copyright notice and this permission notice appear in - supporting documentation, and that the name of the above listed - copyright holder(s) not be used in advertising or publicity pertaining - to distribution of the software without specific, written prior - permission. + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: - THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD - TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE - LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the name(s) of the above copyright + holders shall not be used in advertising or otherwise to promote the sale, + use or other dealings in this Software without prior written + authorization. On Debian systems, the complete text of the GNU General Public License can be found in '/usr/share/common-licenses/GPL-2' diff --git a/usr/share/man/it.ISO8859-1/man1/vimtutor.1.gz b/usr/share/man/it.ISO8859-1/man1/vimtutor.1.gz index a6aed843e45..8658119889b 100644 Binary files a/usr/share/man/it.ISO8859-1/man1/vimtutor.1.gz and b/usr/share/man/it.ISO8859-1/man1/vimtutor.1.gz differ diff --git a/usr/share/man/it.UTF-8/man1/vimtutor.1.gz b/usr/share/man/it.UTF-8/man1/vimtutor.1.gz index e2198bdbad5..e4abdf64152 100644 Binary files a/usr/share/man/it.UTF-8/man1/vimtutor.1.gz and b/usr/share/man/it.UTF-8/man1/vimtutor.1.gz differ diff --git a/usr/share/man/it/man1/vimtutor.1.gz b/usr/share/man/it/man1/vimtutor.1.gz index a6aed843e45..8658119889b 100644 Binary files a/usr/share/man/it/man1/vimtutor.1.gz and b/usr/share/man/it/man1/vimtutor.1.gz differ diff --git a/usr/share/man/man1/diffstat.1.gz b/usr/share/man/man1/diffstat.1.gz index c92540e8142..a08965a1e4e 100644 Binary files a/usr/share/man/man1/diffstat.1.gz and b/usr/share/man/man1/diffstat.1.gz differ diff --git a/usr/share/man/man1/vimtutor.1.gz b/usr/share/man/man1/vimtutor.1.gz index fc7036ff5e5..b4313debca5 100644 Binary files a/usr/share/man/man1/vimtutor.1.gz and b/usr/share/man/man1/vimtutor.1.gz differ diff --git a/usr/share/vim/vim91/autoload/dist/ft.vim b/usr/share/vim/vim91/autoload/dist/ft.vim index c8942eb3d11..214cf6e3ec4 100644 --- a/usr/share/vim/vim91/autoload/dist/ft.vim +++ b/usr/share/vim/vim91/autoload/dist/ft.vim @@ -169,6 +169,14 @@ export def FTcls() endif enddef +export def FTll() + if getline(1) =~ ';\|\\|\' + setf llvm + else + setf lifelines + endif +enddef + export def FTlpc() if exists("g:lpc_syntax_for_c") var lnum = 1 diff --git a/usr/share/vim/vim91/autoload/dist/vimindent.vim b/usr/share/vim/vim91/autoload/dist/vimindent.vim index 07b21538e14..727e98352cc 100644 --- a/usr/share/vim/vim91/autoload/dist/vimindent.vim +++ b/usr/share/vim/vim91/autoload/dist/vimindent.vim @@ -2,10 +2,11 @@ vim9script # Language: Vim script # Maintainer: github user lacygoill -# Last Change: 2023 Jun 29 +# Last Change: 2024 Nov 08 # -# Includes Changes from Vim: +# Includes changes from The Vim Project: # - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966) +# - 2024 Nov 08: Fix indent after :silent! function (D. Kearns via #16009) # NOTE: Whenever you change the code, make sure the tests are still passing: # @@ -295,7 +296,7 @@ patterns = [] endfor } -const STARTS_NAMED_BLOCK: string = $'^\s*\%(sil\%[ent]\s\+\)\=\%({patterns->join('\|')}\)\>\%(\s\|$\|!\)\@=' +const STARTS_NAMED_BLOCK: string = $'^\s*\%(sil\%[ent]!\=\s\+\)\=\%({patterns->join('\|')}\)\>\%(\s\|$\|!\)\@=' # STARTS_CURLY_BLOCK {{{3 diff --git a/usr/share/vim/vim91/autoload/getscript.vim b/usr/share/vim/vim91/autoload/getscript.vim index dced99cc465..39060508bff 100644 --- a/usr/share/vim/vim91/autoload/getscript.vim +++ b/usr/share/vim/vim91/autoload/getscript.vim @@ -11,6 +11,7 @@ " 2024 Sep 23 by Vim Project: runtime dir selection fix (#15722) " autoloading search path fix " substitution of hardcoded commands with global variables +" 2024 Nov 12 by Vim Project: fix problems on Windows (#16036) " }}} " " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim @@ -27,9 +28,9 @@ if &cp echoerr "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)" finish endif -if v:version < 702 +if v:version < 901 echohl WarningMsg - echo "***warning*** this version of GetLatestVimScripts needs vim 7.2" + echo "***warning*** this version of GetLatestVimScripts needs vim 9.1" echohl Normal finish endif @@ -57,6 +58,9 @@ endif if !exists("g:GetLatestVimScripts_wget") if executable("wget") let g:GetLatestVimScripts_wget= "wget" + elseif executable("curl.exe") + " enforce extension: windows powershell desktop version has a curl alias that hides curl.exe + let g:GetLatestVimScripts_wget= "curl.exe" elseif executable("curl") let g:GetLatestVimScripts_wget= "curl" else @@ -69,7 +73,7 @@ endif if !exists("g:GetLatestVimScripts_options") if g:GetLatestVimScripts_wget == "wget" let g:GetLatestVimScripts_options= "-q -O" - elseif g:GetLatestVimScripts_wget == "curl" + elseif g:GetLatestVimScripts_wget =~ "curl" let g:GetLatestVimScripts_options= "-s -o" else let g:GetLatestVimScripts_options= "" @@ -121,11 +125,14 @@ if g:GetLatestVimScripts_allowautoinstall let s:dotvim= s:is_windows ? "vimfiles" : ".vim" if !exists("g:GetLatestVimScripts_mv") - if s:is_windows && &shell !~ '\cbash\|pwsh\|powershell' + if &shell =~? '\\|\' + let g:GetLatestVimScripts_mv= "move -Force" + elseif s:is_windows && &shell =~? '\' " windows (but not cygwin/bash) - let g:GetLatestVimScripts_mv= "move" + let g:GetLatestVimScripts_mv= "move /Y" else - " unix + " unix or cygwin bash/zsh + " 'mv' overrides existing files without asking let g:GetLatestVimScripts_mv= "mv" endif endif @@ -160,12 +167,6 @@ fun! getscript#GetLatestVimScripts() return endif - " insure that fnameescape() is available - if !exists("*fnameescape") - echoerr "GetLatestVimScripts needs fnameescape() (provided by 7.1.299 or later)" - return - endif - " Find the .../GetLatest subdirectory under the runtimepath for datadir in split(&rtp,',') + [''] if isdirectory(datadir."/GetLatest") @@ -377,7 +378,16 @@ fun! s:GetOneScript(...) let t_ti= &t_ti let t_te= &t_te let rs = &rs + let ssl = &ssl + set t_ti= t_te= nors + " avoid issues with shellescape() on Windows + if s:is_windows && &shell =~? '\' + set noshellslash + endif + + " restore valures afterwards + defer execute("let @a = rega | let &t_ti = t_ti | let &t_te = t_te | let &rs = rs | let &ssl = ssl") " put current line on top-of-screen and interpret it into " a script identifier : used to obtain webpage @@ -394,7 +404,6 @@ fun! s:GetOneScript(...) else let curline = getline(".") if curline =~ '^\s*#' - let @a= rega " call Dret("GetOneScript : skipping a pure comment line") return endif @@ -429,7 +438,6 @@ fun! s:GetOneScript(...) " plugin author protection from downloading his/her own scripts atop their latest work if scriptid == 0 || srcid == 0 " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname - let @a= rega " call Dret("GetOneScript : skipping a scriptid==srcid==0 line") return endif @@ -497,7 +505,6 @@ fun! s:GetOneScript(...) " call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">" " call Dret("GetOneScript : srch for /Click on the package/ failed") - let @a= rega return endif " call Decho('found "Click on the package to download"') @@ -513,7 +520,6 @@ fun! s:GetOneScript(...) let s:downerrors = s:downerrors + 1 " call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">" - let @a= rega " call Dret("GetOneScript : srch for /src_id/ failed") return endif @@ -547,11 +553,11 @@ fun! s:GetOneScript(...) " call Decho(".downloading new <".sname.">") echomsg ".downloading new <".sname.">" if has("win32") || has("win16") || has("win95") -" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)."|q") - new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)|q +" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)."|bw!") + new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)|bw! else -" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr).latestsrcid - exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr).latestsrcid +" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid) + exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid) endif " -------------------------------------------------------------------------- @@ -654,8 +660,8 @@ fun! s:GetOneScript(...) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".installdir endif if tgtdir != "plugin" -" call Decho("exe silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir) - exe "silent !".g:GetLatestVimScripts_mv." plugin/".shellescape(pname)." ".tgtdir +" call Decho("exe silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir) + exe "silent !".g:GetLatestVimScripts_mv." ".shellescape("plugin/".pname)." ".tgtdir endif " helptags step @@ -680,13 +686,7 @@ fun! s:GetOneScript(...) " call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."], no need to update") endif - " restore options - let &t_ti = t_ti - let &t_te = t_te - let &rs = rs - let @a = rega " call Dredir("BUFFER TEST (GetOneScript)","ls!") - " call Dret("GetOneScript") endfun diff --git a/usr/share/vim/vim91/autoload/netrw.vim b/usr/share/vim/vim91/autoload/netrw.vim index d09299a5831..89aad816f8c 100644 --- a/usr/share/vim/vim91/autoload/netrw.vim +++ b/usr/share/vim/vim91/autoload/netrw.vim @@ -4,8 +4,8 @@ " Date: May 03, 2023 " Version: 173a " Last Change: {{{1 -" 2023 Nov 21 by Vim Project: ignore wildignore when expanding $COMSPEC (v173a) -" 2023 Nov 22 by Vim Project: fix handling of very long filename on longlist style (v173a) +" 2023 Nov 21 by Vim Project: ignore wildignore when expanding $COMSPEC (v173a) +" 2023 Nov 22 by Vim Project: fix handling of very long filename on longlist style (v173a) " 2024 Feb 19 by Vim Project: (announce adoption) " 2024 Feb 29 by Vim Project: handle symlinks in tree mode correctly " 2024 Apr 03 by Vim Project: detect filetypes for remote edited files @@ -26,6 +26,16 @@ " 2024 Sep 15 by Vim Project: more strict confirmation dialog (#15680) " 2024 Sep 19 by Vim Project: mf-selection highlight uses wrong pattern (#15700) " 2024 Sep 21 by Vim Project: remove extraneous closing bracket (#15718) +" 2024 Oct 21 by Vim Project: remove netrwFileHandlers (#15895) +" 2024 Oct 27 by Vim Project: clean up gx mapping (#15721) +" 2024 Oct 30 by Vim Project: fix filetype detection for remote files (#15961) +" 2024 Oct 30 by Vim Project: fix x mapping on cygwin (#13687) +" 2024 Oct 31 by Vim Project: add netrw#Launch() and netrw#Open() (#15962) +" 2024 Oct 31 by Vim Project: fix E874 when browsing remote dir (#15964) +" 2024 Nov 07 by Vim Project: use keeppatterns to prevent polluting the search history +" 2024 Nov 07 by Vim Project: fix a few issues with netrw tree listing (#15996) +" 2024 Nov 10 by Vim Project: directory symlink not resolved in tree view (#16020) +" 2024 Nov 14 by Vim Project: small fixes to netrw#BrowseX (#16056) " }}} " Former Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim @@ -537,7 +547,6 @@ if !exists("g:netrw_sort_sequence") endif call s:NetrwInit("g:netrw_special_syntax" , 0) call s:NetrwInit("g:netrw_ssh_browse_reject", '^total\s\+\d\+$') -call s:NetrwInit("g:netrw_suppress_gx_mesg", 1) call s:NetrwInit("g:netrw_use_noswf" , 1) call s:NetrwInit("g:netrw_sizestyle" ,"b") " Default values - t-w ---------- {{{3 @@ -677,11 +686,8 @@ endif " == 4: Vexplore style == 5: Vexplore! " == 6: Texplore fun! netrw#Explore(indx,dosplit,style,...) -" call Dfunc("netrw#Explore(indx=".a:indx." dosplit=".a:dosplit." style=".a:style.",a:1<".a:1.">) &modified=".&modified." modifiable=".&modifiable." a:0=".a:0." win#".winnr()." buf#".bufnr("%")." ft=".&ft) -" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) if !exists("b:netrw_curdir") let b:netrw_curdir= getcwd() -" call Decho("set b:netrw_curdir<".b:netrw_curdir."> (used getcwd)",'~'.expand("")) endif " record current file for Rexplore's benefit @@ -695,17 +701,11 @@ fun! netrw#Explore(indx,dosplit,style,...) if !exists("g:netrw_cygwin") && has("win32") let curdir= substitute(curdir,'\','/','g') endif -" call Decho("curdir<".curdir."> curfiledir<".curfiledir.">",'~'.expand("")) " using completion, directories with spaces in their names (thanks, Bill Gates, for a truly dumb idea) " will end up with backslashes here. Solution: strip off backslashes that precede white space and " try Explore again. if a:0 > 0 -" call Decho('considering retry: a:1<'.a:1.'>: '. - \ ((a:1 =~ "\\\s")? 'has backslash whitespace' : 'does not have backslash whitespace').', '. - \ ((filereadable(s:NetrwFile(a:1)))? 'is readable' : 'is not readable').', '. - \ ((isdirectory(s:NetrwFile(a:1))))? 'is a directory' : 'is not a directory', - \ '~'.expand("")) if a:1 =~ "\\\s" && !filereadable(s:NetrwFile(a:1)) && !isdirectory(s:NetrwFile(a:1)) let a1 = substitute(a:1, '\\\(\s\)', '\1', 'g') if a1 != a:1 @@ -773,64 +773,45 @@ fun! netrw#Explore(indx,dosplit,style,...) NetrwKeepj norm! 0 if a:0 > 0 -" call Decho("case [a:0=".a:0."] > 0: a:1<".a:1.">",'~'.expand("")) if a:1 =~ '^\~' && (has("unix") || (exists("g:netrw_cygwin") && g:netrw_cygwin)) -" call Decho("..case a:1<".a:1.">: starts with ~ and unix or cygwin",'~'.expand("")) let dirname= simplify(substitute(a:1,'\~',expand("$HOME"),'')) -" call Decho("..using dirname<".dirname."> (case: ~ && unix||cygwin)",'~'.expand("")) elseif a:1 == '.' -" call Decho("..case a:1<".a:1.">: matches .",'~'.expand("")) let dirname= simplify(exists("b:netrw_curdir")? b:netrw_curdir : getcwd()) if dirname !~ '/$' let dirname= dirname."/" endif -" call Decho("..using dirname<".dirname."> (case: ".(exists("b:netrw_curdir")? "b:netrw_curdir" : "getcwd()").")",'~'.expand("")) elseif a:1 =~ '\$' -" call Decho("..case a:1<".a:1.">: matches ending $",'~'.expand("")) let dirname= simplify(expand(a:1)) -" call Decho("..using user-specified dirname<".dirname."> with $env-var",'~'.expand("")) elseif a:1 !~ '^\*\{1,2}/' && a:1 !~ '^\a\{3,}://' -" call Decho("..case a:1<".a:1.">: other, not pattern or filepattern",'~'.expand("")) let dirname= simplify(a:1) -" call Decho("..using user-specified dirname<".dirname.">",'~'.expand("")) else -" call Decho("..case a:1: pattern or filepattern",'~'.expand("")) let dirname= a:1 endif else " clear explore -" call Decho("case a:0=".a:0.": clearing Explore list",'~'.expand("")) call s:NetrwClearExplore() -" call Dret("netrw#Explore : cleared list") return endif -" call Decho("dirname<".dirname.">",'~'.expand("")) if dirname =~ '\.\./\=$' let dirname= simplify(fnamemodify(dirname,':p:h')) elseif dirname =~ '\.\.' || dirname == '.' let dirname= simplify(fnamemodify(dirname,':p')) endif -" call Decho("dirname<".dirname."> (after simplify)",'~'.expand("")) if dirname =~ '^\*//' " starpat=1: Explore *//pattern (current directory only search for files containing pattern) -" call Decho("case starpat=1: Explore *//pattern",'~'.expand("")) let pattern= substitute(dirname,'^\*//\(.*\)$','\1','') let starpat= 1 -" call Decho("..Explore *//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">",'~'.expand("")) if &hls | let keepregslash= s:ExplorePatHls(pattern) | endif elseif dirname =~ '^\*\*//' " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) -" call Decho("case starpat=2: Explore **//pattern",'~'.expand("")) let pattern= substitute(dirname,'^\*\*//','','') let starpat= 2 -" call Decho("..Explore **//pat: (starpat=".starpat.") dirname<".dirname."> -> pattern<".pattern.">",'~'.expand("")) elseif dirname =~ '/\*\*/' " handle .../**/.../filepat -" call Decho("case starpat=4: Explore .../**/.../filepat",'~'.expand("")) let prefixdir= substitute(dirname,'^\(.\{-}\)\*\*.*$','\1','') if prefixdir =~ '^/' || (prefixdir =~ '^\a:/' && has("win32")) let b:netrw_curdir = prefixdir @@ -839,30 +820,23 @@ fun! netrw#Explore(indx,dosplit,style,...) endif let dirname= substitute(dirname,'^.\{-}\(\*\*/.*\)$','\1','') let starpat= 4 -" call Decho("..pwd<".getcwd()."> dirname<".dirname.">",'~'.expand("")) -" call Decho("..case Explore ../**/../filepat (starpat=".starpat.")",'~'.expand("")) elseif dirname =~ '^\*/' " case starpat=3: Explore */filepat (search in current directory for filenames matching filepat) let starpat= 3 -" call Decho("case starpat=3: Explore */filepat (starpat=".starpat.")",'~'.expand("")) elseif dirname=~ '^\*\*/' " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) let starpat= 4 -" call Decho("case starpat=4: Explore **/filepat (starpat=".starpat.")",'~'.expand("")) else let starpat= 0 -" call Decho("case starpat=0: default",'~'.expand("")) endif if starpat == 0 && a:indx >= 0 " [Explore Hexplore Vexplore Sexplore] [dirname] -" call Decho("case starpat==0 && a:indx=".a:indx.": dirname<".dirname.">, handles Explore Hexplore Vexplore Sexplore",'~'.expand("")) if dirname == "" let dirname= curfiledir -" call Decho("..empty dirname, using current file's directory<".dirname.">",'~'.expand("")) endif if dirname =~# '^scp://' || dirname =~ '^ftp://' call netrw#Nread(2,dirname) @@ -878,10 +852,7 @@ fun! netrw#Explore(indx,dosplit,style,...) elseif dirname !~ '^/' let dirname= b:netrw_curdir."/".dirname endif -" call Decho("..calling LocalBrowseCheck(dirname<".dirname.">)",'~'.expand("")) call netrw#LocalBrowseCheck(dirname) -" call Decho(" modified=".&modified." modifiable=".&modifiable." readonly=".&readonly,'~'.expand("")) -" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) endif if exists("w:netrw_bannercnt") " done to handle P08-Ingelrest. :Explore will _Always_ go to the line just after the banner. @@ -889,15 +860,6 @@ fun! netrw#Explore(indx,dosplit,style,...) exe w:netrw_bannercnt endif -" call Decho("curdir<".curdir.">",'~'.expand("")) - " --------------------------------------------------------------------- - " Jan 24, 2013: not sure why the following was present. See P08-Ingelrest -" if has("win32") || has("win95") || has("win64") || has("win16") -" NetrwKeepj call search('\<'.substitute(curdir,'^.*[/\\]','','e').'\>','cW') -" else -" NetrwKeepj call search('\<'.substitute(curdir,'^.*/','','e').'\>','cW') -" endif - " --------------------------------------------------------------------- " starpat=1: Explore *//pattern (current directory only search for files containing pattern) " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) @@ -905,96 +867,75 @@ fun! netrw#Explore(indx,dosplit,style,...) " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) elseif a:indx <= 0 " Nexplore, Pexplore, Explore: handle starpat -" call Decho("case a:indx<=0: Nexplore, Pexplore, , starpat=".starpat." a:indx=".a:indx,'~'.expand("")) if !mapcheck("","n") && !mapcheck("","n") && exists("b:netrw_curdir") -" call Decho("..set up and maps",'~'.expand("")) let s:didstarstar= 1 nnoremap :Pexplore nnoremap :Nexplore endif if has("path_extra") -" call Decho("..starpat=".starpat.": has +path_extra",'~'.expand("")) if !exists("w:netrw_explore_indx") let w:netrw_explore_indx= 0 endif let indx = a:indx -" call Decho("..starpat=".starpat.": set indx= [a:indx=".indx."]",'~'.expand("")) if indx == -1 " Nexplore -" call Decho("..case Nexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("")) if !exists("w:netrw_explore_list") " sanity check NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Nexplore or improperly; see help for netrw-starstar",40) if has("clipboard") && g:netrw_clipboard -" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) if @* != keepregstar | sil! let @* = keepregstar | endif if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash -" call Dret("netrw#Explore") return endif let indx= w:netrw_explore_indx if indx < 0 | let indx= 0 | endif if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif let curfile= w:netrw_explore_list[indx] -" call Decho("....indx=".indx." curfile<".curfile.">",'~'.expand("")) while indx < w:netrw_explore_listlen && curfile == w:netrw_explore_list[indx] let indx= indx + 1 -" call Decho("....indx=".indx." (Nexplore while loop)",'~'.expand("")) endwhile if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif -" call Decho("....Nexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx,'~'.expand("")) elseif indx == -2 " Pexplore -" call Decho("case Pexplore with starpat=".starpat.": (indx=".indx.")",'~'.expand("")) if !exists("w:netrw_explore_list") " sanity check NetrwKeepj call netrw#ErrorMsg(s:WARNING,"using Pexplore or improperly; see help for netrw-starstar",41) if has("clipboard") && g:netrw_clipboard -" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) if @* != keepregstar | sil! let @* = keepregstar | endif if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash -" call Dret("netrw#Explore") return endif let indx= w:netrw_explore_indx if indx < 0 | let indx= 0 | endif if indx >= w:netrw_explore_listlen | let indx= w:netrw_explore_listlen - 1 | endif let curfile= w:netrw_explore_list[indx] -" call Decho("....indx=".indx." curfile<".curfile.">",'~'.expand("")) while indx >= 0 && curfile == w:netrw_explore_list[indx] let indx= indx - 1 -" call Decho("....indx=".indx." (Pexplore while loop)",'~'.expand("")) endwhile if indx < 0 | let indx= 0 | endif -" call Decho("....Pexplore: indx= [w:netrw_explore_indx=".w:netrw_explore_indx."]=".indx,'~'.expand("")) else " Explore -- initialize " build list of files to Explore with Nexplore/Pexplore -" call Decho("..starpat=".starpat.": case Explore: initialize (indx=".indx.")",'~'.expand("")) NetrwKeepj keepalt call s:NetrwClearExplore() let w:netrw_explore_indx= 0 if !exists("b:netrw_curdir") let b:netrw_curdir= getcwd() endif -" call Decho("....starpat=".starpat.": b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("")) " switch on starpat to build the w:netrw_explore_list of files if starpat == 1 " starpat=1: Explore *//pattern (current directory only search for files containing pattern) -" call Decho("..case starpat=".starpat.": build *//pattern list (curdir-only srch for files containing pattern) &hls=".&hls,'~'.expand("")) -" call Decho("....pattern<".pattern.">",'~'.expand("")) try exe "NetrwKeepj noautocmd vimgrep /".pattern."/gj ".fnameescape(b:netrw_curdir)."/*" catch /^Vim\%((\a\+)\)\=:E480/ keepalt call netrw#ErrorMsg(s:WARNING,"no match with pattern<".pattern.">",76) -" call Dret("netrw#Explore : unable to find pattern<".pattern.">") return endtry let w:netrw_explore_list = s:NetrwExploreListUniq(map(getqflist(),'bufname(v:val.bufnr)')) @@ -1002,20 +943,16 @@ fun! netrw#Explore(indx,dosplit,style,...) elseif starpat == 2 " starpat=2: Explore **//pattern (recursive descent search for files containing pattern) -" call Decho("..case starpat=".starpat.": build **//pattern list (recursive descent files containing pattern)",'~'.expand("")) -" call Decho("....pattern<".pattern.">",'~'.expand("")) try exe "sil NetrwKeepj noautocmd keepalt vimgrep /".pattern."/gj "."**/*" 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") && g:netrw_clipboard -" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) if @* != keepregstar | sil! let @* = keepregstar | endif if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash -" call Dret("netrw#Explore : no files matched pattern") return endtry let s:netrw_curdir = b:netrw_curdir @@ -1025,56 +962,43 @@ fun! netrw#Explore(indx,dosplit,style,...) elseif starpat == 3 " starpat=3: Explore */filepat (search in current directory for filenames matching filepat) -" call Decho("..case starpat=".starpat.": build */filepat list (curdir-only srch filenames matching filepat) &hls=".&hls,'~'.expand("")) let filepat= substitute(dirname,'^\*/','','') let filepat= substitute(filepat,'^[%#<]','\\&','') -" call Decho("....b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("")) -" call Decho("....filepat<".filepat.">",'~'.expand("")) let w:netrw_explore_list= s:NetrwExploreListUniq(split(expand(b:netrw_curdir."/".filepat),'\n')) if &hls | let keepregslash= s:ExplorePatHls(filepat) | endif elseif starpat == 4 " starpat=4: Explore **/filepat (recursive descent search for filenames matching filepat) -" call Decho("..case starpat=".starpat.": build **/filepat list (recursive descent srch filenames matching filepat) &hls=".&hls,'~'.expand("")) let w:netrw_explore_list= s:NetrwExploreListUniq(split(expand(b:netrw_curdir."/".dirname),'\n')) if &hls | let keepregslash= s:ExplorePatHls(dirname) | endif endif " switch on starpat to build w:netrw_explore_list let w:netrw_explore_listlen = len(w:netrw_explore_list) -" call Decho("....w:netrw_explore_list<".string(w:netrw_explore_list).">",'~'.expand("")) -" call Decho("....w:netrw_explore_listlen=".w:netrw_explore_listlen,'~'.expand("")) 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") && g:netrw_clipboard -" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) if @* != keepregstar | sil! let @* = keepregstar | endif if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash -" call Dret("netrw#Explore : no files matched") return endif endif " if indx ... endif " NetrwStatusLine support - for exploring support let w:netrw_explore_indx= indx -" call Decho("....w:netrw_explore_list<".join(w:netrw_explore_list,',')."> len=".w:netrw_explore_listlen,'~'.expand("")) " wrap the indx around, but issue a note if indx >= w:netrw_explore_listlen || indx < 0 -" call Decho("....wrap indx (indx=".indx." listlen=".w:netrw_explore_listlen.")",'~'.expand("")) let indx = (indx < 0)? ( w:netrw_explore_listlen - 1 ) : 0 let w:netrw_explore_indx= indx keepalt NetrwKeepj call netrw#ErrorMsg(s:NOTE,"no more files match Explore pattern",43) endif exe "let dirfile= w:netrw_explore_list[".indx."]" -" call Decho("....dirfile=w:netrw_explore_list[indx=".indx."]= <".dirfile.">",'~'.expand("")) let newdir= substitute(dirfile,'/[^/]*$','','e') -" call Decho("....newdir<".newdir.">",'~'.expand("")) -" call Decho("....calling LocalBrowseCheck(newdir<".newdir.">)",'~'.expand("")) call netrw#LocalBrowseCheck(newdir) if !exists("w:netrw_liststyle") let w:netrw_liststyle= g:netrw_liststyle @@ -1088,25 +1012,20 @@ fun! netrw#Explore(indx,dosplit,style,...) let w:netrw_explore_bufnr = bufnr("%") let w:netrw_explore_line = line(".") keepalt NetrwKeepj call s:SetupNetrwStatusLine('%f %h%m%r%=%9*%{NetrwStatusLine()}') -" call Decho("....explore: mtchcnt=".w:netrw_explore_mtchcnt." bufnr=".w:netrw_explore_bufnr." line#".w:netrw_explore_line,'~'.expand("")) else -" call Decho("..your vim does not have +path_extra",'~'.expand("")) 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") && g:netrw_clipboard -" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) if @* != keepregstar | sil! let @* = keepregstar | endif if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash -" call Dret("netrw#Explore : missing +path_extra") return endif else -" call Decho("..default case: Explore newdir<".dirname.">",'~'.expand("")) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && dirname =~ '/' sil! unlet w:netrw_treedict sil! unlet w:netrw_treetop @@ -1115,18 +1034,14 @@ fun! netrw#Explore(indx,dosplit,style,...) if !exists("b:netrw_curdir") NetrwKeepj call netrw#LocalBrowseCheck(getcwd()) else - NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir)) + NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,newdir,0)) endif endif " visual display of **/ **// */ Exploration files -" call Decho("w:netrw_explore_indx=".(exists("w:netrw_explore_indx")? w:netrw_explore_indx : "doesn't exist"),'~'.expand("")) -" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "n/a").">",'~'.expand("")) if exists("w:netrw_explore_indx") && exists("b:netrw_curdir") -" call Decho("s:explore_prvdir<".(exists("s:explore_prvdir")? s:explore_prvdir : "-doesn't exist-"),'~'.expand("")) if !exists("s:explore_prvdir") || s:explore_prvdir != b:netrw_curdir " only update match list when current directory isn't the same as before -" call Decho("only update match list when current directory not the same as before",'~'.expand("")) let s:explore_prvdir = b:netrw_curdir let s:explore_match = "" let dirlen = strlen(b:netrw_curdir) @@ -1135,7 +1050,6 @@ fun! netrw#Explore(indx,dosplit,style,...) endif let prvfname= "" for fname in w:netrw_explore_list -" call Decho("fname<".fname.">",'~'.expand("")) if fname =~ '^'.b:netrw_curdir if s:explore_match == "" let s:explore_match= '\<'.escape(strpart(fname,dirlen),g:netrw_markfileesc).'\>' @@ -1151,7 +1065,6 @@ fun! netrw#Explore(indx,dosplit,style,...) endif let prvfname= fname endfor -" call Decho("explore_match<".s:explore_match.">",'~'.expand("")) if has("syntax") && exists("g:syntax_on") && g:syntax_on exe "2match netrwMarkFile /".s:explore_match."/" endif @@ -1161,7 +1074,6 @@ fun! netrw#Explore(indx,dosplit,style,...) 2match none if exists("s:explore_match") | unlet s:explore_match | endif if exists("s:explore_prvdir") | unlet s:explore_prvdir | endif -" call Decho("cleared explore match list",'~'.expand("")) endif " since Explore may be used to initialize netrw's browser, @@ -1169,12 +1081,10 @@ fun! netrw#Explore(indx,dosplit,style,...) " Consequently, set s:netrw_events to 2. let s:netrw_events= 2 if has("clipboard") && g:netrw_clipboard -" call Decho("(netrw#Explore) restore @* and @+",'~'.expand("")) if @* != keepregstar | sil! let @* = keepregstar | endif if @+ != keepregplus | sil! let @+ = keepregplus | endif endif sil! let @/ = keepregslash -" call Dret("netrw#Explore : @/<".@/.">") endfun " --------------------------------------------------------------------- @@ -1192,47 +1102,35 @@ fun! netrw#Lexplore(count,rightside,...) " if a netrw window is already on the left-side of the tab " and a directory has been specified, explore with that " directory. -" call Decho("case has input argument(s) (a:1<".a:1.">)") let a1 = expand(a:1) -" call Decho("a:1<".a:1."> curwin#".curwin,'~'.expand("")) exe "1wincmd w" if &ft == "netrw" -" call Decho("exe Explore ".fnameescape(a:1),'~'.expand("")) exe "Explore ".fnameescape(a1) exe curwin."wincmd w" let s:lexplore_win= curwin let w:lexplore_buf= bufnr("%") if exists("t:netrw_lexposn") -" call Decho("forgetting t:netrw_lexposn",'~'.expand("")) unlet t:netrw_lexposn endif -" call Dret("netrw#Lexplore") return endif exe curwin."wincmd w" else let a1= "" -" call Decho("no input arguments") endif if exists("t:netrw_lexbufnr") " check if t:netrw_lexbufnr refers to a netrw window let lexwinnr = bufwinnr(t:netrw_lexbufnr) -" call Decho("lexwinnr= bufwinnr(t:netrw_lexbufnr#".t:netrw_lexbufnr.")=".lexwinnr) else let lexwinnr= 0 -" call Decho("t:netrw_lexbufnr doesn't exist") endif -" call Decho("lexwinnr=".lexwinnr,'~'.expand("")) if lexwinnr > 0 " close down netrw explorer window -" call Decho("t:netrw_lexbufnr#".t:netrw_lexbufnr.": close down netrw window",'~'.expand("")) exe lexwinnr."wincmd w" let g:netrw_winsize = -winwidth(0) let t:netrw_lexposn = winsaveview() -" call Decho("saving posn to t:netrw_lexposn<".string(t:netrw_lexposn).">",'~'.expand("")) -" call Decho("saving t:netrw_lexposn",'~'.expand("")) close if lexwinnr < curwin let curwin= curwin - 1 @@ -1241,11 +1139,9 @@ fun! netrw#Lexplore(count,rightside,...) exe curwin."wincmd w" endif unlet t:netrw_lexbufnr -" call Decho("unlet t:netrw_lexbufnr") else " open netrw explorer window -" call Decho("t:netrw_lexbufnr: open netrw explorer window",'~'.expand("")) exe "1wincmd w" let keep_altv = g:netrw_altv let g:netrw_altv = 0 @@ -1254,18 +1150,13 @@ fun! netrw#Lexplore(count,rightside,...) let g:netrw_winsize = a:count endif let curfile= expand("%") -" call Decho("curfile<".curfile.">",'~'.expand("")) exe (a:rightside? "botright" : "topleft")." vertical ".((g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize) . " new" -" call Decho("new buf#".bufnr("%")." win#".winnr()) if a:0 > 0 && a1 != "" -" call Decho("case 1: Explore ".a1,'~'.expand("")) call netrw#Explore(0,0,0,a1) exe "Explore ".fnameescape(a1) elseif curfile =~ '^\a\{3,}://' -" call Decho("case 2: Explore ".substitute(curfile,'[^/\\]*$','',''),'~'.expand("")) call netrw#Explore(0,0,0,substitute(curfile,'[^/\\]*$','','')) else -" call Decho("case 3: Explore .",'~'.expand("")) call netrw#Explore(0,0,0,".") endif if a:count != 0 @@ -1278,11 +1169,7 @@ fun! netrw#Lexplore(count,rightside,...) " Since the intended use of :Lexplore is to have an always-present explorer window, the extra " effort to prevent mis-use of :Lex is warranted. set bh=wipe -" call Decho("let t:netrw_lexbufnr=".t:netrw_lexbufnr) -" call Decho("t:netrw_lexposn".(exists("t:netrw_lexposn")? string(t:netrw_lexposn) : " n/a")) if exists("t:netrw_lexposn") -" call Decho("restoring to t:netrw_lexposn",'~'.expand("")) -" call Decho("restoring posn to t:netrw_lexposn<".string(t:netrw_lexposn).">",'~'.expand("")) call winrestview(t:netrw_lexposn) unlet t:netrw_lexposn endif @@ -1295,10 +1182,8 @@ fun! netrw#Lexplore(count,rightside,...) else let g:netrw_chgwin= 2 endif -" call Decho("let g:netrw_chgwin=".g:netrw_chgwin) endif -" call Dret("netrw#Lexplore") endfun " --------------------------------------------------------------------- @@ -1787,29 +1672,20 @@ endfun " --------------------------------------------------------------------- " 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("")) if !exists("{a:vt}netrw_optionsave") -" call Decho("case ".a:vt."netrw_optionsave : doesn't exist",'~'.expand("")) - - " filereadable() returns zero for remote files (e.g. scp://localhost//etc/fstab) - if filereadable(expand("%")) || expand("%") =~# '^\w\+://\f\+/' -" call Decho("..doing filetype detect anyway") + " filereadable() returns zero for remote files (e.g. scp://user@localhost//etc/fstab) + " Note: @ may not be in 'isfname', so '^\w\+://\f\+/' may not match + if filereadable(expand("%")) || expand("%") =~# '^\w\+://\f\+' 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("")) else setl ft=netrw endif -" call Decho("..ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) -" call Dret("s:NetrwOptionsRestore : ".a:vt."netrw_optionsave doesn't exist") return endif unlet {a:vt}netrw_optionsave if exists("+acd") if exists("{a:vt}netrw_acdkeep") -" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd,'~'.expand("")) let curdir = getcwd() let &l:acd = {a:vt}netrw_acdkeep unlet {a:vt}netrw_acdkeep @@ -1818,53 +1694,43 @@ fun! s:NetrwOptionsRestore(vt) 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 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" ,"&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 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_writekeep","&l:write") -" call Decho("(s:NetrwOptionsRestore) #10 lines=".&lines) call s:NetrwRestoreSetting("s:yykeep","@@") " former problem: start with liststyle=0; press : 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 @@ -1896,28 +1762,17 @@ fun! s:NetrwOptionsRestore(vt) endif endif if has("clipboard") && g:netrw_clipboard -" call Decho("has clipboard",'~'.expand("")) call s:NetrwRestoreSetting(a:vt."netrw_starkeep","@*") call s:NetrwRestoreSetting(a:vt."netrw_pluskeep","@+") endif call s:NetrwRestoreSetting(a:vt."netrw_slashkeep","@/") -" call Decho("g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd,'~'.expand("")) -" call Decho("fo=".&fo.(exists("+acd")? " acd=".&acd : " acd doesn't exist"),'~'.expand("")) -" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) -" call Decho("diff=".&l:diff." win#".winnr()." w:netrw_diffkeep=".(exists("w:netrw_diffkeep")? w:netrw_diffkeep : "doesn't exist"),'~'.expand("")) -" call Decho("ts=".&l:ts,'~'.expand("")) " Moved the filetype detect here from NetrwGetFile() because remote files " were having their filetype detect-generated settings overwritten by " NetrwOptionRestore. if &ft != "netrw" -" call Decho("before: filetype detect (ft=".&ft.")",'~'.expand("")) filetype detect -" call Decho("after : filetype detect (ft=".&ft.")",'~'.expand("")) 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("")) -" call Dret("s:NetrwOptionsRestore : tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> modified=".&modified." modifiable=".&modifiable." readonly=".&readonly) endfun " --------------------------------------------------------------------- @@ -2868,36 +2723,27 @@ endfun " netrw#SetTreetop: resets the tree top to the current directory/specified directory {{{2 " (implements the :Ntree command) fun! netrw#SetTreetop(iscmd,...) -" call Dfunc("netrw#SetTreetop(iscmd=".a:iscmd." ".((a:0 > 0)? a:1 : "").") a:0=".a:0) -" call Decho("w:netrw_treetop<".w:netrw_treetop.">") " iscmd==0: netrw#SetTreetop called using gn mapping " iscmd==1: netrw#SetTreetop called using :Ntree from the command line -" call Decho("(iscmd=".a:iscmd.": called using :Ntree from command line",'~'.expand("")) " clear out the current tree if exists("w:netrw_treetop") -" call Decho("clearing out current tree",'~'.expand("")) let inittreetop= w:netrw_treetop unlet w:netrw_treetop endif if exists("w:netrw_treedict") -" call Decho("freeing w:netrw_treedict",'~'.expand("")) unlet w:netrw_treedict endif -" call Decho("inittreetop<".(exists("inittreetop")? inittreetop : "n/a").">") if (a:iscmd == 0 || a:1 == "") && exists("inittreetop") let treedir = s:NetrwTreePath(inittreetop) -" call Decho("treedir<".treedir.">",'~'.expand("")) else if isdirectory(s:NetrwFile(a:1)) -" call Decho("a:1<".a:1."> is a directory",'~'.expand("")) 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 s:netrw_treetop = treedir -" call Decho("a:1<".a:1."> is NOT a directory, using treedir<".treedir.">",'~'.expand("")) else " normally the cursor is left in the message window. " However, here this results in the directory being listed in the message window, which is not wanted. @@ -2908,20 +2754,17 @@ fun! netrw#SetTreetop(iscmd,...) let s:netrw_treetop = getcwd() endif endif -" call Decho("treedir<".treedir.">",'~'.expand("")) " determine if treedir is remote or local let islocal= expand("%") !~ '^\a\{3,}://' -" call Decho("islocal=".islocal,'~'.expand("")) " browse the resulting directory if islocal - call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(islocal,treedir)) + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(islocal,treedir,0)) else - call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,treedir)) + call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,treedir,0)) endif -" call Dret("netrw#SetTreetop") endfun " =========================================== @@ -3779,16 +3622,11 @@ endfun " Often called via: Explore/e dirname/etc -> netrw#LocalBrowseCheck() -> s:NetrwBrowse() fun! s:NetrwBrowse(islocal,dirname) if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif -" call Dfunc("s:NetrwBrowse(islocal=".a:islocal." dirname<".a:dirname.">) liststyle=".w:netrw_liststyle." ".g:loaded_netrw." buf#".bufnr("%")."<".bufname("%")."> win#".winnr()) -" call Decho("fyi: modified=".&modified." modifiable=".&modifiable." readonly=".&readonly,'~'.expand("")) -" call Decho("fyi: tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) -" call Dredir("ls!","s:NetrwBrowse") " save alternate-file's filename if w:netrw_rexlocal doesn't exist " This is useful when one edits a local file, then :e ., then :Rex if a:islocal && !exists("w:netrw_rexfile") && bufname("#") != "" let w:netrw_rexfile= bufname("#") -" call Decho("setting w:netrw_rexfile<".w:netrw_rexfile."> win#".winnr(),'~'.expand("")) endif " s:NetrwBrowse : initialize history {{{3 @@ -3799,32 +3637,26 @@ fun! s:NetrwBrowse(islocal,dirname) " s:NetrwBrowse : simplify the dirname (especially for ".."s in dirnames) {{{3 if a:dirname !~ '^\a\{3,}://' let dirname= simplify(a:dirname) -" call Decho("simplified dirname<".dirname.">") else let dirname= a:dirname endif " repoint t:netrw_lexbufnr if appropriate if exists("t:netrw_lexbufnr") && bufnr("%") == t:netrw_lexbufnr -" call Decho("set repointlexbufnr to true!") let repointlexbufnr= 1 endif " s:NetrwBrowse : sanity checks: {{{3 if exists("s:netrw_skipbrowse") unlet s:netrw_skipbrowse -" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." filename<".expand("%")."> win#".winnr()." ft<".&ft.">",'~'.expand("")) -" call Dret("s:NetrwBrowse : s:netrw_skipbrowse existed") return endif if !exists("*shellescape") NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing shellescape()",69) -" call Dret("s:NetrwBrowse : missing shellescape()") return endif if !exists("*fnameescape") NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw can't run -- your vim is missing fnameescape()",70) -" call Dret("s:NetrwBrowse : missing fnameescape()") return endif @@ -3834,53 +3666,39 @@ fun! s:NetrwBrowse(islocal,dirname) " s:NetrwBrowse : re-instate any marked files {{{3 if has("syntax") && exists("g:syntax_on") && g:syntax_on if exists("s:netrwmarkfilelist_{bufnr('%')}") -" call Decho("clearing marked files",'~'.expand("")) exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" endif endif if a:islocal && exists("w:netrw_acdkeep") && w:netrw_acdkeep " s:NetrwBrowse : set up "safe" options for local directory/file {{{3 -" call Decho("handle w:netrw_acdkeep:",'~'.expand("")) -" call Decho("NetrwKeepj lcd ".fnameescape(dirname)." (due to w:netrw_acdkeep=".w:netrw_acdkeep." - acd=".&acd.")",'~'.expand("")) if s:NetrwLcd(dirname) -" call Dret("s:NetrwBrowse : lcd failure") return endif - " call s:NetrwOptionsSafe() " tst952 failed with this enabled. -" call Decho("getcwd<".getcwd().">",'~'.expand("")) elseif !a:islocal && dirname !~ '[\/]$' && dirname !~ '^"' " s:NetrwBrowse : remote regular file handler {{{3 -" call Decho("handle remote regular file: dirname<".dirname.">",'~'.expand("")) if bufname(dirname) != "" -" call Decho("edit buf#".bufname(dirname)." in win#".winnr(),'~'.expand("")) exe "NetrwKeepj b ".bufname(dirname) else " attempt transfer of remote regular file -" call Decho("attempt transfer as regular file<".dirname.">",'~'.expand("")) " remove any filetype indicator from end of dirname, except for the " "this is a directory" indicator (/). " There shouldn't be one of those here, anyway. let path= substitute(dirname,'[*=@|]\r\=$','','e') -" call Decho("new path<".path.">",'~'.expand("")) call s:RemotePathAnalysis(dirname) " s:NetrwBrowse : remote-read the requested file into current buffer {{{3 call s:NetrwEnew(dirname) call s:NetrwOptionsSafe(a:islocal) setl ma noro -" call Decho("setl ma noro",'~'.expand("")) let b:netrw_curdir = dirname let url = s:method."://".((s:user == "")? "" : s:user."@").s:machine.(s:port ? ":".s:port : "")."/".s:path call s:NetrwBufRename(url) exe "sil! NetrwKeepj keepalt doau BufReadPre ".fnameescape(s:fname) sil call netrw#NetRead(2,url) " netrw.vim and tar.vim have already handled decompression of the tarball; avoiding gzip.vim error -" call Decho("url<".url.">",'~'.expand("")) -" call Decho("s:path<".s:path.">",'~'.expand("")) -" call Decho("s:fname<".s:fname.">",'~'.expand("")) if s:path =~ '.bz2' exe "sil NetrwKeepj keepalt doau BufReadPost ".fnameescape(substitute(s:fname,'\.bz2$','','')) elseif s:path =~ '.gz' @@ -3895,11 +3713,7 @@ fun! s:NetrwBrowse(islocal,dirname) " s:NetrwBrowse : save certain window-oriented variables into buffer-oriented variables {{{3 call s:SetBufWinVars() call s:NetrwOptionsRestore("w:") -" call Decho("setl ma nomod",'~'.expand("")) setl ma nomod noro -" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) - -" call Dret("s:NetrwBrowse : file<".s:fname.">") return endif @@ -3915,33 +3729,31 @@ fun! s:NetrwBrowse(islocal,dirname) NetrwKeepj call s:NetrwMenu(1) " get/set-up buffer {{{3 -" call Decho("saving position across a buffer refresh",'~'.expand("")) let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) + + " NetrwGetBuffer might change buffers but s:rexposn_X was set for the + " previous buffer + let prevbufnr = bufnr('%') let reusing= s:NetrwGetBuffer(a:islocal,dirname) + if exists("s:rexposn_".prevbufnr) + let s:rexposn_{bufnr('%')} = s:rexposn_{prevbufnr} + endif " maintain markfile highlighting if has("syntax") && exists("g:syntax_on") && g:syntax_on if exists("s:netrwmarkfilemtch_{bufnr('%')}") && s:netrwmarkfilemtch_{bufnr("%")} != "" -" " call Decho("bufnr(%)=".bufnr('%'),'~'.expand("")) -" " call Decho("exe 2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/",'~'.expand("")) exe "2match netrwMarkFile /".s:netrwmarkfilemtch_{bufnr("%")}."/" else -" " call Decho("2match none",'~'.expand("")) 2match none endif endif if reusing && line("$") > 1 call s:NetrwOptionsRestore("w:") -" call Decho("setl noma nomod nowrap",'~'.expand("")) setl noma nomod nowrap -" call Decho("(set noma nomod nowrap) ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) -" call Dret("s:NetrwBrowse : re-using not-cleared buffer") return endif " set b:netrw_curdir to the new directory name {{{3 -" call Decho("set b:netrw_curdir to the new directory name<".dirname."> (buf#".bufnr("%").")",'~'.expand("")) let b:netrw_curdir= dirname if b:netrw_curdir =~ '[/\\]$' let b:netrw_curdir= substitute(b:netrw_curdir,'[/\\]$','','e') @@ -3962,24 +3774,18 @@ fun! s:NetrwBrowse(islocal,dirname) if !a:islocal && b:netrw_curdir !~ '/$' let b:netrw_curdir= b:netrw_curdir.'/' endif -" call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("")) " ------------ " (local only) {{{3 " ------------ if a:islocal -" call Decho("local only:",'~'.expand("")) - " Set up ShellCmdPost handling. Append current buffer to browselist call s:LocalFastBrowser() " handle g:netrw_keepdir: set vim's current directory to netrw's notion of the current directory {{{3 if !g:netrw_keepdir -" call Decho("handle g:netrw_keepdir=".g:netrw_keepdir.": getcwd<".getcwd()."> acd=".&acd,'~'.expand("")) -" call Decho("l:acd".(exists("&l:acd")? "=".&l:acd : " doesn't exist"),'~'.expand("")) if !exists("&l:acd") || !&l:acd if s:NetrwLcd(b:netrw_curdir) -" call Dret("s:NetrwBrowse : lcd failure") return endif endif @@ -3989,23 +3795,18 @@ fun! s:NetrwBrowse(islocal,dirname) " remote handling: {{{3 " -------------------------------- else -" call Decho("remote only:",'~'.expand("")) " analyze dirname and g:netrw_list_cmd {{{3 -" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist")."> dirname<".dirname.">",'~'.expand("")) if dirname =~# "^NetrwTreeListing\>" let dirname= b:netrw_curdir -" call Decho("(dirname was ) dirname<".dirname.">",'~'.expand("")) elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir") let dirname= substitute(b:netrw_curdir,'\\','/','g') if dirname !~ '/$' let dirname= dirname.'/' endif let b:netrw_curdir = dirname -" call Decho("(liststyle is TREELIST) dirname<".dirname.">",'~'.expand("")) else let dirname = substitute(dirname,'\\','/','g') -" call Decho("(normal) dirname<".dirname.">",'~'.expand("")) endif let dirpat = '^\(\w\{-}\)://\(\w\+@\)\=\([^/]\+\)/\(.*\)$' @@ -4014,14 +3815,10 @@ fun! s:NetrwBrowse(islocal,dirname) NetrwKeepj call netrw#ErrorMsg(s:ERROR,"netrw doesn't understand your dirname<".dirname.">",20) endif NetrwKeepj call s:NetrwOptionsRestore("w:") -" call Decho("setl noma nomod nowrap",'~'.expand("")) setl noma nomod nowrap -" call Decho(" ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) -" call Dret("s:NetrwBrowse : badly formatted dirname<".dirname.">") return endif let b:netrw_curdir= dirname -" call Decho("b:netrw_curdir<".b:netrw_curdir."> (remote)",'~'.expand("")) endif " (additional remote handling) " ------------------------------- @@ -4033,12 +3830,10 @@ fun! s:NetrwBrowse(islocal,dirname) " restore option(s) call s:NetrwOptionsRestore("w:") -" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) " If there is a rexposn: restore position with rexposn " Otherwise : set rexposn if exists("s:rexposn_".bufnr("%")) -" call Decho("restoring posn to s:rexposn_".bufnr('%')."<".string(s:rexposn_{bufnr('%')}).">",'~'.expand("")) NetrwKeepj call winrestview(s:rexposn_{bufnr('%')}) if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt NetrwKeepj exe w:netrw_bannercnt @@ -4048,28 +3843,22 @@ fun! s:NetrwBrowse(islocal,dirname) endif if v:version >= 700 && has("balloon_eval") && &beval == 0 && &l:bexpr == "" && !exists("g:netrw_nobeval") let &l:bexpr= "netrw#BalloonHelp()" -" call Decho("set up balloon help: l:bexpr=".&l:bexpr,'~'.expand("")) setl beval endif " repoint t:netrw_lexbufnr if appropriate if exists("repointlexbufnr") let t:netrw_lexbufnr= bufnr("%") -" call Decho("repoint t:netrw_lexbufnr to #".t:netrw_lexbufnr) endif " restore position if reusing -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) call winrestview(svpos) endif " The s:LocalBrowseRefresh() function is called by an autocmd " installed by s:LocalFastBrowser() when g:netrw_fastbrowse <= 1 (ie. slow or medium speed). " However, s:NetrwBrowse() causes the FocusGained event to fire the first time. -" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) -" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) -" call Dret("s:NetrwBrowse : did PerformListing ft<".&ft.">") return endfun @@ -4562,41 +4351,30 @@ endfun " islocal=0: remote browsing " =1: local browsing fun! s:NetrwListStyle(islocal) -" call Dfunc("NetrwListStyle(islocal=".a:islocal.") w:netrw_liststyle=".w:netrw_liststyle) - let ykeep = @@ let fname = s:NetrwGetWord() if !exists("w:netrw_liststyle")|let w:netrw_liststyle= g:netrw_liststyle|endif let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let w:netrw_liststyle = (w:netrw_liststyle + 1) % s:MAXLIST -" call Decho("fname<".fname.">",'~'.expand("")) -" call Decho("chgd w:netrw_liststyle to ".w:netrw_liststyle,'~'.expand("")) -" call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">",'~'.expand("")) " repoint t:netrw_lexbufnr if appropriate if exists("t:netrw_lexbufnr") && bufnr("%") == t:netrw_lexbufnr -" call Decho("set repointlexbufnr to true!") let repointlexbufnr= 1 endif if w:netrw_liststyle == s:THINLIST " use one column listing -" call Decho("use one column list",'~'.expand("")) let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge') elseif w:netrw_liststyle == s:LONGLIST " use long list -" call Decho("use long list",'~'.expand("")) let g:netrw_list_cmd = g:netrw_list_cmd." -l" elseif w:netrw_liststyle == s:WIDELIST " give wide list -" call Decho("use wide list",'~'.expand("")) let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge') elseif exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST -" call Decho("use tree list",'~'.expand("")) let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge') else @@ -4606,25 +4384,19 @@ fun! s:NetrwListStyle(islocal) let g:netrw_list_cmd = substitute(g:netrw_list_cmd,' -l','','ge') endif setl ma noro -" call Decho("setl ma noro",'~'.expand("")) " clear buffer - this will cause NetrwBrowse/LocalBrowseCheck to do a refresh -" call Decho("clear buffer<".expand("%")."> with :%d",'~'.expand("")) sil! NetrwKeepj %d _ " following prevents tree listing buffer from being marked "modified" -" call Decho("setl nomod",'~'.expand("")) setl nomod -" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) " refresh the listing -" call Decho("refresh the listing",'~'.expand("")) - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call s:NetrwCursor(0) " repoint t:netrw_lexbufnr if appropriate if exists("repointlexbufnr") let t:netrw_lexbufnr= bufnr("%") -" call Decho("repoint t:netrw_lexbufnr to #".t:netrw_lexbufnr) endif " restore position; keep cursor on the filename @@ -4632,22 +4404,18 @@ fun! s:NetrwListStyle(islocal) NetrwKeepj call winrestview(svpos) let @@= ykeep -" call Dret("NetrwListStyle".(exists("w:netrw_liststyle")? ' : w:netrw_liststyle='.w:netrw_liststyle : "")) endfun " --------------------------------------------------------------------- " s:NetrwBannerCtrl: toggles the display of the banner {{{2 fun! s:NetrwBannerCtrl(islocal) -" call Dfunc("s:NetrwBannerCtrl(islocal=".a:islocal.") g:netrw_banner=".g:netrw_banner) - let ykeep= @@ " toggle the banner (enable/suppress) let g:netrw_banner= !g:netrw_banner " refresh the listing let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) - call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) " keep cursor on the filename if g:netrw_banner && exists("w:netrw_bannercnt") && line(".") >= w:netrw_bannercnt @@ -4675,24 +4443,20 @@ endfun " " With bang: deletes files/directories from Netrw's bookmark system fun! s:NetrwBookmark(del,...) -" call Dfunc("s:NetrwBookmark(del=".a:del.",...) a:0=".a:0) if a:0 == 0 if &ft == "netrw" let curbufnr = bufnr("%") if exists("s:netrwmarkfilelist_{curbufnr}") " for every filename in the marked list -" call Decho("bookmark every filename in marked list",'~'.expand("")) let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let islocal= expand("%") !~ '^\a\{3,}://' for fname in s:netrwmarkfilelist_{curbufnr} if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif endfor let curdir = exists("b:netrw_curdir")? b:netrw_curdir : getcwd() call s:NetrwUnmarkList(curbufnr,curdir) - NetrwKeepj call s:NetrwRefresh(islocal,s:NetrwBrowseChgDir(islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(islocal,s:NetrwBrowseChgDir(islocal,'./',0)) NetrwKeepj call winrestview(svpos) else let fname= s:NetrwGetWord() @@ -4701,7 +4465,6 @@ fun! s:NetrwBookmark(del,...) else " bookmark currently open file -" call Decho("bookmark currently open file",'~'.expand("")) let fname= expand("%") if a:del|call s:DeleteBookmark(fname)|else|call s:MakeBookmark(fname)|endif endif @@ -4712,7 +4475,6 @@ fun! s:NetrwBookmark(del,...) " by deciding if the current file begins with an url " Globbing cannot be done remotely. let islocal= expand("%") !~ '^\a\{3,}://' -" call Decho("bookmark specified file".((a:0>1)? "s" : ""),'~'.expand("")) let i = 1 while i <= a:0 if islocal @@ -4724,9 +4486,7 @@ fun! s:NetrwBookmark(del,...) else let mbfiles= [a:{i}] endif -" call Decho("mbfiles".string(mbfiles),'~'.expand("")) for mbfile in mbfiles -" call Decho("mbfile<".mbfile.">",'~'.expand("")) if a:del|call s:DeleteBookmark(mbfile)|else|call s:MakeBookmark(mbfile)|endif endfor let i= i + 1 @@ -4735,8 +4495,6 @@ fun! s:NetrwBookmark(del,...) " update the menu call s:NetrwBookmarkMenu() - -" call Dret("s:NetrwBookmark") endfun " --------------------------------------------------------------------- @@ -4808,58 +4566,61 @@ endfun " directory and a new directory name. Also, if the " "new directory name" is actually a file, " NetrwBrowseChgDir() edits the file. -fun! s:NetrwBrowseChgDir(islocal,newdir,...) -" call Dfunc("s:NetrwBrowseChgDir(islocal=".a:islocal."> newdir<".a:newdir.">) a:0=".a:0." win#".winnr()." curpos<".string(getpos("."))."> b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "").">") -" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) - +" cursor=0: newdir is relative to b:netrw_curdir +" =1: newdir is relative to the path to the word under the cursor in +" tree view +fun! s:NetrwBrowseChgDir(islocal,newdir,cursor,...) let ykeep= @@ if !exists("b:netrw_curdir") " Don't try to change-directory: this can happen, for example, when netrw#ErrorMsg has been called " and the current window is the NetrwMessage window. let @@= ykeep -" call Decho("b:netrw_curdir doesn't exist!",'~'.expand("")) -" call Decho("getcwd<".getcwd().">",'~'.expand("")) -" call Dredir("ls!","s:NetrwBrowseChgDir") -" call Dret("s:NetrwBrowseChgDir") return endif -" call Decho("b:netrw_curdir<".b:netrw_curdir.">") " NetrwBrowseChgDir; save options and initialize {{{3 -" call Decho("saving options",'~'.expand("")) call s:SavePosn(s:netrw_posn) NetrwKeepj call s:NetrwOptionsSave("s:") NetrwKeepj call s:NetrwOptionsSafe(a:islocal) - if has("win32") - let dirname = substitute(b:netrw_curdir,'\\','/','ge') + + let newdir = a:newdir + if a:cursor && exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treetop") + " dirname is the path to the word under the cursor + let dirname = s:NetrwTreePath(w:netrw_treetop) + " newdir resolves to a directory and points to a directory in dirname + " /tmp/test/folder_symlink/ -> /tmp/test/original_folder/ + if a:islocal && fnamemodify(dirname, ':t') == newdir && isdirectory(resolve(dirname)) && resolve(dirname) == resolve(newdir) + let dirname = fnamemodify(resolve(dirname), ':p:h:h') + let newdir = fnamemodify(resolve(newdir), ':t') + endif + " Remove trailing "/" + let dirname = substitute(dirname, "/$", "", "") + + " If the word under the cursor is a directory (except for ../), NetrwTreePath + " returns the full path, including the word under the cursor, remove it + if newdir =~ "/$" && newdir != "../" + let dirname = fnamemodify(dirname, ":h") + endif else let dirname = b:netrw_curdir endif - let newdir = a:newdir + if has("win32") + let dirname = substitute(dirname,'\\','/','ge') + endif let dolockout = 0 let dorestore = 1 -" call Decho("win#".winnr(),'~'.expand("")) -" call Decho("dirname<".dirname.">",'~'.expand("")) -" call Decho("newdir<".newdir.">",'~'.expand("")) " ignore s when done in the banner -" call Decho('(s:NetrwBrowseChgDir) ignore [return]s when done in banner (g:netrw_banner='.g:netrw_banner.")",'~'.expand("")) if g:netrw_banner -" call Decho("win#".winnr()." w:netrw_bannercnt=".(exists("w:netrw_bannercnt")? w:netrw_bannercnt : 'n/a')." line(.)#".line('.')." line($)#".line("#"),'~'.expand("")) if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt && line("$") >= w:netrw_bannercnt if getline(".") =~# 'Quick Help' -" call Decho("#1: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) let g:netrw_quickhelp= (g:netrw_quickhelp + 1)%len(s:QuickHelp) -" call Decho("#2: quickhelp=".g:netrw_quickhelp." ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) setl ma noro nowrap NetrwKeepj call setline(line('.'),'" Quick Help: :help '.s:QuickHelp[g:netrw_quickhelp]) setl noma nomod nowrap NetrwKeepj call s:NetrwOptionsRestore("s:") -" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) endif endif -" else " Decho -" call Decho("g:netrw_banner=".g:netrw_banner." (no banner)",'~'.expand("")) endif " set up o/s-dependent directory recognition pattern @@ -4868,69 +4629,45 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) else let dirpat= '[\/]$' endif -" call Decho("set up o/s-dependent directory recognition pattern: dirname<".dirname."> dirpat<".dirpat.">",'~'.expand("")) if dirname !~ dirpat " apparently vim is "recognizing" that it is in a directory and " is removing the trailing "/". Bad idea, so let's put it back. let dirname= dirname.'/' -" call Decho("adjusting dirname<".dirname.'> (put trailing "/" back)','~'.expand("")) endif -" call Decho("[newdir<".newdir."> ".((newdir =~ dirpat)? "=~" : "!~")." dirpat<".dirpat.">] && [islocal=".a:islocal."] && [newdir is ".(isdirectory(s:NetrwFile(newdir))? "" : "not ")."a directory]",'~'.expand("")) if newdir !~ dirpat && !(a:islocal && isdirectory(s:NetrwFile(s:ComposePath(dirname,newdir)))) " ------------------------------ " NetrwBrowseChgDir: edit a file {{{3 " ------------------------------ -" call Decho('edit-a-file: case "handling a file": win#'.winnr().' newdir<'.newdir.'> !~ dirpat<'.dirpat.">",'~'.expand("")) " save position for benefit of Rexplore let s:rexposn_{bufnr("%")}= winsaveview() -" call Decho("edit-a-file: saving posn to s:rexposn_".bufnr("%")."<".string(s:rexposn_{bufnr("%")}).">",'~'.expand("")) -" call Decho("edit-a-file: win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft,'~'.expand("")) -" call Decho("edit-a-file: w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a')." w:netrw_treedict:".(exists("w:netrw_treedict")? "exists" : 'n/a')." newdir<".newdir.">",'~'.expand("")) 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("")) -" call Decho("edit-a-file: newdir<".newdir.">",'~'.expand("")) -" 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?") - " Feb 17, 2019: following if-else-endif restored -- wasn't editing a file in tree mode if dirname =~ '/$' let dirname= dirname.newdir else let dirname= dirname."/".newdir endif -" call Decho("edit-a-file: dirname<".dirname.">",'~'.expand("")) -" call Decho("edit-a-file: tree listing",'~'.expand("")) elseif newdir =~ '^\(/\|\a:\)' -" call Decho("edit-a-file: handle an url or path starting with /: <".newdir.">",'~'.expand("")) let dirname= newdir else let dirname= s:ComposePath(dirname,newdir) endif -" call Decho("edit-a-file: handling a file: dirname<".dirname."> (a:0=".a:0.")",'~'.expand("")) " this lets netrw#BrowseX avoid the edit if a:0 < 1 -" call Decho("edit-a-file: (a:0=".a:0."<1) set up windows for editing<".fnameescape(dirname)."> didsplit=".(exists("s:didsplit")? s:didsplit : "doesn't exist"),'~'.expand("")) NetrwKeepj call s:NetrwOptionsRestore("s:") let curdir= b:netrw_curdir if !exists("s:didsplit") -" " call Decho("edit-a-file: s:didsplit does not exist; g:netrw_browse_split=".string(g:netrw_browse_split)." win#".winnr()." g:netrw_chgwin=".g:netrw_chgwin",'~'.expand("")) if type(g:netrw_browse_split) == 3 " open file in server " Note that g:netrw_browse_split is a List: [servername,tabnr,winnr] -" call Decho("edit-a-file: open file in server",'~'.expand("")) call s:NetrwServerEdit(a:islocal,dirname) -" call Dret("s:NetrwBrowseChgDir") return elseif g:netrw_browse_split == 1 " horizontally splitting the window first -" call Decho("edit-a-file: horizontally splitting window prior to edit",'~'.expand("")) let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize exe "keepalt ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s" if !&ea @@ -4940,7 +4677,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) elseif g:netrw_browse_split == 2 " vertically splitting the window first -" call Decho("edit-a-file: vertically splitting window prior to edit",'~'.expand("")) let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize exe "keepalt ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s" if !&ea @@ -4950,7 +4686,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) elseif g:netrw_browse_split == 3 " open file in new tab -" call Decho("edit-a-file: opening new tab prior to edit",'~'.expand("")) keepalt tabnew if !exists("b:netrw_curdir") let b:netrw_curdir= getcwd() @@ -4959,21 +4694,17 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) elseif g:netrw_browse_split == 4 " act like "P" (ie. open previous window) -" call Decho("edit-a-file: use previous window for edit",'~'.expand("")) if s:NetrwPrevWinOpen(2) == 3 let @@= ykeep -" call Dret("s:NetrwBrowseChgDir") return endif call s:SetRexDir(a:islocal,curdir) else " handling a file, didn't split, so remove menu -" call Decho("edit-a-file: handling a file+didn't split, so remove menu",'~'.expand("")) call s:NetrwMenu(0) " optional change to window if g:netrw_chgwin >= 1 -" call Decho("edit-a-file: changing window to #".g:netrw_chgwin.": (due to g:netrw_chgwin)",'~'.expand("")) if winnr("$")+1 == g:netrw_chgwin " if g:netrw_chgwin is set to one more than the last window, then " vertically split the last window to make that window available. @@ -4997,21 +4728,17 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) let dolockout= 1 endif if a:islocal -" call Decho("edit-a-file: edit local file: exe e! ".fnameescape(dirname),'~'.expand("")) " some like c-^ to return to the last edited file " others like c-^ to return to the netrw buffer " Apr 30, 2020: used to have e! here. That can cause loss of a modified file, " so emit error E37 instead. call s:NetrwEditFile("e","",dirname) -" call Decho("edit-a-file: after e ".dirname.": hidden=".&hidden." bufhidden<".&bufhidden."> mod=".&mod,'~'.expand("")) - " 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 endif else -" call Decho("edit-a-file: remote file: NetrwBrowse will edit it",'~'.expand("")) endif " handle g:Netrw_funcref -- call external-to-netrw functions @@ -5019,12 +4746,9 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " or as a list of function references. It will ignore anything that's not " a function reference. See :help Funcref for information about function references. if exists("g:Netrw_funcref") -" call Decho("edit-a-file: handle optional Funcrefs",'~'.expand("")) if type(g:Netrw_funcref) == 2 -" call Decho("edit-a-file: handling a g:Netrw_funcref",'~'.expand("")) NetrwKeepj call g:Netrw_funcref() elseif type(g:Netrw_funcref) == 3 -" call Decho("edit-a-file: handling a list of g:Netrw_funcrefs",'~'.expand("")) for Fncref in g:Netrw_funcref if type(Fncref) == 2 NetrwKeepj call Fncref() @@ -5038,7 +4762,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " ---------------------------------------------------- " NetrwBrowseChgDir: just go to the new directory spec {{{3 " ---------------------------------------------------- -" call Decho('goto-newdir: case "just go to new directory spec": newdir<'.newdir.'>','~'.expand("")) let dirname = newdir NetrwKeepj call s:SetRexDir(a:islocal,dirname) NetrwKeepj call s:NetrwOptionsRestore("s:") @@ -5048,7 +4771,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " --------------------------------------------- " NetrwBrowseChgDir: refresh the directory list {{{3 " --------------------------------------------- -" call Decho('(s:NetrwBrowseChgDir)refresh-dirlist: case "refresh directory listing": newdir == "./"','~'.expand("")) NetrwKeepj call s:SetRexDir(a:islocal,dirname) norm! m` @@ -5056,26 +4778,21 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " -------------------------------------- " NetrwBrowseChgDir: go up one directory {{{3 " -------------------------------------- -" call Decho('(s:NetrwBrowseChgDir)go-up: case "go up one directory": newdir == "../"','~'.expand("")) if w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") " force a refresh -" call Decho("go-up: clear buffer<".expand("%")."> with :%d",'~'.expand("")) -" call Decho("go-up: setl noro ma",'~'.expand("")) setl noro ma NetrwKeepj %d _ endif if has("amiga") " amiga -" call Decho('go-up: case "go up one directory": newdir == "../" and amiga','~'.expand("")) if a:islocal let dirname= substitute(dirname,'^\(.*[/:]\)\([^/]\+$\)','\1','') let dirname= substitute(dirname,'/$','','') else let dirname= substitute(dirname,'^\(.*[/:]\)\([^/]\+/$\)','\1','') endif -" call Decho("go-up: amiga: dirname<".dirname."> (go up one dir)",'~'.expand("")) elseif !g:netrw_cygwin && has("win32") " windows @@ -5090,11 +4807,9 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) if dirname =~ '^\a:$' let dirname= dirname.'/' endif -" call Decho("go-up: windows: dirname<".dirname."> (go up one dir)",'~'.expand("")) else " unix or cygwin -" call Decho('(s:NetrwBrowseChgDir)go-up: case "go up one directory": newdir == "../" and unix or cygwin','~'.expand("")) if a:islocal let dirname= substitute(dirname,'^\(.*\)/\([^/]\+\)/$','\1','') if dirname == "" @@ -5103,7 +4818,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) else let dirname= substitute(dirname,'^\(\a\{3,}://.\{-}/\{1,2}\)\(.\{-}\)\([^/]\+\)/$','\1\2','') endif -" call Decho("go-up: unix: dirname<".dirname."> (go up one dir)",'~'.expand("")) endif NetrwKeepj call s:SetRexDir(a:islocal,dirname) norm! m` @@ -5112,69 +4826,48 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " -------------------------------------- " NetrwBrowseChgDir: Handle Tree Listing {{{3 " -------------------------------------- -" call Decho('(s:NetrwBrowseChgDir)tree-list: case liststyle is TREELIST and w:netrw_treedict exists','~'.expand("")) " force a refresh (for TREELIST, NetrwTreeDir() will force the refresh) -" call Decho("tree-list: setl noro ma",'~'.expand("")) setl noro ma if !(exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("b:netrw_curdir")) -" call Decho("tree-list: clear buffer<".expand("%")."> with :%d (force refresh)",'~'.expand("")) NetrwKeepj %d _ endif let treedir = s:NetrwTreeDir(a:islocal) -" call Decho("tree-list: treedir<".treedir.">",'~'.expand("")) let s:treecurpos = winsaveview() let haskey = 0 -" call Decho("tree-list: w:netrw_treedict<".string(w:netrw_treedict).">",'~'.expand("")) " search treedict for tree dir as-is -" call Decho("tree-list: search treedict for tree dir as-is",'~'.expand("")) if has_key(w:netrw_treedict,treedir) -" call Decho('(s:NetrwBrowseChgDir)tree-list: ....searched for treedir<'.treedir.'> : found it!','~'.expand("")) let haskey= 1 else -" call Decho('(s:NetrwBrowseChgDir)tree-list: ....searched for treedir<'.treedir.'> : not found','~'.expand("")) endif " search treedict for treedir with a [/@] appended -" call Decho("tree-list: search treedict for treedir with a [/@] appended",'~'.expand("")) if !haskey && treedir !~ '[/@]$' if has_key(w:netrw_treedict,treedir."/") let treedir= treedir."/" -" call Decho('(s:NetrwBrowseChgDir)tree-list: ....searched.for treedir<'.treedir.'> found it!','~'.expand("")) let haskey = 1 else -" call Decho('(s:NetrwBrowseChgDir)tree-list: ....searched for treedir<'.treedir.'/> : not found','~'.expand("")) endif endif " search treedict for treedir with any trailing / elided -" call Decho("tree-list: search treedict for treedir with any trailing / elided",'~'.expand("")) if !haskey && treedir =~ '/$' let treedir= substitute(treedir,'/$','','') if has_key(w:netrw_treedict,treedir) -" call Decho('(s:NetrwBrowseChgDir)tree-list: ....searched.for treedir<'.treedir.'> found it!','~'.expand("")) let haskey = 1 else -" call Decho('(s:NetrwBrowseChgDir)tree-list: ....searched for treedir<'.treedir.'> : not found','~'.expand("")) endif endif -" call Decho("haskey=".haskey,'~'.expand("")) if haskey " close tree listing for selected subdirectory -" call Decho("tree-list: closing selected subdirectory<".dirname.">",'~'.expand("")) call remove(w:netrw_treedict,treedir) -" call Decho("tree-list: removed entry<".treedir."> from treedict",'~'.expand("")) -" call Decho("tree-list: yielding treedict<".string(w:netrw_treedict).">",'~'.expand("")) let dirname= w:netrw_treetop else " go down one directory let dirname= substitute(treedir,'/*$','/','') -" call Decho("tree-list: go down one dir: treedir<".treedir.">",'~'.expand("")) -" call Decho("tree-list: ... : dirname<".dirname.">",'~'.expand("")) endif NetrwKeepj call s:SetRexDir(a:islocal,dirname) -" call Decho("setting s:treeforceredraw to true",'~'.expand("")) let s:treeforceredraw = 1 else @@ -5182,7 +4875,6 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) " NetrwBrowseChgDir: Go down one directory {{{3 " ---------------------------------------- let dirname = s:ComposePath(dirname,newdir) -" call Decho("go down one dir: dirname<".dirname."> newdir<".newdir.">",'~'.expand("")) NetrwKeepj call s:SetRexDir(a:islocal,dirname) norm! m` endif @@ -5193,29 +4885,18 @@ fun! s:NetrwBrowseChgDir(islocal,newdir,...) if dorestore " dorestore is zero'd when a local file was hidden or bufhidden; " in such a case, we want to keep whatever settings it may have. -" call Decho("doing option restore (dorestore=".dorestore.")",'~'.expand("")) NetrwKeepj call s:NetrwOptionsRestore("s:") -" else " Decho -" call Decho("skipping option restore (dorestore==0): hidden=".&hidden." bufhidden=".&bufhidden." mod=".&mod,'~'.expand("")) endif if dolockout && dorestore -" call Decho("restore: filewritable(dirname<".dirname.">)=".filewritable(dirname),'~'.expand("")) if filewritable(dirname) -" call Decho("restore: doing modification lockout settings: ma nomod noro",'~'.expand("")) -" call Decho("restore: setl ma nomod noro",'~'.expand("")) setl ma noro nomod -" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) else -" call Decho("restore: doing modification lockout settings: ma nomod ro",'~'.expand("")) -" call Decho("restore: setl ma nomod noro",'~'.expand("")) setl ma ro nomod -" call Decho("restore: ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) endif endif call s:RestorePosn(s:netrw_posn) let @@= ykeep -" call Dret("s:NetrwBrowseChgDir <".dirname."> : curpos<".string(getpos(".")).">") return dirname endfun @@ -5224,19 +4905,16 @@ endfun " for thin, long, and wide: cursor placed just after banner " for tree, keeps cursor on current filename fun! s:NetrwBrowseUpDir(islocal) -" call Dfunc("s:NetrwBrowseUpDir(islocal=".a:islocal.")") if exists("w:netrw_bannercnt") && line(".") < w:netrw_bannercnt-1 " this test needed because occasionally this function seems to be incorrectly called " when multiple leftmouse clicks are taken when atop the one line help in the banner. " I'm allowing the very bottom line to permit a "-" exit so that one may escape empty " directories. -" call Dret("s:NetrwBrowseUpDir : cursor not in file area") return endif norm! 0 if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") -" call Decho("case: treestyle",'~'.expand("")) let curline= getline(".") let swwline= winline() - 1 if exists("w:netrw_treetop") @@ -5250,22 +4928,18 @@ fun! s:NetrwBrowseUpDir(islocal) let curfile = getline(".") let curpath = s:NetrwTreePath(w:netrw_treetop) if a:islocal - call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,'../')) + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,'../',0)) else - call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,'../')) + call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,'../',0)) endif -" call Decho("looking for curfile<^".s:treedepthstring.curfile.">",'~'.expand("")) -" call Decho("having curpath<".curpath.">",'~'.expand("")) if w:netrw_treetop == '/' keepj call search('^\M'.curfile,"w") elseif curfile == '../' keepj call search('^\M'.curfile,"wb") else -" call Decho("search(^\\M".s:treedepthstring.curfile.") backwards")) while 1 keepj call search('^\M'.s:treedepthstring.curfile,"wb") let treepath= s:NetrwTreePath(w:netrw_treetop) -" call Decho("..current treepath<".treepath.">",'~'.expand("")) if treepath == curpath break endif @@ -5273,7 +4947,6 @@ fun! s:NetrwBrowseUpDir(islocal) endif else -" call Decho("case: not treestyle",'~'.expand("")) call s:SavePosn(s:netrw_posn) if exists("b:netrw_curdir") let curdir= b:netrw_curdir @@ -5281,44 +4954,140 @@ fun! s:NetrwBrowseUpDir(islocal) let curdir= expand(getcwd()) endif if a:islocal - call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,'../')) + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,'../',0)) else - call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,'../')) + call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,'../',0)) endif call s:RestorePosn(s:netrw_posn) let curdir= substitute(curdir,'^.*[\/]','','') let curdir= '\<'. escape(curdir, '~'). '/' call search(curdir,'wc') endif -" call Dret("s:NetrwBrowseUpDir") endfun +func s:redir() + " set up redirection (avoids browser messages) + " by default if not set, g:netrw_suppress_gx_mesg is true + if get(g:, 'netrw_suppress_gx_mesg', 1) + if &srr =~# "%s" + return printf(&srr, has("win32") ? "nul" : "/dev/null") + else + return &srr .. (has("win32") ? "nul" : "/dev/null") + endif + endif + return '' +endfunc + +if has('unix') + if has('win32unix') + " Cygwin provides cygstart + if executable('cygstart') + fun! netrw#Launch(args) + exe 'silent ! cygstart --hide' a:args s:redir() | redraw! + endfun + elseif !empty($MSYSTEM) && executable('start') + " MSYS2/Git Bash comes by default without cygstart; see + " https://www.msys2.org/wiki/How-does-MSYS2-differ-from-Cygwin + " Instead it provides /usr/bin/start script running `cmd.exe //c start` + " Adding "" //b` sets void title, hides cmd window and blocks path conversion + " of /b to \b\ " by MSYS2; see https://www.msys2.org/docs/filesystem-paths/ + fun! netrw#Launch(args) + exe 'silent !start "" //b' a:args s:redir() | redraw! + endfun + else + " imitate /usr/bin/start script for other environments and hope for the best + fun! netrw#Launch(args) + exe 'silent !cmd //c start "" //b' a:args s:redir() | redraw! + endfun + endif + elseif exists('$WSL_DISTRO_NAME') " use cmd.exe to start GUI apps in WSL + fun! netrw#Launch(args) + let args = a:args + exe 'silent !' .. + \ ((args =~? '\v<\f+\.(exe|com|bat|cmd)>') ? + \ 'cmd.exe /c start /b ' .. args : + \ 'nohup ' .. args .. ' ' .. s:redir() .. ' &') + \ | redraw! + endfun + else + fun! netrw#Launch(args) + exe ':silent ! nohup' a:args s:redir() '&' | redraw! + endfun + endif +elseif has('win32') + fun! netrw#Launch(args) + exe 'silent !' .. (&shell =~? '\' ? '' : 'cmd.exe /c') + \ 'start "" /b' a:args s:redir() | redraw! + endfun +else + fun! netrw#Launch(dummy) + echom 'No common launcher found' + endfun +endif + +" Git Bash +if has('win32unix') + " (cyg)start suffices + let s:os_viewer = '' +" Windows / WSL +elseif executable('explorer.exe') + let s:os_viewer = 'explorer.exe' +" Linux / BSD +elseif executable('xdg-open') + let s:os_viewer = 'xdg-open' +" MacOS +elseif executable('open') + let s:os_viewer = 'open' +endif + +fun! s:viewer() + if exists('g:netrw_browsex_viewer') && executable(g:netrw_browsex_viewer) + " extract any viewing options. Assumes that they're set apart by spaces. + " call Decho("extract any viewing options from g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) + if g:netrw_browsex_viewer =~ '\s' + let viewer = substitute(g:netrw_browsex_viewer,'\s.*$','','') + let viewopt = substitute(g:netrw_browsex_viewer,'^\S\+\s*','','')." " + let oviewer = '' + let cnt = 1 + while !executable(viewer) && viewer != oviewer + let viewer = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\1','') + let viewopt = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\3','')." " + let cnt = cnt + 1 + let oviewer = viewer + " call Decho("!exe: viewer<".viewer."> viewopt<".viewopt.">",'~'.expand("")) + endwhile + else + let viewer = g:netrw_browsex_viewer + let viewopt = "" + endif + " call Decho("viewer<".viewer."> viewopt<".viewopt.">",'~'.expand("")) + return viewer .. ' ' .. viewopt + else + if !exists('s:os_viewer') + call netrw#ErrorMsg(s:ERROR,"No program to open this path found. See :help Open for more information.",106) + else + return s:os_viewer + endif + endif +endfun + +fun! netrw#Open(file) abort + call netrw#Launch(s:viewer() .. ' ' .. shellescape(a:file, 1)) +endf + +if !exists('g:netrw_regex_url') + let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}' +endif + " --------------------------------------------------------------------- " netrw#BrowseX: (implements "x" and "gx") executes a special "viewer" script or program for the {{{2 " given filename; typically this means given their extension. " 0=local, 1=remote fun! netrw#BrowseX(fname,remote) - let use_ctrlo= 1 -" call Dfunc("netrw#BrowseX(fname<".a:fname."> remote=".a:remote.") implements x and gx maps") - - if a:remote == 0 && isdirectory(a:fname) - " if its really just a local directory, then do a "gf" instead -" call Decho("remote≡0 and a:fname<".a:fname."> ".(isdirectory(a:fname)? "is a directory" : "is not a directory"),'~'.expand("")) -" call Decho("..appears to be a local directory; using e ".a:fname." instead",'~'.expand("")) - exe "e ".a:fname -" call Dret("netrw#BrowseX") - return - elseif a:remote == 1 && a:fname !~ '^https\=:' && a:fname =~ '/$' + if a:remote == 1 && a:fname !~ '^https\=:' && a:fname =~ '/$' " remote directory, not a webpage access, looks like an attempt to do a directory listing -" call Decho("remote≡1 and a:fname<".a:fname.">",'~'.expand("")) -" call Decho("..and fname ".((a:fname =~ '^https\=:')? 'matches' : 'does not match').'^https\=:','~'.expand("")) -" call Decho("..and fname ".((a:fname =~ '/$')? 'matches' : 'does not match').' /$','~'.expand("")) -" call Decho("..appears to be a remote directory listing request; using gf instead",'~'.expand("")) norm! gf -" call Dret("netrw#BrowseX") - return endif -" call Decho("not a local file nor a webpage request",'~'.expand("")) if exists("g:netrw_browsex_viewer") && exists("g:netrw_browsex_support_remote") && !g:netrw_browsex_support_remote let remote = a:remote @@ -5328,7 +5097,6 @@ fun! netrw#BrowseX(fname,remote) let ykeep = @@ let screenposn = winsaveview() -" call Decho("saving posn to screenposn<".string(screenposn).">",'~'.expand("")) " need to save and restore aw setting as gx can invoke this function from non-netrw buffers let awkeep = &aw @@ -5339,22 +5107,18 @@ fun! netrw#BrowseX(fname,remote) if exists("g:Netrw_corehandler") if type(g:Netrw_corehandler) == 2 " g:Netrw_corehandler is a function reference (see :help Funcref) -" call Decho("g:Netrw_corehandler is a funcref",'~'.expand("")) call g:Netrw_corehandler(s:NetrwFile(a:fname)) elseif type(g:Netrw_corehandler) == 3 " g:Netrw_corehandler is a List of function references (see :help Funcref) -" call Decho("g:Netrw_corehandler is a List",'~'.expand("")) for Fncref in g:Netrw_corehandler if type(Fncref) == 2 call Fncref(a:fname) endif endfor endif -" call Decho("restoring posn: screenposn<".string(screenposn).">,'~'.expand(""))" call winrestview(screenposn) let @@= ykeep let &aw= awkeep -" call Dret("netrw#BrowseX : coredump handler invoked") return endif endif @@ -5368,171 +5132,35 @@ fun! netrw#BrowseX(fname,remote) if exten =~ "[\\/]" let exten= "" endif -" call Decho("exten<".exten.">",'~'.expand("")) if remote == 1 " create a local copy -" call Decho("remote: remote=".remote.": create a local copy of <".a:fname.">",'~'.expand("")) setl bh=delete call netrw#NetRead(3,a:fname) " attempt to rename tempfile let basename= substitute(a:fname,'^\(.*\)/\(.*\)\.\([^.]*\)$','\2','') let newname = substitute(s:netrw_tmpfile,'^\(.*\)/\(.*\)\.\([^.]*\)$','\1/'.basename.'.\3','') -" call Decho("basename<".basename.">",'~'.expand("")) -" call Decho("newname <".newname.">",'~'.expand("")) if s:netrw_tmpfile != newname && newname != "" if rename(s:netrw_tmpfile,newname) == 0 " renaming succeeded -" call Decho("renaming succeeded (tmpfile<".s:netrw_tmpfile."> to <".newname.">)") let fname= newname else " renaming failed -" call Decho("renaming failed (tmpfile<".s:netrw_tmpfile."> to <".newname.">)") let fname= s:netrw_tmpfile endif else let fname= s:netrw_tmpfile endif else -" call Decho("local: remote=".remote.": handling local copy of <".a:fname.">",'~'.expand("")) let fname= a:fname " special ~ handler for local if fname =~ '^\~' && expand("$HOME") != "" -" call Decho('invoking special ~ handler','~'.expand("")) let fname= s:NetrwFile(substitute(fname,'^\~',expand("$HOME"),'')) endif endif -" call Decho("fname<".fname.">",'~'.expand("")) -" call Decho("exten<".exten."> "."netrwFileHandlers#NFH_".exten."():exists=".exists("*netrwFileHandlers#NFH_".exten),'~'.expand("")) - - " set up redirection (avoids browser messages) - " by default, g:netrw_suppress_gx_mesg is true - if g:netrw_suppress_gx_mesg - if &srr =~ "%s" - if has("win32") - let redir= substitute(&srr,"%s","nul","") - else - let redir= substitute(&srr,"%s","/dev/null","") - endif - elseif has("win32") - let redir= &srr . "nul" - else - let redir= &srr . "/dev/null" - endif - else - let redir= "" - endif -" call Decho("set up redirection: redir{".redir."} srr{".&srr."}",'~'.expand("")) - - " extract any viewing options. Assumes that they're set apart by spaces. - if exists("g:netrw_browsex_viewer") -" call Decho("extract any viewing options from g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) - if g:netrw_browsex_viewer =~ '\s' - let viewer = substitute(g:netrw_browsex_viewer,'\s.*$','','') - let viewopt = substitute(g:netrw_browsex_viewer,'^\S\+\s*','','')." " - let oviewer = '' - let cnt = 1 - while !executable(viewer) && viewer != oviewer - let viewer = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\1','') - let viewopt = substitute(g:netrw_browsex_viewer,'^\(\(^\S\+\s\+\)\{'.cnt.'}\S\+\)\(.*\)$','\3','')." " - let cnt = cnt + 1 - let oviewer = viewer -" call Decho("!exe: viewer<".viewer."> viewopt<".viewopt.">",'~'.expand("")) - endwhile - else - let viewer = g:netrw_browsex_viewer - let viewopt = "" - endif -" call Decho("viewer<".viewer."> viewopt<".viewopt.">",'~'.expand("")) - endif - - " execute the file handler -" call Decho("execute the file handler (if any)",'~'.expand("")) - if exists("g:netrw_browsex_viewer") && g:netrw_browsex_viewer == '-' -" call Decho("(netrw#BrowseX) g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) - let ret= netrwFileHandlers#Invoke(exten,fname) - - elseif exists("g:netrw_browsex_viewer") && executable(viewer) -" call Decho("(netrw#BrowseX) g:netrw_browsex_viewer<".g:netrw_browsex_viewer.">",'~'.expand("")) - call s:NetrwExe("sil !".viewer." ".viewopt.s:ShellEscape(fname,1).redir) - let ret= v:shell_error - - elseif has("win32") -" call Decho("(netrw#BrowseX) win".(has("win32")? "32" : "64"),'~'.expand("")) - if executable("start") - call s:NetrwExe('sil! !start rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(fname,1)) - elseif executable("rundll32") - call s:NetrwExe('sil! !rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(fname,1)) - else - call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74) - endif - let ret= v:shell_error - - elseif has("win32unix") - let winfname= 'c:\cygwin'.substitute(fname,'/','\\','g') -" call Decho("(netrw#BrowseX) cygwin: winfname<".s:ShellEscape(winfname,1).">",'~'.expand("")) - if executable("start") -" call Decho("(netrw#BrowseX) win32unix+start",'~'.expand("")) - call s:NetrwExe('sil !start rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(winfname,1)) - elseif executable("rundll32") -" call Decho("(netrw#BrowseX) win32unix+rundll32",'~'.expand("")) - call s:NetrwExe('sil !rundll32 url.dll,FileProtocolHandler '.s:ShellEscape(winfname,1)) - elseif executable("cygstart") -" call Decho("(netrw#BrowseX) win32unix+cygstart",'~'.expand("")) - call s:NetrwExe('sil !cygstart '.s:ShellEscape(fname,1)) - else - call netrw#ErrorMsg(s:WARNING,"rundll32 not on path",74) - endif - let ret= v:shell_error - elseif has("unix") && $DESKTOP_SESSION == "mate" && executable("atril") -" call Decho("(netrw#BrowseX) unix and atril",'~'.expand("")) - 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("fname<".fname.">") -" call Decho("a:fname<".a:fname.">") - call s:NetrwExe("sil! !gvim ".fname.' -c "keepj keepalt file '.fnameescape(a:fname).'"') - - else - call s:NetrwExe("sil !atril ".s:ShellEscape(fname,1).redir) - endif - let ret= v:shell_error - - elseif has("unix") && executable("kfmclient") && s:CheckIfKde() -" call Decho("(netrw#BrowseX) unix and kfmclient",'~'.expand("")) - call s:NetrwExe("sil !kfmclient exec ".s:ShellEscape(fname,1)." ".redir) - let ret= v:shell_error - - elseif has("unix") && executable("exo-open") && executable("xdg-open") && executable("setsid") -" call Decho("(netrw#BrowseX) unix, exo-open, xdg-open",'~'.expand("")) - call s:NetrwExe("sil !setsid xdg-open ".s:ShellEscape(fname,1).redir.'&') - let ret= v:shell_error - - elseif has("unix") && executable("xdg-open") -" call Decho("(netrw#BrowseX) unix and xdg-open",'~'.expand("")) - call s:NetrwExe("sil !xdg-open ".s:ShellEscape(fname,1).redir.'&') - let ret= v:shell_error - - elseif has("macunix") && executable("open") -" call Decho("(netrw#BrowseX) macunix and open",'~'.expand("")) - call s:NetrwExe("sil !open ".s:ShellEscape(fname,1)." ".redir) - let ret= v:shell_error - - else - " netrwFileHandlers#Invoke() always returns 0 -" call Decho("(netrw#BrowseX) use netrwFileHandlers",'~'.expand("")) - let ret= netrwFileHandlers#Invoke(exten,fname) - endif - - " if unsuccessful, attempt netrwFileHandlers#Invoke() - if ret -" call Decho("(netrw#BrowseX) ret=".ret," indicates unsuccessful thus far",'~'.expand("")) - let ret= netrwFileHandlers#Invoke(exten,fname) - endif - - " restoring redraw! after external file handlers - redraw! + " although shellescape(..., 1) is used in netrw#Open(), it's insufficient + call netrw#Open(escape(fname, '#%')) " cleanup: remove temporary file, " delete current buffer if success with handler, @@ -5540,7 +5168,6 @@ fun! netrw#BrowseX(fname,remote) " Feb 12, 2008: had to de-activate removal of " temporary file because it wasn't getting seen. " if remote == 1 && fname != a:fname -"" call Decho("deleting temporary file<".fname.">",'~'.expand("")) " call s:NetrwDelete(fname) " endif @@ -5549,16 +5176,11 @@ fun! netrw#BrowseX(fname,remote) if g:netrw_use_noswf setl noswf endif - if use_ctrlo - exe "sil! NetrwKeepj norm! \" - endif + exe "sil! NetrwKeepj norm! \" endif -" call Decho("restoring posn to screenposn<".string(screenposn).">",'~'.expand("")) call winrestview(screenposn) let @@ = ykeep let &aw= awkeep - -" call Dret("netrw#BrowseX") endfun " --------------------------------------------------------------------- @@ -5570,12 +5192,37 @@ fun! netrw#GX() if &ft == "netrw" let fname= s:NetrwGetWord() else - let fname= expand((exists("g:netrw_gx")? g:netrw_gx : '')) + let fname= exists("g:netrw_gx")? expand(g:netrw_gx) : s:GetURL() endif " call Dret("netrw#GX <".fname.">") return fname endfun +fun! s:GetURL() abort + let URL = '' + if exists('*Netrw_get_URL_' .. &filetype) + let URL = call('Netrw_get_URL_' .. &filetype, []) + endif + if !empty(URL) | return URL | endif + " URLs end in letter, digit or forward slash + let URL = matchstr(expand(""), '\<' .. g:netrw_regex_url .. '\ze[^A-Za-z0-9/]*$') + if !empty(URL) | return URL | endif + + " Is it a file in the current work dir ... + let file = expand("") + if filereadable(file) | return file | endif + " ... or in that of the current buffer? + let path = fnamemodify(expand('%'), ':p') + if isdirectory(path) + let dir = path + elseif filereadable(path) + let dir = fnamemodify(path, ':h') + endif + if exists('dir') && filereadable(dir..'/'..file) | return dir..'/'..file | endif + + return '' +endf + " --------------------------------------------------------------------- " netrw#BrowseXVis: used by gx in visual mode to select a file for browsing {{{2 fun! netrw#BrowseXVis() @@ -5645,23 +5292,20 @@ endfun " --------------------------------------------------------------------- " s:NetrwChgPerm: (implements "gp") change file permission {{{2 fun! s:NetrwChgPerm(islocal,curdir) -" call Dfunc("s:NetrwChgPerm(islocal=".a:islocal." curdir<".a:curdir.">)") let ykeep = @@ call inputsave() let newperm= input("Enter new permission: ") call inputrestore() let chgperm= substitute(g:netrw_chgperm,'\',s:ShellEscape(expand("")),'') let chgperm= substitute(chgperm,'\',s:ShellEscape(newperm),'') -" call Decho("chgperm<".chgperm.">",'~'.expand("")) call system(chgperm) if v:shell_error != 0 NetrwKeepj call netrw#ErrorMsg(1,"changing permission on file<".expand("")."> seems to have failed",75) endif if a:islocal - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) endif let @@= ykeep -" call Dret("s:NetrwChgPerm") endfun " --------------------------------------------------------------------- @@ -5742,8 +5386,6 @@ endfun " --------------------------------------------------------------------- " s:NetrwExploreListUniq: {{{2 fun! s:NetrwExploreListUniq(explist) -" call Dfunc("s:NetrwExploreListUniq(explist<".string(a:explist).">)") - " this assumes that the list is already sorted let newexplist= [] for member in a:explist @@ -5752,15 +5394,12 @@ fun! s:NetrwExploreListUniq(explist) let newexplist = newexplist + [ member ] endif endfor - -" call Dret("s:NetrwExploreListUniq newexplist<".string(newexplist).">") return newexplist endfun " --------------------------------------------------------------------- " s:NetrwForceChgDir: (gd support) Force treatment as a directory {{{2 fun! s:NetrwForceChgDir(islocal,newdir) -" call Dfunc("s:NetrwForceChgDir(islocal=".a:islocal." newdir<".a:newdir.">)") let ykeep= @@ if a:newdir !~ '/$' " ok, looks like force is needed to get directory-style treatment @@ -5771,15 +5410,13 @@ fun! s:NetrwForceChgDir(islocal,newdir) else let newdir= a:newdir.'/' endif -" call Decho("adjusting newdir<".newdir."> due to gd",'~'.expand("")) else " should already be getting treatment as a directory let newdir= a:newdir endif - let newdir= s:NetrwBrowseChgDir(a:islocal,newdir) + let newdir= s:NetrwBrowseChgDir(a:islocal,newdir,0) call s:NetrwBrowse(a:islocal,newdir) let @@= ykeep -" call Dret("s:NetrwForceChgDir") endfun " --------------------------------------------------------------------- @@ -5805,7 +5442,7 @@ fun! s:NetrwGlob(direntry,expr,pare) endif let w:netrw_liststyle= keep_liststyle else - let path= s:ComposePath(fnameescape(a:direntry),a:expr) + let path= s:ComposePath(fnameescape(a:direntry), a:expr) if has("win32") " escape [ so it is not detected as wildcard character, see :h wildcard let path= substitute(path, '[', '[[]', 'g') @@ -5819,25 +5456,22 @@ fun! s:NetrwGlob(direntry,expr,pare) let filelist= map(filelist,'substitute(v:val, "^.*/", "", "")') endif endif -" call Dret("s:NetrwGlob ".string(filelist)) return filelist endfun " --------------------------------------------------------------------- " s:NetrwForceFile: (gf support) Force treatment as a file {{{2 fun! s:NetrwForceFile(islocal,newfile) -" call Dfunc("s:NetrwForceFile(islocal=".a:islocal." newdir<".a:newfile.">)") if a:newfile =~ '[/@*=|\\]$' let newfile= substitute(a:newfile,'.$','','') else let newfile= a:newfile endif if a:islocal - call s:NetrwBrowseChgDir(a:islocal,newfile) + call s:NetrwBrowseChgDir(a:islocal,newfile,0) else - call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,newfile)) + call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,newfile,0)) endif -" call Dret("s:NetrwForceFile") endfun " --------------------------------------------------------------------- @@ -5848,24 +5482,18 @@ endfun " 1: show not-hidden files " 2: show hidden files only fun! s:NetrwHide(islocal) -" call Dfunc("NetrwHide(islocal=".a:islocal.") g:netrw_hide=".g:netrw_hide) let ykeep= @@ let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) if exists("s:netrwmarkfilelist_{bufnr('%')}") -" call Decho("((g:netrw_hide == 1)? "unhide" : "hide")." files in markfilelist<".string(s:netrwmarkfilelist_{bufnr("%")}).">",'~'.expand("")) -" call Decho("g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("")) " hide the files in the markfile list for fname in s:netrwmarkfilelist_{bufnr("%")} -" call Decho("match(g:netrw_list_hide<".g:netrw_list_hide.'> fname<\<'.fname.'\>>)='.match(g:netrw_list_hide,'\<'.fname.'\>')." l:isk=".&l:isk,'~'.expand("")) if match(g:netrw_list_hide,'\<'.fname.'\>') != -1 " remove fname from hiding list let g:netrw_list_hide= substitute(g:netrw_list_hide,'..\<'.escape(fname,g:netrw_fname_escape).'\>..','','') let g:netrw_list_hide= substitute(g:netrw_list_hide,',,',',','g') let g:netrw_list_hide= substitute(g:netrw_list_hide,'^,\|,$','','') -" call Decho("unhide: g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("")) else " append fname to hiding list if exists("g:netrw_list_hide") && g:netrw_list_hide != "" @@ -5873,7 +5501,6 @@ fun! s:NetrwHide(islocal) else let g:netrw_list_hide= '\<'.escape(fname,g:netrw_fname_escape).'\>' endif -" call Decho("hide: g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("")) endif endfor NetrwKeepj call s:NetrwUnmarkList(bufnr("%"),b:netrw_curdir) @@ -5887,64 +5514,49 @@ fun! s:NetrwHide(islocal) if g:netrw_hide && g:netrw_list_hide == "" NetrwKeepj call netrw#ErrorMsg(s:WARNING,"your hiding list is empty!",49) let @@= ykeep -" call Dret("NetrwHide") return endif endif - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) let @@= ykeep -" call Dret("NetrwHide") endfun " --------------------------------------------------------------------- " s:NetrwHideEdit: allows user to edit the file/directory hiding list {{{2 fun! s:NetrwHideEdit(islocal) -" call Dfunc("NetrwHideEdit(islocal=".a:islocal.")") - let ykeep= @@ " save current cursor position let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) " get new hiding list from user call inputsave() let newhide= input("Edit Hiding List: ",g:netrw_list_hide) call inputrestore() let g:netrw_list_hide= newhide -" call Decho("new g:netrw_list_hide<".g:netrw_list_hide.">",'~'.expand("")) " refresh the listing - sil NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./")) + sil NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,"./",0)) " restore cursor position -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) call winrestview(svpos) let @@= ykeep - -" call Dret("NetrwHideEdit") endfun " --------------------------------------------------------------------- " s:NetrwHidden: invoked by "gh" {{{2 fun! s:NetrwHidden(islocal) -" call Dfunc("s:NetrwHidden()") let ykeep= @@ " save current position let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) if g:netrw_list_hide =~ '\(^\|,\)\\(^\\|\\s\\s\\)\\zs\\.\\S\\+' " remove .file pattern from hiding list -" call Decho("remove .file pattern from hiding list",'~'.expand("")) let g:netrw_list_hide= substitute(g:netrw_list_hide,'\(^\|,\)\\(^\\|\\s\\s\\)\\zs\\.\\S\\+','','') elseif s:Strlen(g:netrw_list_hide) >= 1 -" call Decho("add .file pattern from hiding list",'~'.expand("")) let g:netrw_list_hide= g:netrw_list_hide . ',\(^\|\s\s\)\zs\.\S\+' else -" call Decho("set .file pattern as hiding list",'~'.expand("")) let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+' endif if g:netrw_list_hide =~ '^,' @@ -5952,11 +5564,9 @@ fun! s:NetrwHidden(islocal) endif " refresh screen and return to saved position - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) let @@= ykeep -" call Dret("s:NetrwHidden") endfun " --------------------------------------------------------------------- @@ -6006,7 +5616,6 @@ fun! s:NetrwLeftmouse(islocal) if &ft != "netrw" return endif -" call Dfunc("s:NetrwLeftmouse(islocal=".a:islocal.")") let ykeep= @@ " check if the status bar was clicked on instead of a file/directory name @@ -6018,36 +5627,30 @@ fun! s:NetrwLeftmouse(islocal) let mouse_lnum = v:mouse_lnum let wlastline = line('w$') let lastline = line('$') -" call Decho("v:mouse_lnum=".mouse_lnum." line(w$)=".wlastline." line($)=".lastline." v:mouse_win=".v:mouse_win." winnr#".winnr(),'~'.expand("")) -" call Decho("v:mouse_col =".v:mouse_col." col=".col(".")." wincol =".wincol()." winwidth =".winwidth(0),'~'.expand("")) if mouse_lnum >= wlastline + 1 || v:mouse_win != winnr() " appears to be a status bar leftmouse click let @@= ykeep -" call Dret("s:NetrwLeftmouse : detected a status bar leftmouse click") return endif " Dec 04, 2013: following test prevents leftmouse selection/deselection of directories and files in treelist mode " Windows are separated by vertical separator bars - but the mouse seems to be doing what it should when dragging that bar " without this test when its disabled. " May 26, 2014: edit file, :Lex, resize window -- causes refresh. Reinstated a modified test. See if problems develop. -" call Decho("v:mouse_col=".v:mouse_col." col#".col('.')." virtcol#".virtcol('.')." col($)#".col("$")." virtcol($)#".virtcol("$"),'~'.expand("")) if v:mouse_col > virtcol('.') let @@= ykeep -" call Dret("s:NetrwLeftmouse : detected a vertical separator bar leftmouse click") return endif if a:islocal if exists("b:netrw_curdir") - NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) + NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord(),1)) endif else if exists("b:netrw_curdir") - NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) + NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord(),1)) endif endif let @@= ykeep -" call Dret("s:NetrwLeftmouse") endfun " --------------------------------------------------------------------- @@ -6056,9 +5659,7 @@ fun! s:NetrwCLeftmouse(islocal) if &ft != "netrw" return endif -" call Dfunc("s:NetrwCLeftmouse(islocal=".a:islocal.")") call s:NetrwMarkFileTgt(a:islocal) -" call Dret("s:NetrwCLeftmouse") endfun " --------------------------------------------------------------------- @@ -6071,39 +5672,30 @@ fun! s:NetrwServerEdit(islocal,fname) " call Dfunc("s:NetrwServerEdit(islocal=".a:islocal.",fname<".a:fname.">)") let islocal = a:islocal%2 " =0: remote =1: local let ctrlr = a:islocal >= 2 " =0: not used =1: used -" call Decho("islocal=".islocal." ctrlr=".ctrlr,'~'.expand("")) if (islocal && isdirectory(s:NetrwFile(a:fname))) || (!islocal && a:fname =~ '/$') " handle directories in the local window -- not in the remote vim server " user must have closed the NETRWSERVER window. Treat as normal editing from netrw. -" call Decho("handling directory in client window",'~'.expand("")) let g:netrw_browse_split= 0 if exists("s:netrw_browse_split") && exists("s:netrw_browse_split_".winnr()) let g:netrw_browse_split= s:netrw_browse_split_{winnr()} unlet s:netrw_browse_split_{winnr()} endif - call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,a:fname)) -" call Dret("s:NetrwServerEdit") + call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,a:fname,0)) return endif -" call Decho("handling file in server window",'~'.expand("")) if has("clientserver") && executable("gvim") -" call Decho("has clientserver and gvim",'~'.expand("")) if exists("g:netrw_browse_split") && type(g:netrw_browse_split) == 3 -" call Decho("g:netrw_browse_split=".string(g:netrw_browse_split),'~'.expand("")) let srvrname = g:netrw_browse_split[0] let tabnum = g:netrw_browse_split[1] let winnum = g:netrw_browse_split[2] if serverlist() !~ '\<'.srvrname.'\>' -" call Decho("server not available; ctrlr=".ctrlr,'~'.expand("")) - if !ctrlr " user must have closed the server window and the user did not use , but " used something like . -" call Decho("user must have closed server AND did not use ctrl-r",'~'.expand("")) if exists("g:netrw_browse_split") unlet g:netrw_browse_split endif @@ -6111,50 +5703,40 @@ fun! s:NetrwServerEdit(islocal,fname) if exists("s:netrw_browse_split_".winnr()) let g:netrw_browse_split= s:netrw_browse_split_{winnr()} endif - call s:NetrwBrowseChgDir(islocal,a:fname) -" call Dret("s:NetrwServerEdit") + call s:NetrwBrowseChgDir(islocal,a:fname,0) return elseif has("win32") && executable("start") " start up remote netrw server under windows -" call Decho("starting up gvim server<".srvrname."> for windows",'~'.expand("")) call system("start gvim --servername ".srvrname) else " start up remote netrw server under linux -" call Decho("starting up gvim server<".srvrname.">",'~'.expand("")) call system("gvim --servername ".srvrname) endif endif -" call Decho("srvrname<".srvrname."> tabnum=".tabnum." winnum=".winnum." server-editing<".a:fname.">",'~'.expand("")) call remote_send(srvrname,":tabn ".tabnum."\") call remote_send(srvrname,":".winnum."wincmd w\") call remote_send(srvrname,":e ".fnameescape(s:NetrwFile(a:fname))."\") - else if serverlist() !~ '\<'.g:netrw_servername.'\>' if !ctrlr -" call Decho("server<".g:netrw_servername."> not available and ctrl-r not used",'~'.expand("")) if exists("g:netrw_browse_split") unlet g:netrw_browse_split endif let g:netrw_browse_split= 0 - call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,a:fname)) -" call Dret("s:NetrwServerEdit") + call s:NetrwBrowse(islocal,s:NetrwBrowseChgDir(islocal,a:fname,0)) return else -" call Decho("server<".g:netrw_servername."> not available but ctrl-r used",'~'.expand("")) if has("win32") && executable("start") " start up remote netrw server under windows -" call Decho("starting up gvim server<".g:netrw_servername."> for windows",'~'.expand("")) call system("start gvim --servername ".g:netrw_servername) else " start up remote netrw server under linux -" call Decho("starting up gvim server<".g:netrw_servername.">",'~'.expand("")) call system("gvim --servername ".g:netrw_servername) endif endif @@ -6162,7 +5744,6 @@ fun! s:NetrwServerEdit(islocal,fname) while 1 try -" call Decho("remote-send: e ".a:fname,'~'.expand("")) call remote_send(g:netrw_servername,":e ".fnameescape(s:NetrwFile(a:fname))."\") break catch /^Vim\%((\a\+)\)\=:E241/ @@ -6183,7 +5764,6 @@ fun! s:NetrwServerEdit(islocal,fname) call netrw#ErrorMsg(s:ERROR,"you need a gui-capable vim and client-server to use ",98) endif -" call Dret("s:NetrwServerEdit") endfun " --------------------------------------------------------------------- @@ -6307,7 +5887,6 @@ endfun " s:NetrwMakeDir: this function makes a directory (both local and remote) {{{2 " implements the "d" mapping. fun! s:NetrwMakeDir(usrhost) -" call Dfunc("s:NetrwMakeDir(usrhost<".a:usrhost.">)") let ykeep= @@ " get name of new directory from user. A bare will skip. @@ -6316,27 +5895,22 @@ fun! s:NetrwMakeDir(usrhost) call inputsave() let newdirname= input("Please give directory name: ") call inputrestore() -" call Decho("newdirname<".newdirname.">",'~'.expand("")) if newdirname == "" let @@= ykeep -" call Dret("s:NetrwMakeDir : user aborted with bare ") return endif if a:usrhost == "" -" call Decho("local mkdir",'~'.expand("")) " Local mkdir: " sanity checks let fullnewdir= b:netrw_curdir.'/'.newdirname -" call Decho("fullnewdir<".fullnewdir.">",'~'.expand("")) if isdirectory(s:NetrwFile(fullnewdir)) if !exists("g:netrw_quiet") NetrwKeepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a directory!",24) endif let @@= ykeep -" call Dret("s:NetrwMakeDir : directory<".newdirname."> exists previously") return endif if s:FileReadable(fullnewdir) @@ -6344,7 +5918,6 @@ fun! s:NetrwMakeDir(usrhost) NetrwKeepj call netrw#ErrorMsg(s:WARNING,"<".newdirname."> is already a file!",25) endif let @@= ykeep -" call Dret("s:NetrwMakeDir : file<".newdirname."> exists previously") return endif @@ -6359,21 +5932,16 @@ fun! s:NetrwMakeDir(usrhost) else let netrw_origdir= s:NetrwGetcwd(1) if s:NetrwLcd(b:netrw_curdir) -" call Dret("s:NetrwMakeDir : lcd failure") return endif -" call Decho("netrw_origdir<".netrw_origdir.">: lcd b:netrw_curdir<".fnameescape(b:netrw_curdir).">",'~'.expand("")) call s:NetrwExe("sil! !".g:netrw_localmkdir.g:netrw_localmkdiropt.' '.s:ShellEscape(newdirname,1)) if v:shell_error != 0 let @@= ykeep call netrw#ErrorMsg(s:ERROR,"consider setting g:netrw_localmkdir<".g:netrw_localmkdir."> to something that works",80) -" call Dret("s:NetrwMakeDir : failed: sil! !".g:netrw_localmkdir.' '.s:ShellEscape(newdirname,1)) return endif if !g:netrw_keepdir -" call Decho("restoring netrw_origdir since g:netrw_keepdir=".g:netrw_keepdir,'~'.expand("")) if s:NetrwLcd(netrw_origdir) -" call Dret("s:NetrwBrowse : lcd failure") return endif endif @@ -6381,126 +5949,95 @@ fun! s:NetrwMakeDir(usrhost) if v:shell_error == 0 " refresh listing -" call Decho("refresh listing",'~'.expand("")) let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) - call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./',0)) call winrestview(svpos) elseif !exists("g:netrw_quiet") call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",26) endif -" redraw! elseif !exists("b:netrw_method") || b:netrw_method == 4 " Remote mkdir: using ssh -" call Decho("remote mkdir",'~'.expand("")) let mkdircmd = s:MakeSshCmd(g:netrw_mkdir_cmd) let newdirname= substitute(b:netrw_curdir,'^\%(.\{-}/\)\{3}\(.*\)$','\1','').newdirname call s:NetrwExe("sil! !".mkdircmd." ".s:ShellEscape(newdirname,1)) if v:shell_error == 0 " refresh listing let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) - NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./',0)) NetrwKeepj call winrestview(svpos) elseif !exists("g:netrw_quiet") NetrwKeepj call netrw#ErrorMsg(s:ERROR,"unable to make directory<".newdirname.">",27) endif -" redraw! elseif b:netrw_method == 2 " Remote mkdir: using ftp+.netrc let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) -" call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("")) if exists("b:netrw_fname") -" call Decho("b:netrw_fname<".b:netrw_fname.">",'~'.expand("")) let remotepath= b:netrw_fname else let remotepath= "" endif call s:NetrwRemoteFtpCmd(remotepath,g:netrw_remote_mkdir.' "'.newdirname.'"') - NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./',0)) NetrwKeepj call winrestview(svpos) elseif b:netrw_method == 3 " Remote mkdir: using ftp + machine, id, passwd, and fname (ie. no .netrc) let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) -" call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("")) if exists("b:netrw_fname") -" call Decho("b:netrw_fname<".b:netrw_fname.">",'~'.expand("")) let remotepath= b:netrw_fname else let remotepath= "" endif call s:NetrwRemoteFtpCmd(remotepath,g:netrw_remote_mkdir.' "'.newdirname.'"') - NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./',0)) NetrwKeepj call winrestview(svpos) endif let @@= ykeep -" call Dret("s:NetrwMakeDir") endfun " --------------------------------------------------------------------- " s:TreeSqueezeDir: allows a shift-cr (gvim only) to squeeze the current tree-listing directory {{{2 fun! s:TreeSqueezeDir(islocal) -" call Dfunc("s:TreeSqueezeDir(islocal=".a:islocal.")") if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treedict") " its a tree-listing style let curdepth = substitute(getline('.'),'^\(\%('.s:treedepthstring.'\)*\)[^'.s:treedepthstring.'].\{-}$','\1','e') let stopline = (exists("w:netrw_bannercnt")? (w:netrw_bannercnt + 1) : 1) let depth = strchars(substitute(curdepth,' ','','g')) let srch = -1 -" call Decho("curdepth<".curdepth.'>','~'.expand("")) -" call Decho("depth =".depth,'~'.expand("")) -" call Decho("stopline#".stopline,'~'.expand("")) -" call Decho("curline#".line(".")."<".getline('.').'>','~'.expand("")) if depth >= 2 NetrwKeepj norm! 0 let curdepthm1= substitute(curdepth,'^'.s:treedepthstring,'','') let srch = search('^'.curdepthm1.'\%('.s:treedepthstring.'\)\@!','bW',stopline) -" call Decho("curdepthm1<".curdepthm1.'>','~'.expand("")) -" call Decho("case depth>=2: srch<".srch.'>','~'.expand("")) elseif depth == 1 NetrwKeepj norm! 0 let treedepthchr= substitute(s:treedepthstring,' ','','') let srch = search('^[^'.treedepthchr.']','bW',stopline) -" call Decho("case depth==1: srch<".srch.'>','~'.expand("")) endif if srch > 0 -" call Decho("squeezing at line#".line(".").": ".getline('.'),'~'.expand("")) - call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,s:NetrwGetWord())) + call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,s:NetrwGetWord(),1)) exe srch endif endif -" call Dret("s:TreeSqueezeDir") endfun " --------------------------------------------------------------------- " s:NetrwMaps: {{{2 fun! s:NetrwMaps(islocal) -" call Dfunc("s:NetrwMaps(islocal=".a:islocal.") b:netrw_curdir<".b:netrw_curdir.">") " mouse maps: {{{3 if g:netrw_mousemaps && g:netrw_retmap " call Decho("set up Rexplore 2-leftmouse",'~'.expand("")) if !hasmapto("NetrwReturn") if maparg("<2-leftmouse>","n") == "" || maparg("<2-leftmouse>","n") =~ '^-$' -" call Decho("making map for 2-leftmouse",'~'.expand("")) nmap <2-leftmouse> NetrwReturn elseif maparg("","n") == "" -" call Decho("making map for c-leftmouse",'~'.expand("")) nmap NetrwReturn endif endif nno NetrwReturn :Rexplore -" call Decho("made NetrwReturn map",'~'.expand("")) endif " generate default maps {{{3 @@ -6516,57 +6053,8 @@ fun! s:NetrwMaps(islocal) if !hasmapto('NetrwServerEdit') |nmap NetrwServerEdit|endif if !hasmapto('NetrwMakeDir') |nmap d NetrwMakeDir|endif if !hasmapto('NetrwBookHistHandler_gb')|nmap gb NetrwBookHistHandler_gb|endif -" --------------------------------------------------------------------- -" if !hasmapto('NetrwForceChgDir') |nmap gd NetrwForceChgDir|endif -" if !hasmapto('NetrwForceFile') |nmap gf NetrwForceFile|endif -" if !hasmapto('NetrwHidden') |nmap gh NetrwHidden|endif -" if !hasmapto('NetrwSetTreetop') |nmap gn NetrwSetTreetop|endif -" if !hasmapto('NetrwChgPerm') |nmap gp NetrwChgPerm|endif -" if !hasmapto('NetrwBannerCtrl') |nmap I NetrwBannerCtrl|endif -" if !hasmapto('NetrwListStyle') |nmap i NetrwListStyle|endif -" if !hasmapto('NetrwMarkMoveMF2Arglist')|nmap ma NetrwMarkMoveMF2Arglist|endif -" if !hasmapto('NetrwMarkMoveArglist2MF')|nmap mA NetrwMarkMoveArglist2MF|endif -" if !hasmapto('NetrwBookHistHandler_mA')|nmap mb NetrwBookHistHandler_mA|endif -" if !hasmapto('NetrwBookHistHandler_mB')|nmap mB NetrwBookHistHandler_mB|endif -" if !hasmapto('NetrwMarkFileCopy') |nmap mc NetrwMarkFileCopy|endif -" if !hasmapto('NetrwMarkFileDiff') |nmap md NetrwMarkFileDiff|endif -" if !hasmapto('NetrwMarkFileEdit') |nmap me NetrwMarkFileEdit|endif -" if !hasmapto('NetrwMarkFile') |nmap mf NetrwMarkFile|endif -" if !hasmapto('NetrwUnmarkList') |nmap mF NetrwUnmarkList|endif -" if !hasmapto('NetrwMarkFileGrep') |nmap mg NetrwMarkFileGrep|endif -" if !hasmapto('NetrwMarkHideSfx') |nmap mh NetrwMarkHideSfx|endif -" if !hasmapto('NetrwMarkFileMove') |nmap mm NetrwMarkFileMove|endif -" if !hasmapto('NetrwMarkFilePrint') |nmap mp NetrwMarkFilePrint|endif -" if !hasmapto('NetrwMarkFileRegexp') |nmap mr NetrwMarkFileRegexp|endif -" if !hasmapto('NetrwMarkFileSource') |nmap ms NetrwMarkFileSource|endif -" if !hasmapto('NetrwMarkFileTag') |nmap mT NetrwMarkFileTag|endif -" if !hasmapto('NetrwMarkFileTgt') |nmap mt NetrwMarkFileTgt|endif -" if !hasmapto('NetrwUnMarkFile') |nmap mu NetrwUnMarkFile|endif -" if !hasmapto('NetrwMarkFileVimCmd') |nmap mv NetrwMarkFileVimCmd|endif -" if !hasmapto('NetrwMarkFileExe_mx') |nmap mx NetrwMarkFileExe_mx|endif -" if !hasmapto('NetrwMarkFileExe_mX') |nmap mX NetrwMarkFileExe_mX|endif -" if !hasmapto('NetrwMarkFileCompress') |nmap mz NetrwMarkFileCompress|endif -" if !hasmapto('NetrwObtain') |nmap O NetrwObtain|endif -" if !hasmapto('NetrwSplit_o') |nmap o NetrwSplit_o|endif -" if !hasmapto('NetrwPreview') |nmap p NetrwPreview|endif -" if !hasmapto('NetrwPrevWinOpen') |nmap P NetrwPrevWinOpen|endif -" if !hasmapto('NetrwBookHistHandler_qb')|nmap qb NetrwBookHistHandler_qb|endif -" if !hasmapto('NetrwFileInfo') |nmap qf NetrwFileInfo|endif -" if !hasmapto('NetrwMarkFileQFEL_qF') |nmap qF NetrwMarkFileQFEL_qF|endif -" if !hasmapto('NetrwMarkFileQFEL_qL') |nmap qL NetrwMarkFileQFEL_qL|endif -" if !hasmapto('NetrwSortStyle') |nmap s NetrwSortStyle|endif -" if !hasmapto('NetSortSequence') |nmap S NetSortSequence|endif -" if !hasmapto('NetrwSetTgt_Tb') |nmap Tb NetrwSetTgt_Tb|endif -" if !hasmapto('NetrwSetTgt_Th') |nmap Th NetrwSetTgt_Th|endif -" if !hasmapto('NetrwSplit_t') |nmap t NetrwSplit_t|endif -" if !hasmapto('NetrwBookHistHandler_u') |nmap u NetrwBookHistHandler_u|endif -" if !hasmapto('NetrwBookHistHandler_U') |nmap U NetrwBookHistHandler_U|endif -" if !hasmapto('NetrwSplit_v') |nmap v NetrwSplit_v|endif -" if !hasmapto('NetrwBrowseX') |nmap x NetrwBrowseX|endif -" if !hasmapto('NetrwLocalExecute') |nmap X NetrwLocalExecute|endif if a:islocal -" call Decho("make local maps",'~'.expand("")) " local normal-mode maps {{{3 nnoremap NetrwHide_a :call NetrwHide(1) nnoremap NetrwBrowseUpDir :call NetrwBrowseUpDir(1) @@ -6575,7 +6063,7 @@ fun! s:NetrwMaps(islocal) nnoremap NetrwBadd_cB :call NetrwBadd(1,1) nnoremap NetrwLcd :call NetrwLcd(b:netrw_curdir) nnoremap NetrwSetChgwin :call NetrwSetChgwin() - nnoremap NetrwLocalBrowseCheck :call netrw#LocalBrowseCheck(NetrwBrowseChgDir(1,NetrwGetWord())) + nnoremap NetrwLocalBrowseCheck :call netrw#LocalBrowseCheck(NetrwBrowseChgDir(1,NetrwGetWord(),1)) nnoremap NetrwServerEdit :call NetrwServerEdit(3,NetrwGetWord()) nnoremap NetrwMakeDir :call NetrwMakeDir("") nnoremap NetrwBookHistHandler_gb :call NetrwBookHistHandler(1,b:netrw_curdir) @@ -6611,7 +6099,7 @@ fun! s:NetrwMaps(islocal) nnoremap mz :call NetrwMarkFileCompress(1) nnoremap O :call NetrwObtain(1) nnoremap o :call NetrwSplit(3) - nnoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1)) + nnoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1,1)) nnoremap P :call NetrwPrevWinOpen(1) nnoremap qb :call NetrwBookHistHandler(2,b:netrw_curdir) nnoremap qf :call NetrwFileInfo(1,NetrwGetWord()) @@ -6625,10 +6113,10 @@ fun! s:NetrwMaps(islocal) nnoremap u :call NetrwBookHistHandler(4,expand("%")) nnoremap U :call NetrwBookHistHandler(5,expand("%")) nnoremap v :call NetrwSplit(5) - nnoremap x :call netrw#BrowseX(NetrwBrowseChgDir(1,NetrwGetWord(),0),0)" + nnoremap x :call netrw#BrowseX(NetrwBrowseChgDir(1,NetrwGetWord(),1,0),0)" nnoremap X :call NetrwLocalExecute(expand(""))" - nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~# 'n')? 'r' : 'n'exe "norm! 0"call NetrwRefresh(1,NetrwBrowseChgDir(1,'./')) + nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~# 'n')? 'r' : 'n'exe "norm! 0"call NetrwRefresh(1,NetrwBrowseChgDir(1,'./',0)) if !hasmapto('NetrwHideEdit') nmap NetrwHideEdit endif @@ -6636,7 +6124,7 @@ fun! s:NetrwMaps(islocal) if !hasmapto('NetrwRefresh') nmap NetrwRefresh endif - nnoremap NetrwRefresh :call NetrwRefresh(1,NetrwBrowseChgDir(1,(exists("w:netrw_liststyle") && exists("w:netrw_treetop") && w:netrw_liststyle == 3)? w:netrw_treetop : './')) + nnoremap NetrwRefresh :call NetrwRefresh(1,NetrwBrowseChgDir(1,(exists("w:netrw_liststyle") && exists("w:netrw_treetop") && w:netrw_liststyle == 3)? w:netrw_treetop : './',0)) if s:didstarstar || !mapcheck("","n") nnoremap :Nexplore endif @@ -6680,7 +6168,6 @@ fun! s:NetrwMaps(islocal) else " remote normal-mode maps {{{3 -" call Decho("make remote maps",'~'.expand("")) call s:RemotePathAnalysis(b:netrw_curdir) nnoremap NetrwHide_a :call NetrwHide(0) nnoremap NetrwBrowseUpDir :call NetrwBrowseUpDir(0) @@ -6689,8 +6176,8 @@ fun! s:NetrwMaps(islocal) nnoremap NetrwBadd_cB :call NetrwBadd(0,1) nnoremap NetrwLcd :call NetrwLcd(b:netrw_curdir) nnoremap NetrwSetChgwin :call NetrwSetChgwin() - nnoremap NetrwRefresh :call NetrwRefresh(0,NetrwBrowseChgDir(0,'./')) - nnoremap NetrwLocalBrowseCheck :call NetrwBrowse(0,NetrwBrowseChgDir(0,NetrwGetWord())) + nnoremap NetrwRefresh :call NetrwRefresh(0,NetrwBrowseChgDir(0,'./',0)) + nnoremap NetrwLocalBrowseCheck :call NetrwBrowse(0,NetrwBrowseChgDir(0,NetrwGetWord(),1)) nnoremap NetrwServerEdit :call NetrwServerEdit(2,NetrwGetWord()) nnoremap NetrwBookHistHandler_gb :call NetrwBookHistHandler(1,b:netrw_curdir) " --------------------------------------------------------------------- @@ -6724,13 +6211,13 @@ fun! s:NetrwMaps(islocal) nnoremap mz :call NetrwMarkFileCompress(0) nnoremap O :call NetrwObtain(0) nnoremap o :call NetrwSplit(0) - nnoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1)) + nnoremap p :call NetrwPreview(NetrwBrowseChgDir(1,NetrwGetWord(),1,1)) nnoremap P :call NetrwPrevWinOpen(0) nnoremap qb :call NetrwBookHistHandler(2,b:netrw_curdir) nnoremap qf :call NetrwFileInfo(0,NetrwGetWord()) nnoremap qF :call NetrwMarkFileQFEL(0,getqflist()) nnoremap qL :call NetrwMarkFileQFEL(0,getloclist(v:count)) - nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~# 'n')? 'r' : 'n'exe "norm! 0"call NetrwBrowse(0,NetrwBrowseChgDir(0,'./')) + nnoremap r :let g:netrw_sort_direction= (g:netrw_sort_direction =~# 'n')? 'r' : 'n'exe "norm! 0"call NetrwBrowse(0,NetrwBrowseChgDir(0,'./',0)) nnoremap s :call NetrwSortStyle(0) nnoremap S :call NetSortSequence(0) nnoremap Tb :call NetrwSetTgt(0,'b',v:count1) @@ -6739,7 +6226,8 @@ fun! s:NetrwMaps(islocal) nnoremap u :call NetrwBookHistHandler(4,b:netrw_curdir) nnoremap U :call NetrwBookHistHandler(5,b:netrw_curdir) nnoremap v :call NetrwSplit(2) - nnoremap x :call netrw#BrowseX(NetrwBrowseChgDir(0,NetrwGetWord()),1) + nnoremap x :call netrw#BrowseX(NetrwBrowseChgDir(0,NetrwGetWord(),1),1) + nmap gx x if !hasmapto('NetrwHideEdit') nmap NetrwHideEdit endif @@ -6755,7 +6243,7 @@ fun! s:NetrwMaps(islocal) let mapsafepath = escape(s:path, s:netrw_map_escape) let mapsafeusermach = escape(((s:user == "")? "" : s:user."@").s:machine, s:netrw_map_escape) - nnoremap NetrwRefresh :call NetrwRefresh(0,NetrwBrowseChgDir(0,'./')) + nnoremap NetrwRefresh :call NetrwRefresh(0,NetrwBrowseChgDir(0,'./',0)) if g:netrw_mousemaps == 1 nmap NetrwLeftmouse nno NetrwLeftmouse :exec "norm! \leftmouse>"call NetrwLeftmouse(0) @@ -6787,8 +6275,6 @@ fun! s:NetrwMaps(islocal) " support user-specified maps call netrw#UserMaps(0) endif " }}}3 - -" call Dret("s:NetrwMaps") endfun " --------------------------------------------------------------------- @@ -6842,7 +6328,6 @@ endfun " --------------------------------------------------------------------- " s:NetrwMarkTarget: implements :MT (mark target) {{{2 fun! s:NetrwMarkTarget(...) -" call Dfunc("s:NetrwMarkTarget() a:0=".a:0) if a:0 == 0 || (a:0 == 1 && a:1 == "") let curdir = s:NetrwGetCurdir(1) let tgt = b:netrw_curdir @@ -6850,16 +6335,12 @@ fun! s:NetrwMarkTarget(...) let curdir = s:NetrwGetCurdir((a:1 =~ '^\a\{3,}://')? 0 : 1) let tgt = a:1 endif -" call Decho("tgt<".tgt.">",'~'.expand("")) let s:netrwmftgt = tgt let s:netrwmftgt_islocal = tgt !~ '^\a\{3,}://' let curislocal = b:netrw_curdir !~ '^\a\{3,}://' let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) - call s:NetrwRefresh(curislocal,s:NetrwBrowseChgDir(curislocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + call s:NetrwRefresh(curislocal,s:NetrwBrowseChgDir(curislocal,'./',0)) call winrestview(svpos) -" call Dret("s:NetrwMarkTarget") endfun " --------------------------------------------------------------------- @@ -7002,10 +6483,7 @@ endfun " mA: move the argument list to marked file list (tomflist=1) " Uses the global marked file list fun! s:NetrwMarkFileArgList(islocal,tomflist) -" call Dfunc("s:NetrwMarkFileArgList(islocal=".a:islocal.",tomflist=".a:tomflist.")") - let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curdir = s:NetrwGetCurdir(a:islocal) let curbufnr = bufnr("%") @@ -7013,7 +6491,6 @@ fun! s:NetrwMarkFileArgList(islocal,tomflist) " mA: move argument list to marked file list while argc() let fname= argv(0) -" call Decho("exe argdel ".fname,'~'.expand("")) exe "argdel ".fnameescape(fname) call s:NetrwMarkFile(a:islocal,fname) endwhile @@ -7024,19 +6501,16 @@ fun! s:NetrwMarkFileArgList(islocal,tomflist) " for every filename in the marked list for fname in s:netrwmarkfilelist -" call Decho("exe argadd ".fname,'~'.expand("")) exe "argadd ".fnameescape(fname) endfor " for every file in the marked list " unmark list and refresh call s:NetrwUnmarkList(curbufnr,curdir) - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) endif endif -" call Dret("s:NetrwMarkFileArgList") endfun " --------------------------------------------------------------------- @@ -7048,30 +6522,24 @@ endfun " g:netrw_compress = "gzip" " g:netrw_decompress = { ".gz" : "gunzip" , ".bz2" : "bunzip2" , ".zip" : "unzip" , ".tar" : "tar -xf", ".xz" : "unxz"} fun! s:NetrwMarkFileCompress(islocal) -" call Dfunc("s:NetrwMarkFileCompress(islocal=".a:islocal.")") let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curdir = s:NetrwGetCurdir(a:islocal) let curbufnr = bufnr("%") " sanity check if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr}) NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66) -" call Dret("s:NetrwMarkFileCompress") return endif -" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("")) if exists("s:netrwmarkfilelist_{curbufnr}") && exists("g:netrw_compress") && exists("g:netrw_decompress") " for every filename in the marked list for fname in s:netrwmarkfilelist_{curbufnr} let sfx= substitute(fname,'^.\{-}\(\.\a\+\)$','\1','') -" call Decho("extracted sfx<".sfx.">",'~'.expand("")) if exists("g:netrw_decompress['".sfx."']") " fname has a suffix indicating that its compressed; apply associated decompression routine let exe= g:netrw_decompress[sfx] -" call Decho("fname<".fname."> is compressed so decompress with <".exe.">",'~'.expand("")) let exe= netrw#WinPath(exe) if a:islocal if g:netrw_keepdir @@ -7104,11 +6572,9 @@ fun! s:NetrwMarkFileCompress(islocal) endfor " for every file in the marked list call s:NetrwUnmarkList(curbufnr,curdir) - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) endif -" call Dret("s:NetrwMarkFileCompress") endfun " --------------------------------------------------------------------- @@ -7448,9 +6914,7 @@ endfun " mx enbloc=0: Uses the local marked-file list, applies command to each file individually " mX enbloc=1: Uses the global marked-file list, applies command to entire list fun! s:NetrwMarkFileExe(islocal,enbloc) -" call Dfunc("s:NetrwMarkFileExe(islocal=".a:islocal.",enbloc=".a:enbloc.")") let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curdir = s:NetrwGetCurdir(a:islocal) let curbufnr = bufnr("%") @@ -7459,19 +6923,15 @@ fun! s:NetrwMarkFileExe(islocal,enbloc) " sanity check if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr}) NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66) -" call Dret("s:NetrwMarkFileExe") return endif -" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("")) if exists("s:netrwmarkfilelist_{curbufnr}") " get the command call inputsave() let cmd= input("Enter command: ","","file") call inputrestore() -" call Decho("cmd<".cmd.">",'~'.expand("")) if cmd == "" -" call Dret("s:NetrwMarkFileExe : early exit, empty command") return endif @@ -7491,10 +6951,8 @@ fun! s:NetrwMarkFileExe(islocal,enbloc) let xcmd= cmd.' '.fname endif if a:islocal -" call Decho("local: xcmd<".xcmd.">",'~'.expand("")) let ret= system(xcmd) else -" call Decho("remote: xcmd<".xcmd.">",'~'.expand("")) let ret= s:RemoteSystem(xcmd) endif if v:shell_error < 0 @@ -7515,8 +6973,7 @@ fun! s:NetrwMarkFileExe(islocal,enbloc) call s:NetrwUnmarkList(curbufnr,curdir) " refresh the listing - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) else NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59) @@ -7527,9 +6984,7 @@ fun! s:NetrwMarkFileExe(islocal,enbloc) call inputsave() let cmd= input("Enter command: ","","file") call inputrestore() -" call Decho("cmd<".cmd.">",'~'.expand("")) if cmd == "" -" call Dret("s:NetrwMarkFileExe : early exit, empty command") return endif if cmd =~ '%' @@ -7548,13 +7003,10 @@ fun! s:NetrwMarkFileExe(islocal,enbloc) call s:NetrwUnmarkAll() " refresh the listing - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) endif - -" call Dret("s:NetrwMarkFileExe") endfun " --------------------------------------------------------------------- @@ -7562,16 +7014,13 @@ endfun " as the marked file(s) (toggles suffix presence) " Uses the local marked file list. fun! s:NetrwMarkHideSfx(islocal) -" call Dfunc("s:NetrwMarkHideSfx(islocal=".a:islocal.")") let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curbufnr = bufnr("%") " s:netrwmarkfilelist_{curbufnr}: the List of marked files if exists("s:netrwmarkfilelist_{curbufnr}") for fname in s:netrwmarkfilelist_{curbufnr} -" call Decho("s:NetrwMarkFileCopy: fname<".fname.">",'~'.expand("")) " construct suffix pattern if fname =~ '\.' let sfxpat= "^.*".substitute(fname,'^.*\(\.[^. ]\+\)$','\1','') @@ -7591,7 +7040,6 @@ fun! s:NetrwMarkHideSfx(islocal) let itemnum= itemnum + 1 endfor endif -" call Decho("fname<".fname."> inhidelist=".inhidelist." sfxpat<".sfxpat.">",'~'.expand("")) if inhidelist " remove sfxpat from list call remove(hidelist,itemnum) @@ -7606,57 +7054,45 @@ fun! s:NetrwMarkHideSfx(islocal) endfor " refresh the listing - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) else NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59) endif - -" call Dret("s:NetrwMarkHideSfx") endfun " --------------------------------------------------------------------- " s:NetrwMarkFileVimCmd: (invoked by mv) execute arbitrary vim command on marked files, one at a time {{{2 " Uses the local marked-file list. fun! s:NetrwMarkFileVimCmd(islocal) -" call Dfunc("s:NetrwMarkFileVimCmd(islocal=".a:islocal.")") let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curdir = s:NetrwGetCurdir(a:islocal) let curbufnr = bufnr("%") " sanity check if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr}) NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66) -" call Dret("s:NetrwMarkFileVimCmd") return endif -" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("")) if exists("s:netrwmarkfilelist_{curbufnr}") " get the command call inputsave() let cmd= input("Enter vim command: ","","file") call inputrestore() -" call Decho("cmd<".cmd.">",'~'.expand("")) if cmd == "" -" " call Dret("s:NetrwMarkFileVimCmd : early exit, empty command") return endif " apply command to marked files. Substitute: filename -> % " If no %, then append a space and the filename to the command for fname in s:netrwmarkfilelist_{curbufnr} -" call Decho("fname<".fname.">",'~'.expand("")) if a:islocal 1split exe "sil! NetrwKeepj keepalt e ".fnameescape(fname) -" call Decho("local<".fname.">: exe ".cmd,'~'.expand("")) exe cmd exe "sil! keepalt wq!" else -" call Decho("remote<".fname.">: exe ".cmd." : NOT SUPPORTED YET",'~'.expand("")) echo "sorry, \"mv\" not supported yet for remote files" endif endfor @@ -7665,14 +7101,11 @@ fun! s:NetrwMarkFileVimCmd(islocal) call s:NetrwUnmarkList(curbufnr,curdir) " refresh the listing - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) else NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59) endif - -" call Dret("s:NetrwMarkFileVimCmd") endfun " --------------------------------------------------------------------- @@ -7680,16 +7113,13 @@ endfun " as the marked file(s) (toggles suffix presence) " Uses the local marked file list. fun! s:NetrwMarkHideSfx(islocal) -" call Dfunc("s:NetrwMarkHideSfx(islocal=".a:islocal.")") let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curbufnr = bufnr("%") " s:netrwmarkfilelist_{curbufnr}: the List of marked files if exists("s:netrwmarkfilelist_{curbufnr}") for fname in s:netrwmarkfilelist_{curbufnr} -" call Decho("s:NetrwMarkFileCopy: fname<".fname.">",'~'.expand("")) " construct suffix pattern if fname =~ '\.' let sfxpat= "^.*".substitute(fname,'^.*\(\.[^. ]\+\)$','\1','') @@ -7709,7 +7139,6 @@ fun! s:NetrwMarkHideSfx(islocal) let itemnum= itemnum + 1 endfor endif -" call Decho("fname<".fname."> inhidelist=".inhidelist." sfxpat<".sfxpat.">",'~'.expand("")) if inhidelist " remove sfxpat from list call remove(hidelist,itemnum) @@ -7724,14 +7153,11 @@ fun! s:NetrwMarkHideSfx(islocal) endfor " refresh the listing - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) else NetrwKeepj call netrw#ErrorMsg(s:ERROR,"no files marked!",59) endif - -" call Dret("s:NetrwMarkHideSfx") endfun " --------------------------------------------------------------------- @@ -8099,28 +7525,22 @@ endfun " s:NetrwMarkFileTag: (invoked by mT) This function applies g:netrw_ctags to marked files {{{2 " Uses the global markfilelist fun! s:NetrwMarkFileTag(islocal) -" call Dfunc("s:NetrwMarkFileTag(islocal=".a:islocal.")") let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curdir = s:NetrwGetCurdir(a:islocal) let curbufnr = bufnr("%") " sanity check if !exists("s:netrwmarkfilelist_{curbufnr}") || empty(s:netrwmarkfilelist_{curbufnr}) NetrwKeepj call netrw#ErrorMsg(2,"there are no marked files in this window (:help netrw-mf)",66) -" call Dret("s:NetrwMarkFileTag") return endif -" call Decho("sanity chk passed: s:netrwmarkfilelist_".curbufnr."<".string(s:netrwmarkfilelist_{curbufnr}),'~'.expand("")) if exists("s:netrwmarkfilelist") -" call Decho("s:netrwmarkfilelist".string(s:netrwmarkfilelist).">",'~'.expand("")) let netrwmarkfilelist= join(map(deepcopy(s:netrwmarkfilelist), "s:ShellEscape(v:val,".!a:islocal.")")) call s:NetrwUnmarkAll() if a:islocal -" call Decho("call system(".g:netrw_ctags." ".netrwmarkfilelist.")",'~'.expand("")) call system(g:netrw_ctags." ".netrwmarkfilelist) if v:shell_error call netrw#ErrorMsg(s:ERROR,"g:netrw_ctags<".g:netrw_ctags."> is not executable!",51) @@ -8133,18 +7553,14 @@ fun! s:NetrwMarkFileTag(islocal) 1split NetrwKeepj e tags let path= substitute(curdir,'^\(.*\)/[^/]*$','\1/','') -" call Decho("curdir<".curdir."> path<".path.">",'~'.expand("")) exe 'NetrwKeepj %s/\t\(\S\+\)\t/\t'.escape(path,"/\n\r\\").'\1\t/e' call histdel("/",-1) wq! endif 2match none - call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) call winrestview(svpos) endif - -" call Dret("s:NetrwMarkFileTag") endfun " --------------------------------------------------------------------- @@ -8154,9 +7570,7 @@ endfun " s:netrwmftgt_islocal : 0=target directory is remote " 1=target directory is local fun! s:NetrwMarkFileTgt(islocal) -" call Dfunc("s:NetrwMarkFileTgt(islocal=".a:islocal.")") let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curdir = s:NetrwGetCurdir(a:islocal) let hadtgt = exists("s:netrwmftgt") if !exists("w:netrw_bannercnt") @@ -8165,46 +7579,36 @@ fun! s:NetrwMarkFileTgt(islocal) " set up target if line(".") < w:netrw_bannercnt -" call Decho("set up target: line(.) < w:netrw_bannercnt=".w:netrw_bannercnt,'~'.expand("")) " if cursor in banner region, use b:netrw_curdir for the target unless its already the target if exists("s:netrwmftgt") && exists("s:netrwmftgt_islocal") && s:netrwmftgt == b:netrw_curdir -" call Decho("cursor in banner region, and target already is <".b:netrw_curdir.">: removing target",'~'.expand("")) unlet s:netrwmftgt s:netrwmftgt_islocal if g:netrw_fastbrowse <= 1 call s:LocalBrowseRefresh() endif - call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) call winrestview(svpos) -" call Dret("s:NetrwMarkFileTgt : removed target") return else let s:netrwmftgt= b:netrw_curdir -" call Decho("inbanner: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("")) endif else " get word under cursor. " * If directory, use it for the target. " * If file, use b:netrw_curdir for the target -" call Decho("get word under cursor",'~'.expand("")) let curword= s:NetrwGetWord() let tgtdir = s:ComposePath(curdir,curword) if a:islocal && isdirectory(s:NetrwFile(tgtdir)) let s:netrwmftgt = tgtdir -" call Decho("local isdir: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("")) elseif !a:islocal && tgtdir =~ '/$' let s:netrwmftgt = tgtdir -" call Decho("remote isdir: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("")) else let s:netrwmftgt = curdir -" call Decho("isfile: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("")) endif endif if a:islocal " simplify the target (eg. /abc/def/../ghi -> /abc/ghi) let s:netrwmftgt= simplify(s:netrwmftgt) -" call Decho("simplify: s:netrwmftgt<".s:netrwmftgt.">",'~'.expand("")) endif if g:netrw_cygwin let s:netrwmftgt= substitute(system("cygpath ".s:ShellEscape(s:netrwmftgt)),'\n$','','') @@ -8215,24 +7619,18 @@ fun! s:NetrwMarkFileTgt(islocal) " need to do refresh so that the banner will be updated " s:LocalBrowseRefresh handles all local-browsing buffers when not fast browsing if g:netrw_fastbrowse <= 1 -" call Decho("g:netrw_fastbrowse=".g:netrw_fastbrowse.", so refreshing all local netrw buffers",'~'.expand("")) call s:LocalBrowseRefresh() endif -" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) +" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST - call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,w:netrw_treetop)) + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,w:netrw_treetop,0)) else - call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) endif -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) call winrestview(svpos) if !hadtgt sil! NetrwKeepj norm! j endif - -" call Decho("getmatches=".string(getmatches()),'~'.expand("")) -" call Decho("s:netrwmarkfilelist=".(exists("s:netrwmarkfilelist")? string(s:netrwmarkfilelist) : 'n/a'),'~'.expand("")) -" call Dret("s:NetrwMarkFileTgt : netrwmftgt<".(exists("s:netrwmftgt")? s:netrwmftgt : "").">") endfun " --------------------------------------------------------------------- @@ -8351,7 +7749,7 @@ fun! netrw#Shrink() elseif winwidth(bufwinnr(t:netrw_lexbufnr)) >= 0 exe "vert resize ".t:netrw_winwidth " call Decho("vert resize ".t:netrw_winwidth,'~'.expand("")) - else + else call netrw#Lexplore(0,0) endif @@ -8366,23 +7764,17 @@ endfun " --------------------------------------------------------------------- " s:NetSortSequence: allows user to edit the sorting sequence {{{2 fun! s:NetSortSequence(islocal) -" call Dfunc("NetSortSequence(islocal=".a:islocal.")") - let ykeep= @@ let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) call inputsave() let newsortseq= input("Edit Sorting Sequence: ",g:netrw_sort_sequence) call inputrestore() " refresh the listing let g:netrw_sort_sequence= newsortseq - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) let @@= ykeep - -" call Dret("NetSortSequence") endfun " --------------------------------------------------------------------- @@ -8453,9 +7845,7 @@ endfun " Marked files suitable for use with 2match are in: " s:netrwmarkfilemtch_# -- used with 2match to display marked files fun! s:NetrwUnMarkFile(islocal) -" call Dfunc("s:NetrwUnMarkFile(islocal=".a:islocal.")") let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let curbufnr = bufnr("%") " unmark marked file list @@ -8475,10 +7865,8 @@ fun! s:NetrwUnMarkFile(islocal) endwhile 2match none -" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -"call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) +" call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) call winrestview(svpos) -" call Dret("s:NetrwUnMarkFile") endfun " --------------------------------------------------------------------- @@ -8613,69 +8001,47 @@ endfun " choice = 2 : didn't save modified file, opened window " choice = 3 : cancel open fun! s:NetrwPrevWinOpen(islocal) -" call Dfunc("s:NetrwPrevWinOpen(islocal=".a:islocal.") win#".winnr()) - let ykeep= @@ " grab a copy of the b:netrw_curdir to pass it along to newly split windows let curdir = b:netrw_curdir -" call Decho("COMBAK#1: mod=".&mod." win#".winnr()) " get last window number and the word currently under the cursor let origwin = winnr() let lastwinnr = winnr("$") -" call Decho("origwin#".origwin." lastwinnr#".lastwinnr) -" call Decho("COMBAK#2: mod=".&mod." win#".winnr()) let curword = s:NetrwGetWord() let choice = 0 let s:prevwinopen= 1 " lets s:NetrwTreeDir() know that NetrwPrevWinOpen called it (s:NetrwTreeDir() will unlet s:prevwinopen) -" call Decho("COMBAK#3: mod=".&mod." win#".winnr()) let s:treedir = s:NetrwTreeDir(a:islocal) -" call Decho("COMBAK#4: mod=".&mod." win#".winnr()) let curdir = s:treedir -" call Decho("COMBAK#5: mod=".&mod." win#".winnr()) -" call Decho("winnr($)#".lastwinnr." curword<".curword.">",'~'.expand("")) -" call Decho("COMBAK#6: mod=".&mod." win#".winnr()) let didsplit = 0 if lastwinnr == 1 " if only one window, open a new one first -" call Decho("only one window, so open a new one (g:netrw_alto=".g:netrw_alto.")",'~'.expand("")) " g:netrw_preview=0: preview window shown in a horizontally split window " g:netrw_preview=1: preview window shown in a vertically split window if g:netrw_preview " vertically split preview window let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize -" call Decho("exe ".(g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s",'~'.expand("")) exe (g:netrw_alto? "top " : "bot ")."vert ".winsz."wincmd s" else " horizontally split preview window let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize -" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s",'~'.expand("")) exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s" endif let didsplit = 1 -" call Decho("did split",'~'.expand("")) else -" call Decho("COMBAK#7: mod=".&mod." win#".winnr()) NetrwKeepj call s:SaveBufVars() -" call Decho("COMBAK#8: mod=".&mod." win#".winnr()) let eikeep= &ei -" call Decho("COMBAK#9: mod=".&mod." win#".winnr()) setl ei=all -" call Decho("COMBAK#10: mod=".&mod." win#".winnr()) wincmd p -" call Decho("COMBAK#11: mod=".&mod) -" call Decho("wincmd p (now in win#".winnr().") curdir<".curdir.">",'~'.expand("")) -" call Decho("COMBAK#12: mod=".&mod) - + if exists("s:lexplore_win") && s:lexplore_win == winnr() " whoops -- user trying to open file in the Lexplore window. " Use Lexplore's opening-file window instead. -" call Decho("whoops -- user trying to open file in Lexplore Window. Use win#".g:netrw_chgwin." instead") " exe g:netrw_chgwin."wincmd w" wincmd p - call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) + call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord(),1)) endif " prevwinnr: the window number of the "prev" window @@ -8686,28 +8052,20 @@ fun! s:NetrwPrevWinOpen(islocal) let prevbufname = bufname("%") let prevmod = &mod let bnrcnt = 0 -" call Decho("COMBAK#13: mod=".&mod." win#".winnr()) NetrwKeepj call s:RestoreBufVars() -" call Decho("after wincmd p: win#".winnr()." win($)#".winnr("$")." origwin#".origwin." &mod=".&mod." bufname(%)<".bufname("%")."> prevbufnr=".prevbufnr,'~'.expand("")) -" call Decho("COMBAK#14: mod=".&mod." win#".winnr()) " if the previous window's buffer has been changed (ie. its modified flag is set), " and it doesn't appear in any other extant window, then ask the " user if s/he wants to abandon modifications therein. if prevmod -" call Decho("detected that prev window's buffer has been modified: prevbufnr=".prevbufnr." winnr()#".winnr(),'~'.expand("")) windo if winbufnr(0) == prevbufnr | let bnrcnt=bnrcnt+1 | endif -" call Decho("prevbufnr=".prevbufnr." bnrcnt=".bnrcnt." buftype=".&bt." winnr()=".winnr()." prevwinnr#".prevwinnr,'~'.expand("")) exe prevwinnr."wincmd w" -" call Decho("COMBAK#15: mod=".&mod." win#".winnr()) if bnrcnt == 1 && &hidden == 0 " only one copy of the modified buffer in a window, and " hidden not set, so overwriting will lose the modified file. Ask first... let choice = confirm("Save modified buffer<".prevbufname."> first?","&Yes\n&No\n&Cancel") -" call Decho("prevbufname<".prevbufname."> choice=".choice." current-winnr#".winnr(),'~'.expand("")) let &ei= eikeep -" call Decho("COMBAK#16: mod=".&mod." win#".winnr()) if choice == 1 " Yes -- write file & then browse @@ -8718,41 +8076,35 @@ fun! s:NetrwPrevWinOpen(islocal) exe origwin."wincmd w" let &ei = eikeep let @@ = ykeep -" call Dret("s:NetrwPrevWinOpen ".choice." : unable to write <".prevbufname.">") return choice endif elseif choice == 2 " No -- don't worry about changed file, just browse anyway -" call Decho("don't worry about chgd file, just browse anyway (winnr($)#".winnr("$").")",'~'.expand("")) echomsg "**note** changes to ".prevbufname." abandoned" else " Cancel -- don't do this -" call Decho("cancel, don't browse, switch to win#".origwin,'~'.expand("")) exe origwin."wincmd w" let &ei= eikeep let @@ = ykeep -" call Dret("s:NetrwPrevWinOpen ".choice." : cancelled") return choice endif endif endif let &ei= eikeep endif -" call Decho("COMBAK#17: mod=".&mod." win#".winnr()) " restore b:netrw_curdir (window split/enew may have lost it) let b:netrw_curdir= curdir if a:islocal < 2 if a:islocal - call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(a:islocal,curword)) + call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(a:islocal,curword,0)) else - call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,curword)) + call s:NetrwBrowse(a:islocal,s:NetrwBrowseChgDir(a:islocal,curword,0)) endif endif let @@= ykeep -" call Dret("s:NetrwPrevWinOpen ".choice) return choice endfun @@ -9059,32 +8411,25 @@ endfun " Called by NetrwMarkFileCopy() " Interfaces to s:NetrwRefresh() and s:LocalBrowseRefresh() fun! s:NetrwRefreshDir(islocal,dirname) -" call Dfunc("s:NetrwRefreshDir(islocal=".a:islocal." dirname<".a:dirname.">) g:netrw_fastbrowse=".g:netrw_fastbrowse) if g:netrw_fastbrowse == 0 " slowest mode (keep buffers refreshed, local or remote) -" call Decho("slowest mode: keep buffers refreshed, local or remote",'~'.expand("")) let tgtwin= bufwinnr(a:dirname) -" call Decho("tgtwin= bufwinnr(".a:dirname.")=".tgtwin,'~'.expand("")) if tgtwin > 0 " tgtwin is being displayed, so refresh it let curwin= winnr() -" call Decho("refresh tgtwin#".tgtwin." (curwin#".curwin.")",'~'.expand("")) exe tgtwin."wincmd w" - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) exe curwin."wincmd w" elseif bufnr(a:dirname) > 0 let bn= bufnr(a:dirname) -" call Decho("bd bufnr(".a:dirname.")=".bn,'~'.expand("")) exe "sil keepj bd ".bn endif elseif g:netrw_fastbrowse <= 1 -" call Decho("medium-speed mode: refresh local buffers only",'~'.expand("")) NetrwKeepj call s:LocalBrowseRefresh() endif -" call Dret("s:NetrwRefreshDir") endfun " --------------------------------------------------------------------- @@ -9224,18 +8569,13 @@ endfun " ===================================================================== " s:NetrwSortStyle: change sorting style (name - time - size - exten) and refresh display {{{2 fun! s:NetrwSortStyle(islocal) -" call Dfunc("s:NetrwSortStyle(islocal=".a:islocal.") netrw_sort_by<".g:netrw_sort_by.">") NetrwKeepj call s:NetrwSaveWordPosn() let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let g:netrw_sort_by= (g:netrw_sort_by =~# '^n')? 'time' : (g:netrw_sort_by =~# '^t')? 'size' : (g:netrw_sort_by =~# '^siz')? 'exten' : 'name' NetrwKeepj norm! 0 - NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) NetrwKeepj call winrestview(svpos) - -" call Dret("s:NetrwSortStyle : netrw_sort_by<".g:netrw_sort_by.">") endfun " --------------------------------------------------------------------- @@ -9247,7 +8587,6 @@ endfun " =4 : local and t " =5 : local and v fun! s:NetrwSplit(mode) -" call Dfunc("s:NetrwSplit(mode=".a:mode.") alto=".g:netrw_alto." altv=".g:netrw_altv) let ykeep= @@ call s:SaveWinVars() @@ -9256,17 +8595,15 @@ fun! s:NetrwSplit(mode) " remote and o let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize if winsz == 0|let winsz= ""|endif -" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s",'~'.expand("")) exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s" let s:didsplit= 1 NetrwKeepj call s:RestoreWinVars() - NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) + NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord(),1)) unlet s:didsplit elseif a:mode == 1 " remote and t - let newdir = s:NetrwBrowseChgDir(0,s:NetrwGetWord()) -" call Decho("tabnew",'~'.expand("")) + let newdir = s:NetrwBrowseChgDir(0,s:NetrwGetWord(),1) tabnew let s:didsplit= 1 NetrwKeepj call s:RestoreWinVars() @@ -9277,22 +8614,20 @@ fun! s:NetrwSplit(mode) " remote and v let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize if winsz == 0|let winsz= ""|endif -" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v",'~'.expand("")) exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v" let s:didsplit= 1 NetrwKeepj call s:RestoreWinVars() - NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord())) + NetrwKeepj call s:NetrwBrowse(0,s:NetrwBrowseChgDir(0,s:NetrwGetWord(),1)) unlet s:didsplit elseif a:mode == 3 " local and o let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winheight(0))/100 : -g:netrw_winsize if winsz == 0|let winsz= ""|endif -" call Decho("exe ".(g:netrw_alto? "bel " : "abo ").winsz."wincmd s",'~'.expand("")) exe (g:netrw_alto? "bel " : "abo ").winsz."wincmd s" let s:didsplit= 1 NetrwKeepj call s:RestoreWinVars() - NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) + NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord(),1)) unlet s:didsplit elseif a:mode == 4 @@ -9309,12 +8644,11 @@ fun! s:NetrwSplit(mode) exe "NetrwKeepj norm! ".netrw_line."G0".netrw_col."\" let &ei = eikeep let netrw_curdir = s:NetrwTreeDir(0) -" call Decho("tabnew",'~'.expand("")) tabnew let b:netrw_curdir = netrw_curdir let s:didsplit = 1 NetrwKeepj call s:RestoreWinVars() - NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,cursorword)) + NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,cursorword,0)) if &ft == "netrw" setl ei=all exe "NetrwKeepj norm! ".netrw_hline."G0z\" @@ -9327,11 +8661,10 @@ fun! s:NetrwSplit(mode) " local and v let winsz= (g:netrw_winsize > 0)? (g:netrw_winsize*winwidth(0))/100 : -g:netrw_winsize if winsz == 0|let winsz= ""|endif -" call Decho("exe ".(g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v",'~'.expand("")) exe (g:netrw_altv? "rightb " : "lefta ").winsz."wincmd v" let s:didsplit= 1 NetrwKeepj call s:RestoreWinVars() - NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord())) + NetrwKeepj call netrw#LocalBrowseCheck(s:NetrwBrowseChgDir(1,s:NetrwGetWord(),1)) unlet s:didsplit else @@ -9339,7 +8672,6 @@ fun! s:NetrwSplit(mode) endif let @@= ykeep -" call Dret("s:NetrwSplit") endfun " --------------------------------------------------------------------- @@ -9409,91 +8741,49 @@ endfun " s:NetrwTreeDir: determine tree directory given current cursor position {{{2 " (full path directory with trailing slash returned) fun! s:NetrwTreeDir(islocal) -" call Dfunc("s:NetrwTreeDir(islocal=".a:islocal.") getline(".line(".").")"."<".getline('.')."> b:netrw_curdir<".b:netrw_curdir."> tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> ft=".&ft) -" call Decho("Determine tree directory given current cursor position") -" call Decho("g:netrw_keepdir =".(exists("g:netrw_keepdir")? g:netrw_keepdir : 'n/a'),'~'.expand("")) -" call Decho("w:netrw_liststyle=".(exists("w:netrw_liststyle")? w:netrw_liststyle : 'n/a'),'~'.expand("")) -" call Decho("w:netrw_treetop =".(exists("w:netrw_treetop")? w:netrw_treetop : 'n/a'),'~'.expand("")) -" call Decho("current line<".getline(".").">") 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 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 -" call Decho("COMBAK#18 : mod=".&mod." win#".winnr()) if !exists("b:netrw_curdir") || b:netrw_curdir == "" let b:netrw_curdir= getcwd() endif let treedir = b:netrw_curdir -" call Decho("set initial treedir<".treedir.">",'~'.expand("")) -" call Decho("COMBAK#19 : mod=".&mod." win#".winnr()) - let s:treecurpos= winsaveview() -" call Decho("saving posn to s:treecurpos<".string(s:treecurpos).">",'~'.expand("")) -" call Decho("COMBAK#20 : mod=".&mod." win#".winnr()) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST -" call Decho("w:netrw_liststyle is TREELIST:",'~'.expand("")) -" call Decho("line#".line(".")." getline(.)<".getline('.')."> treecurpos<".string(s:treecurpos).">",'~'.expand("")) -" call Decho("COMBAK#21 : mod=".&mod." win#".winnr()) " extract tree directory if on a line specifying a subdirectory (ie. ends with "/") let curline= substitute(getline('.'),"\t -->.*$",'','') if curline =~ '/$' -" call Decho("extract tree subdirectory from current line",'~'.expand("")) let treedir= substitute(getline('.'),'^\%('.s:treedepthstring.'\)*\([^'.s:treedepthstring.'].\{-}\)$','\1','e') -" call Decho("treedir<".treedir.">",'~'.expand("")) elseif curline =~ '@$' -" call Decho("handle symbolic link from current line",'~'.expand("")) - let potentialdir= resolve(substitute(substitute(getline('.'),'@.*$','','e'),'^|*\s*','','e')) -" call Decho("treedir<".treedir.">",'~'.expand("")) + let potentialdir= resolve(s:NetrwTreePath(w:netrw_treetop)) else -" call Decho("do not extract tree subdirectory from current line and set treedir to empty",'~'.expand("")) let treedir= "" endif -" call Decho("COMBAK#22 : mod=".&mod." win#".winnr()) " detect user attempting to close treeroot -" call Decho("check if user is attempting to close treeroot",'~'.expand("")) -" call Decho(".win#".winnr()." buf#".bufnr("%")."<".bufname("%").">",'~'.expand("")) -" call Decho(".getline(".line(".").")<".getline('.').'> '.((getline('.') =~# '^'.s:treedepthstring)? '=~#' : '!~').' ^'.s:treedepthstring,'~'.expand("")) if curline !~ '^'.s:treedepthstring && getline('.') != '..' -" call Decho(".user may have attempted to close treeroot",'~'.expand("")) " now force a refresh -" call Decho(".force refresh: clear buffer<".expand("%")."> with :%d",'~'.expand("")) sil! NetrwKeepj %d _ -" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".(exists("s:treecurpos")? string(s:treecurpos) : 'n/a').">") return b:netrw_curdir -" else " Decho -" call Decho(".user not attempting to close treeroot",'~'.expand("")) endif -" call Decho("COMBAK#23 : mod=".&mod." win#".winnr()) - -" call Decho("islocal=".a:islocal." curline<".curline.">",'~'.expand("")) -" call Decho("potentialdir<".potentialdir."> isdir=".isdirectory(potentialdir),'~'.expand("")) -" call Decho("COMBAK#24 : mod=".&mod." win#".winnr()) " COMBAK: a symbolic link may point anywhere -- so it will be used to start a new treetop " if a:islocal && curline =~ '@$' && isdirectory(s:NetrwFile(potentialdir)) " let newdir = w:netrw_treetop.'/'.potentialdir -" " call Decho("apply NetrwTreePath to newdir<".newdir.">",'~'.expand("")) -" let treedir = s:NetrwTreePath(newdir) -" let w:netrw_treetop = newdir -" " call Decho("newdir <".newdir.">",'~'.expand("")) -" else -" call Decho("apply NetrwTreePath to treetop<".w:netrw_treetop.">",'~'.expand("")) if a:islocal && curline =~ '@$' if isdirectory(s:NetrwFile(potentialdir)) - let treedir = w:netrw_treetop.'/'.potentialdir.'/' + let treedir = potentialdir let w:netrw_treetop = treedir endif else @@ -9501,29 +8791,21 @@ fun! s:NetrwTreeDir(islocal) let treedir = s:NetrwTreePath(w:netrw_treetop) endif endif -" call Decho("COMBAK#25 : mod=".&mod." win#".winnr()) " sanity maintenance: keep those //s away... let treedir= substitute(treedir,'//$','/','') -" call Decho("treedir<".treedir.">",'~'.expand("")) -" call Decho("COMBAK#26 : mod=".&mod." win#".winnr()) - -" call Dret("s:NetrwTreeDir <".treedir."> : (side effect) s:treecurpos<".(exists("s:treecurpos")? string(s:treecurpos) : 'n/a').">") return treedir endfun " --------------------------------------------------------------------- " s:NetrwTreeDisplay: recursive tree display {{{2 fun! s:NetrwTreeDisplay(dir,depth) -" call Dfunc("NetrwTreeDisplay(dir<".a:dir."> depth<".a:depth.">)") - - " insure that there are no folds + " ensure that there are no folds setl nofen " install ../ and shortdir if a:depth == "" call setline(line("$")+1,'../') -" call Decho("setline#".line("$")." ../ (depth is zero)",'~'.expand("")) endif if a:dir =~ '^\a\{3,}://' if a:dir == w:netrw_treetop @@ -9536,19 +8818,16 @@ fun! s:NetrwTreeDisplay(dir,depth) let shortdir= substitute(a:dir,'^.*/','','e') call setline(line("$")+1,a:depth.shortdir.'/') endif -" call Decho("setline#".line("$")." shortdir<".a:depth.shortdir.">",'~'.expand("")) " append a / to dir if its missing one let dir= a:dir " display subtrees (if any) let depth= s:treedepthstring.a:depth -" call Decho("display subtrees with depth<".depth."> and current leaves",'~'.expand("")) " implement g:netrw_hide for tree listings (uses g:netrw_list_hide) if g:netrw_hide == 1 " hide given patterns let listhide= split(g:netrw_list_hide,',') -" call Decho("listhide=".string(listhide)) for pat in listhide call filter(w:netrw_treedict[dir],'v:val !~ "'.escape(pat,'\\').'"') endfor @@ -9556,7 +8835,6 @@ fun! s:NetrwTreeDisplay(dir,depth) elseif g:netrw_hide == 2 " show given patterns (only) let listhide= split(g:netrw_list_hide,',') -" call Decho("listhide=".string(listhide)) let entries=[] for entry in w:netrw_treedict[dir] for pat in listhide @@ -9571,77 +8849,57 @@ fun! s:NetrwTreeDisplay(dir,depth) if depth != "" " always remove "." and ".." entries when there's depth call filter(w:netrw_treedict[dir],'v:val !~ "\\.\\.$"') + call filter(w:netrw_treedict[dir],'v:val !~ "\\.\\./$"') call filter(w:netrw_treedict[dir],'v:val !~ "\\.$"') + call filter(w:netrw_treedict[dir],'v:val !~ "\\./$"') endif -" call Decho("for every entry in w:netrw_treedict[".dir."]=".string(w:netrw_treedict[dir]),'~'.expand("")) for entry in w:netrw_treedict[dir] if dir =~ '/$' let direntry= substitute(dir.entry,'[@/]$','','e') else let direntry= substitute(dir.'/'.entry,'[@/]$','','e') endif -" call Decho("dir<".dir."> entry<".entry."> direntry<".direntry.">",'~'.expand("")) if entry =~ '/$' && has_key(w:netrw_treedict,direntry) -" call Decho("<".direntry."> is a key in treedict - display subtree for it",'~'.expand("")) NetrwKeepj call s:NetrwTreeDisplay(direntry,depth) elseif entry =~ '/$' && has_key(w:netrw_treedict,direntry.'/') -" call Decho("<".direntry."/> is a key in treedict - display subtree for it",'~'.expand("")) NetrwKeepj call s:NetrwTreeDisplay(direntry.'/',depth) elseif entry =~ '@$' && has_key(w:netrw_treedict,direntry.'@') -" call Decho("<".direntry."/> is a key in treedict - display subtree for it",'~'.expand("")) - NetrwKeepj call s:NetrwTreeDisplay(direntry.'/',depth) + NetrwKeepj call s:NetrwTreeDisplay(direntry.'@',depth) else -" call Decho("<".entry."> is not a key in treedict (no subtree)",'~'.expand("")) sil! NetrwKeepj call setline(line("$")+1,depth.entry) endif endfor -" call Decho("displaying: ".string(getline(w:netrw_bannercnt,'$'))) - -" call Dret("NetrwTreeDisplay") endfun " --------------------------------------------------------------------- " s:NetrwRefreshTreeDict: updates the contents information for a tree (w:netrw_treedict) {{{2 fun! s:NetrwRefreshTreeDict(dir) -" call Dfunc("s:NetrwRefreshTreeDict(dir<".a:dir.">)") if !exists("w:netrw_treedict") -" call Dret("s:NetrwRefreshTreeDict : w:netrw_treedict doesn't exist") return endif for entry in w:netrw_treedict[a:dir] let direntry= substitute(a:dir.'/'.entry,'[@/]$','','e') -" call Decho("a:dir<".a:dir."> entry<".entry."> direntry<".direntry.">",'~'.expand("")) if entry =~ '/$' && has_key(w:netrw_treedict,direntry) -" call Decho("<".direntry."> is a key in treedict - display subtree for it",'~'.expand("")) NetrwKeepj call s:NetrwRefreshTreeDict(direntry) - let liststar = s:NetrwGlob(direntry,'*',1) - let listdotstar = s:NetrwGlob(direntry,'.*',1) - let w:netrw_treedict[direntry] = liststar + listdotstar -" call Decho("updating w:netrw_treedict[".direntry.']='.string(w:netrw_treedict[direntry]),'~'.expand("")) + let filelist = s:NetrwLocalListingList(direntry,0) + let w:netrw_treedict[direntry] = sort(filelist) elseif entry =~ '/$' && has_key(w:netrw_treedict,direntry.'/') -" call Decho("<".direntry."/> is a key in treedict - display subtree for it",'~'.expand("")) NetrwKeepj call s:NetrwRefreshTreeDict(direntry.'/') - let liststar = s:NetrwGlob(direntry.'/','*',1) - let listdotstar= s:NetrwGlob(direntry.'/','.*',1) - let w:netrw_treedict[direntry]= liststar + listdotstar -" call Decho("updating w:netrw_treedict[".direntry.']='.string(w:netrw_treedict[direntry]),'~'.expand("")) + let filelist = s:NetrwLocalListingList(direntry.'/',0) + let w:netrw_treedict[direntry] = sort(filelist) elseif entry =~ '@$' && has_key(w:netrw_treedict,direntry.'@') -" call Decho("<".direntry."/> is a key in treedict - display subtree for it",'~'.expand("")) NetrwKeepj call s:NetrwRefreshTreeDict(direntry.'/') let liststar = s:NetrwGlob(direntry.'/','*',1) let listdotstar= s:NetrwGlob(direntry.'/','.*',1) -" call Decho("updating w:netrw_treedict[".direntry.']='.string(w:netrw_treedict[direntry]),'~'.expand("")) else -" call Decho('not updating w:netrw_treedict['.string(direntry).'] with entry<'.string(entry).'> (no subtree)','~'.expand("")) endif endfor -" call Dret("s:NetrwRefreshTreeDict") endfun " --------------------------------------------------------------------- @@ -9649,22 +8907,16 @@ endfun " Called by s:PerformListing() fun! s:NetrwTreeListing(dirname) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST -" call Dfunc("s:NetrwTreeListing() bufname<".expand("%").">") -" call Decho("curdir<".a:dirname.">",'~'.expand("")) -" 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("")) -" 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("")) " update the treetop if !exists("w:netrw_treetop") -" call Decho("update the treetop (w:netrw_treetop doesn't exist yet)",'~'.expand("")) let w:netrw_treetop= a:dirname let s:netrw_treetop= w:netrw_treetop -" call Decho("w:netrw_treetop<".w:netrw_treetop."> (reusing)",'~'.expand("")) - 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("")) + " use \V in case the directory contains specials chars like '$' or '~' + elseif (w:netrw_treetop =~ ('^'.'\V'.a:dirname) && s:Strlen(a:dirname) < s:Strlen(w:netrw_treetop)) + \ || a:dirname !~ ('^'.'\V'.w:netrw_treetop) let w:netrw_treetop= a:dirname let s:netrw_treetop= w:netrw_treetop -" call Decho("w:netrw_treetop<".w:netrw_treetop."> (went up)",'~'.expand("")) endif if exists("w:netrw_treetop") let s:netrw_treetop= w:netrw_treetop @@ -9675,16 +8927,12 @@ fun! s:NetrwTreeListing(dirname) if !exists("w:netrw_treedict") " insure that we have a treedict, albeit empty -" call Decho("initializing w:netrw_treedict to empty",'~'.expand("")) let w:netrw_treedict= {} endif " update the dictionary for the current directory -" call Decho("updating: w:netrw_treedict[".a:dirname.'] -> [directory listing]','~'.expand("")) -" call Decho("w:netrw_bannercnt=".w:netrw_bannercnt." line($)=".line("$"),'~'.expand("")) - exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d _' + exe "sil! NetrwKeepj keepp ".w:netrw_bannercnt.',$g@^\.\.\=/$@d _' let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$")) -" call Decho("w:treedict[".a:dirname."]= ".string(w:netrw_treedict[a:dirname]),'~'.expand("")) exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d _" " if past banner, record word @@ -9693,23 +8941,17 @@ fun! s:NetrwTreeListing(dirname) else let fname= "" endif -" call Decho("fname<".fname.">",'~'.expand("")) -" 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("")) " display from treetop on down -" call Decho("(s:NetrwTreeListing) w:netrw_treetop<".w:netrw_treetop.">") NetrwKeepj call s:NetrwTreeDisplay(w:netrw_treetop,"") -" call Decho("s:NetrwTreeDisplay) setl noma nomod ro",'~'.expand("")) " remove any blank line remaining as line#1 (happens in treelisting mode with banner suppressed) while getline(1) =~ '^\s*$' && byte2line(1) > 0 -" call Decho("deleting blank line",'~'.expand("")) 1d endwhile exe "setl ".g:netrw_bufsettings -" call Dret("s:NetrwTreeListing : bufname<".expand("%").">") return endif endfun @@ -10116,7 +9358,7 @@ fun! s:PerformListing(islocal) " resolve symbolic links if local and (thin or tree) if a:islocal && (w:netrw_liststyle == s:THINLIST || (exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST)) " call Decho("--resolve symbolic links if local and thin|tree",'~'.expand("")) - sil! g/@$/call s:ShowLink() + sil! keepp g/@$/call s:ShowLink() endif if exists("w:netrw_bannercnt") && (line("$") >= w:netrw_bannercnt || !g:netrw_banner) @@ -10565,15 +9807,11 @@ endfun " --------------------------------------------------------------------- " s:NetrwRemoteRm: remove/delete a remote file or directory {{{2 fun! s:NetrwRemoteRm(usrhost,path) range -" call Dfunc("s:NetrwRemoteRm(usrhost<".a:usrhost."> path<".a:path.">) virtcol=".virtcol(".")) -" call Decho("firstline=".a:firstline." lastline=".a:lastline,'~'.expand("")) let svpos= winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) let all= 0 if exists("s:netrwmarkfilelist_{bufnr('%')}") " remove all marked files -" call Decho("remove all marked files with bufnr#".bufnr("%"),'~'.expand("")) for fname in s:netrwmarkfilelist_{bufnr("%")} let ok= s:NetrwRemoteRmFile(a:path,fname,all) if ok =~# 'q\%[uit]' @@ -10586,7 +9824,6 @@ fun! s:NetrwRemoteRm(usrhost,path) range else " remove files specified by range -" call Decho("remove files specified by range",'~'.expand("")) " preparation for removing multiple files/directories let keepsol = &l:sol @@ -10608,12 +9845,8 @@ fun! s:NetrwRemoteRm(usrhost,path) range endif " refresh the (remote) directory listing -" call Decho("refresh remote directory listing",'~'.expand("")) - NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./',0)) NetrwKeepj call winrestview(svpos) - -" call Dret("s:NetrwRemoteRm") endfun " --------------------------------------------------------------------- @@ -10739,7 +9972,6 @@ endfun " --------------------------------------------------------------------- " s:NetrwRemoteRename: rename a remote file or directory {{{2 fun! s:NetrwRemoteRename(usrhost,path) range -" call Dfunc("NetrwRemoteRename(usrhost<".a:usrhost."> path<".a:path.">)") " preparation for removing multiple files/directories let svpos = winsaveview() @@ -10750,10 +9982,8 @@ fun! s:NetrwRemoteRename(usrhost,path) range " rename files given by the markfilelist if exists("s:netrwmarkfilelist_{bufnr('%')}") for oldname in s:netrwmarkfilelist_{bufnr("%")} -" call Decho("oldname<".oldname.">",'~'.expand("")) if exists("subfrom") let newname= substitute(oldname,subfrom,subto,'') -" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">",'~'.expand("")) else call inputsave() let newname= input("Moving ".oldname." to : ",oldname) @@ -10762,7 +9992,6 @@ fun! s:NetrwRemoteRename(usrhost,path) range let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','') let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','') let newname = substitute(oldname,subfrom,subto,'') -" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">",'~'.expand("")) endif endif @@ -10771,7 +10000,6 @@ fun! s:NetrwRemoteRename(usrhost,path) range else let oldname= s:ShellEscape(a:path.oldname) let newname= s:ShellEscape(a:path.newname) -" call Decho("system(netrw#WinPath(".rename_cmd.") ".oldname.' '.newname.")",'~'.expand("")) let ret = system(netrw#WinPath(rename_cmd).' '.oldname.' '.newname) endif @@ -10787,7 +10015,6 @@ fun! s:NetrwRemoteRename(usrhost,path) range exe "NetrwKeepj ".ctr let oldname= s:NetrwGetWord() -" call Decho("oldname<".oldname.">",'~'.expand("")) call inputsave() let newname= input("Moving ".oldname." to : ",oldname) @@ -10798,7 +10025,6 @@ fun! s:NetrwRemoteRename(usrhost,path) range else let oldname= s:ShellEscape(a:path.oldname) let newname= s:ShellEscape(a:path.newname) -" call Decho("system(netrw#WinPath(".rename_cmd.") ".oldname.' '.newname.")",'~'.expand("")) let ret = system(netrw#WinPath(rename_cmd).' '.oldname.' '.newname) endif @@ -10808,11 +10034,8 @@ fun! s:NetrwRemoteRename(usrhost,path) range endif " refresh the directory - NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(0,s:NetrwBrowseChgDir(0,'./',0)) NetrwKeepj call winrestview(svpos) - -" call Dret("NetrwRemoteRename") endfun " ========================================== @@ -10939,17 +10162,11 @@ endfun " buffers to be refreshed after a user has executed some shell command, " on the chance that s/he removed/created a file/directory with it. fun! s:LocalBrowseRefresh() -" call Dfunc("s:LocalBrowseRefresh() tabpagenr($)=".tabpagenr("$")) -" call Decho("s:netrw_browselist =".(exists("s:netrw_browselist")? string(s:netrw_browselist) : ''),'~'.expand("")) -" call Decho("w:netrw_bannercnt =".(exists("w:netrw_bannercnt")? string(w:netrw_bannercnt) : ''),'~'.expand("")) - " determine which buffers currently reside in a tab if !exists("s:netrw_browselist") -" call Dret("s:LocalBrowseRefresh : browselist is empty") return endif if !exists("w:netrw_bannercnt") -" call Dret("s:LocalBrowseRefresh : don't refresh when focus not on netrw window") return endif if !empty(getcmdwintype()) @@ -10959,7 +10176,6 @@ fun! s:LocalBrowseRefresh() if exists("s:netrw_events") && s:netrw_events == 1 " s:LocalFastBrowser gets called (indirectly) from a let s:netrw_events= 2 -" call Dret("s:LocalBrowseRefresh : avoid initial double refresh") return endif let itab = 1 @@ -10970,47 +10186,36 @@ fun! s:LocalBrowseRefresh() let itab = itab + 1 sil! tabn endwhile -" call Decho("buftablist".string(buftablist),'~'.expand("")) -" call Decho("s:netrw_browselist<".(exists("s:netrw_browselist")? string(s:netrw_browselist) : "").">",'~'.expand("")) " GO through all buffers on netrw_browselist (ie. just local-netrw buffers): " | refresh any netrw window " | wipe out any non-displaying netrw buffer let curwinid = win_getid(winnr()) let ibl = 0 for ibuf in s:netrw_browselist -" call Decho("bufwinnr(".ibuf.") index(buftablist,".ibuf.")=".index(buftablist,ibuf),'~'.expand("")) if bufwinnr(ibuf) == -1 && index(buftablist,ibuf) == -1 " wipe out any non-displaying netrw buffer " (ibuf not shown in a current window AND " ibuf not in any tab) -" call Decho("wiping buf#".ibuf,"<".bufname(ibuf).">",'~'.expand("")) exe "sil! keepj bd ".fnameescape(ibuf) call remove(s:netrw_browselist,ibl) -" call Decho("browselist=".string(s:netrw_browselist),'~'.expand("")) continue elseif index(tabpagebuflist(),ibuf) != -1 " refresh any netrw buffer -" call Decho("refresh buf#".ibuf.'-> win#'.bufwinnr(ibuf),'~'.expand("")) exe bufwinnr(ibuf)."wincmd w" if getline(".") =~# 'Quick Help' " decrement g:netrw_quickhelp to prevent refresh from changing g:netrw_quickhelp " (counteracts s:NetrwBrowseChgDir()'s incrementing) let g:netrw_quickhelp= g:netrw_quickhelp - 1 endif -" call Decho("#3: quickhelp=".g:netrw_quickhelp,'~'.expand("")) if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST NetrwKeepj call s:NetrwRefreshTreeDict(w:netrw_treetop) endif - NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) + NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./',0)) endif let ibl= ibl + 1 -" call Decho("bottom of s:netrw_browselist for loop: ibl=".ibl,'~'.expand("")) endfor -" call Decho("restore window: win_gotoid(".curwinid.")") call win_gotoid(curwinid) let @@= ykeep - -" call Dret("s:LocalBrowseRefresh") endfun " --------------------------------------------------------------------- @@ -11032,22 +10237,15 @@ endfun " If :Explore used: it sets s:netrw_events to 2, so no FocusGained events are ignored. " =2: autocmds installed (doesn't ignore any FocusGained events) fun! s:LocalFastBrowser() -" call Dfunc("s:LocalFastBrowser() g:netrw_fastbrowse=".g:netrw_fastbrowse) -" call Decho("s:netrw_events ".(exists("s:netrw_events")? "exists" : 'n/a'),'~'.expand("")) -" call Decho("autocmd: ShellCmdPost ".(exists("#ShellCmdPost")? "already installed" : "not installed"),'~'.expand("")) -" call Decho("autocmd: FocusGained ".(exists("#FocusGained")? "already installed" : "not installed"),'~'.expand("")) " initialize browselist, a list of buffer numbers that the local browser has used if !exists("s:netrw_browselist") -" call Decho("initialize s:netrw_browselist",'~'.expand("")) let s:netrw_browselist= [] endif " append current buffer to fastbrowse list if empty(s:netrw_browselist) || bufnr("%") > s:netrw_browselist[-1] -" call Decho("appendng current buffer to browselist",'~'.expand("")) call add(s:netrw_browselist,bufnr("%")) -" call Decho("browselist=".string(s:netrw_browselist),'~'.expand("")) endif " enable autocmd events to handle refreshing/removing local browser buffers @@ -11061,10 +10259,8 @@ fun! s:LocalFastBrowser() augroup AuNetrwEvent au! if has("win32") -" call Decho("installing autocmd: ShellCmdPost",'~'.expand("")) au ShellCmdPost * call s:LocalBrowseRefresh() else -" call Decho("installing autocmds: ShellCmdPost FocusGained",'~'.expand("")) au ShellCmdPost,FocusGained * call s:LocalBrowseRefresh() endif augroup END @@ -11072,86 +10268,55 @@ fun! s:LocalFastBrowser() " user must have changed fastbrowse to its fast setting, so remove " the associated autocmd events elseif g:netrw_fastbrowse > 1 && exists("#ShellCmdPost") && exists("s:netrw_events") -" call Decho("remove AuNetrwEvent autcmd group",'~'.expand("")) unlet s:netrw_events augroup AuNetrwEvent au! augroup END augroup! AuNetrwEvent endif - -" call Dret("s:LocalFastBrowser : browselist<".string(s:netrw_browselist).">") endfun -" --------------------------------------------------------------------- -" s:LocalListing: does the job of "ls" for local directories {{{2 -fun! s:LocalListing() -" call Dfunc("s:LocalListing()") -" call Decho("ro=".&l:ro." ma=".&l:ma." mod=".&l:mod." wrap=".&l:wrap." (filename<".expand("%")."> win#".winnr()." ft<".&ft.">)",'~'.expand("")) -" call Decho("modified=".&modified." modifiable=".&modifiable." readonly=".&readonly,'~'.expand("")) -" call Decho("tab#".tabpagenr()." win#".winnr()." buf#".bufnr("%")."<".bufname("%")."> line#".line(".")." col#".col(".")." winline#".winline()." wincol#".wincol(),'~'.expand("")) - -" if exists("b:netrw_curdir") |call Decho('b:netrw_curdir<'.b:netrw_curdir.">") |else|call Decho("b:netrw_curdir doesn't exist",'~'.expand("")) |endif -" if exists("g:netrw_sort_by")|call Decho('g:netrw_sort_by<'.g:netrw_sort_by.">")|else|call Decho("g:netrw_sort_by doesn't exist",'~'.expand(""))|endif -" 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("")) - +fun! s:NetrwLocalListingList(dirname,setmaxfilenamelen) " get the list of files contained in the current directory - let dirname = b:netrw_curdir - let dirnamelen = strlen(b:netrw_curdir) + let dirname = a:dirname + let dirnamelen = strlen(dirname) let filelist = s:NetrwGlob(dirname,"*",0) let filelist = filelist + s:NetrwGlob(dirname,".*",0) -" call Decho("filelist=".string(filelist),'~'.expand("")) if g:netrw_cygwin == 0 && has("win32") -" call Decho("filelist=".string(filelist),'~'.expand("")) - elseif index(filelist,'..') == -1 && b:netrw_curdir !~ '/' + elseif index(filelist,'..') == -1 && dirname !~ '/' " include ../ in the glob() entry if its missing -" call Decho("forcibly including on \"..\"",'~'.expand("")) - let filelist= filelist+[s:ComposePath(b:netrw_curdir,"../")] -" call Decho("filelist=".string(filelist),'~'.expand("")) + let filelist= filelist+[s:ComposePath(dirname,"../")] endif -" call Decho("before while: dirname <".dirname.">",'~'.expand("")) -" call Decho("before while: dirnamelen<".dirnamelen.">",'~'.expand("")) -" call Decho("before while: filelist =".string(filelist),'~'.expand("")) - - if get(g:, 'netrw_dynamic_maxfilenamelen', 0) + if a:setmaxfilenamelen && get(g:, 'netrw_dynamic_maxfilenamelen', 0) let filelistcopy = map(deepcopy(filelist),'fnamemodify(v:val, ":t")') let g:netrw_maxfilenamelen = max(map(filelistcopy,'len(v:val)')) + 1 -" call Decho("dynamic_maxfilenamelen: filenames =".string(filelistcopy),'~'.expand("")) -" call Decho("dynamic_maxfilenamelen: g:netrw_maxfilenamelen=".g:netrw_maxfilenamelen,'~'.expand("")) endif -" 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("")) + let resultfilelist = [] for filename in filelist -" call Decho(" ",'~'.expand("")) -" call Decho("for filename in filelist: filename<".filename.">",'~'.expand("")) if getftype(filename) == "link" " indicate a symbolic link -" call Decho("indicate <".filename."> is a symbolic link with trailing @",'~'.expand("")) let pfile= filename."@" elseif getftype(filename) == "socket" " indicate a socket -" call Decho("indicate <".filename."> is a socket with trailing =",'~'.expand("")) let pfile= filename."=" elseif getftype(filename) == "fifo" " indicate a fifo -" call Decho("indicate <".filename."> is a fifo with trailing |",'~'.expand("")) let pfile= filename."|" elseif isdirectory(s:NetrwFile(filename)) " indicate a directory -" call Decho("indicate <".filename."> is a directory with trailing /",'~'.expand("")) let pfile= filename."/" elseif exists("b:netrw_curdir") && b:netrw_curdir !~ '^.*://' && !isdirectory(s:NetrwFile(filename)) if has("win32") if filename =~ '\.[eE][xX][eE]$' || filename =~ '\.[cC][oO][mM]$' || filename =~ '\.[bB][aA][tT]$' " indicate an executable -" call Decho("indicate <".filename."> is executable with trailing *",'~'.expand("")) let pfile= filename."*" else " normal file @@ -11159,7 +10324,6 @@ fun! s:LocalListing() endif elseif executable(filename) " indicate an executable -" call Decho("indicate <".filename."> is executable with trailing *",'~'.expand("")) let pfile= filename."*" else " normal file @@ -11170,16 +10334,12 @@ fun! s:LocalListing() " normal file let pfile= filename endif -" call Decho("pfile<".pfile."> (after *@/ appending)",'~'.expand("")) if pfile =~ '//$' let pfile= substitute(pfile,'//$','/','e') -" call Decho("change // to /: pfile<".pfile.">",'~'.expand("")) endif let pfile= strpart(pfile,dirnamelen) let pfile= substitute(pfile,'^[/\\]','','e') -" call Decho("filename<".filename.">",'~'.expand("")) -" call Decho("pfile <".pfile.">",'~'.expand("")) if w:netrw_liststyle == s:LONGLIST let longfile = printf("%-".g:netrw_maxfilenamelen."S",pfile) @@ -11192,47 +10352,46 @@ fun! s:LocalListing() endif let fsz = printf("%".szlen."S",sz) let pfile= longfile." ".fsz." ".strftime(g:netrw_timefmt,getftime(filename)) -" call Decho("longlist support: sz=".sz." fsz=".fsz,'~'.expand("")) 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("")) let t = getftime(filename) let ft = printf("%018d",t) -" call Decho("exe NetrwKeepj put ='".ft.'/'.pfile."'",'~'.expand("")) let ftpfile= ft.'/'.pfile - sil! NetrwKeepj put=ftpfile + let resultfilelist += [ftpfile] 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("")) let sz = getfsize(filename) let fsz = printf("%018d",sz) -" call Decho("exe NetrwKeepj put ='".fsz.'/'.filename."'",'~'.expand("")) let fszpfile= fsz.'/'.pfile - sil! NetrwKeepj put =fszpfile + let resultfilelist += [fszpfile] else " sort by name -" call Decho("implementing g:netrw_sort_by=".g:netrw_sort_by." (name)") -" call Decho("exe NetrwKeepj put ='".pfile."'",'~'.expand("")) - sil! NetrwKeepj put=pfile + let resultfilelist += [pfile] endif -" call DechoBuf(bufnr("%"),"bufnr(%)") + endfor + + return resultfilelist +endfun + +" --------------------------------------------------------------------- +" s:LocalListing: does the job of "ls" for local directories {{{2 +fun! s:LocalListing() + + let filelist = s:NetrwLocalListingList(b:netrw_curdir, 1) + for filename in filelist + sil! NetrwKeepj put =filename endfor " cleanup any windows mess at end-of-line sil! NetrwKeepj g/^$/d sil! NetrwKeepj %s/\r$//e call histdel("/",-1) -" call Decho("exe setl ts=".(g:netrw_maxfilenamelen+1),'~'.expand("")) exe "setl ts=".(g:netrw_maxfilenamelen+1) - -" call Dret("s:LocalListing") endfun " --------------------------------------------------------------------- @@ -11266,7 +10425,6 @@ endfun " --------------------------------------------------------------------- " s:NetrwLocalRename: rename a local file or directory {{{2 fun! s:NetrwLocalRename(path) range -" call Dfunc("NetrwLocalRename(path<".a:path.">)") if !exists("w:netrw_bannercnt") let w:netrw_bannercnt= b:netrw_bannercnt @@ -11277,15 +10435,12 @@ fun! s:NetrwLocalRename(path) range let ctr = a:firstline let svpos = winsaveview() let all = 0 -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) " rename files given by the markfilelist if exists("s:netrwmarkfilelist_{bufnr('%')}") for oldname in s:netrwmarkfilelist_{bufnr("%")} -" call Decho("oldname<".oldname.">",'~'.expand("")) if exists("subfrom") let newname= substitute(oldname,subfrom,subto,'') -" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">",'~'.expand("")) else call inputsave() let newname= input("Moving ".oldname." to : ",oldname,"file") @@ -11300,7 +10455,6 @@ fun! s:NetrwLocalRename(path) range if newname =~ '^s/' let subfrom = substitute(newname,'^s/\([^/]*\)/.*/$','\1','') let subto = substitute(newname,'^s/[^/]*/\(.*\)/$','\1','') -" call Decho("subfrom<".subfrom."> subto<".subto."> newname<".newname.">",'~'.expand("")) let newname = substitute(oldname,subfrom,subto,'') endif endif @@ -11312,12 +10466,9 @@ fun! s:NetrwLocalRename(path) range let all= 1 elseif response != "y" && response != "yes" " refresh the directory -" call Decho("refresh the directory listing",'~'.expand("")) - NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./',0)) NetrwKeepj call winrestview(svpos) let @@= ykeep -" call Dret("NetrwLocalRename") return endif endif @@ -11344,35 +10495,25 @@ fun! s:NetrwLocalRename(path) range NetrwKeepj norm! 0 let oldname= s:ComposePath(a:path,curword) -" call Decho("oldname<".oldname.">",'~'.expand("")) call inputsave() let newname= input("Moving ".oldname." to : ",substitute(oldname,'/*$','','e')) call inputrestore() call rename(oldname,newname) -" call Decho("renaming <".oldname."> to <".newname.">",'~'.expand("")) - let ctr= ctr + 1 endwhile endif " refresh the directory -" call Decho("refresh the directory listing",'~'.expand("")) - NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./',0)) NetrwKeepj call winrestview(svpos) let @@= ykeep - -" call Dret("NetrwLocalRename") endfun " --------------------------------------------------------------------- " s:NetrwLocalRm: {{{2 fun! s:NetrwLocalRm(path) range -" call Dfunc("s:NetrwLocalRm(path<".a:path.">)") -" call Decho("firstline=".a:firstline." lastline=".a:lastline,'~'.expand("")) - if !exists("w:netrw_bannercnt") let w:netrw_bannercnt= b:netrw_bannercnt endif @@ -11382,11 +10523,9 @@ fun! s:NetrwLocalRm(path) range let ret = 0 let all = 0 let svpos = winsaveview() -" call Decho("saving posn to svpos<".string(svpos).">",'~'.expand("")) if exists("s:netrwmarkfilelist_{bufnr('%')}") " remove all marked files -" call Decho("remove all marked files",'~'.expand("")) for fname in s:netrwmarkfilelist_{bufnr("%")} let ok= s:NetrwLocalRmFile(a:path,fname,all) if ok =~# 'q\%[uit]' || ok == "no" @@ -11399,7 +10538,6 @@ fun! s:NetrwLocalRm(path) range else " remove (multiple) files and directories -" call Decho("remove files in range [".a:firstline.",".a:lastline."]",'~'.expand("")) let keepsol= &l:sol setl nosol @@ -11429,15 +10567,11 @@ fun! s:NetrwLocalRm(path) range endif " refresh the directory -" call Decho("bufname<".bufname("%").">",'~'.expand("")) if bufname("%") != "NetrwMessage" - NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./')) -" call Decho("restoring posn to svpos<".string(svpos).">",'~'.expand("")) + NetrwKeepj call s:NetrwRefresh(1,s:NetrwBrowseChgDir(1,'./',0)) NetrwKeepj call winrestview(svpos) endif let @@= ykeep - -" call Dret("s:NetrwLocalRm") endfun " --------------------------------------------------------------------- @@ -12083,7 +11217,7 @@ 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("")) - " Clean out the last buffer: + " 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("$")) @@ -12163,13 +11297,16 @@ endfun " s:NetrwExe: executes a string using "!" {{{2 fun! s:NetrwExe(cmd) " call Dfunc("s:NetrwExe(a:cmd<".a:cmd.">)") - if has("win32") && &shell !~? 'cmd\|pwsh\|powershell' && !g:netrw_cygwin + if has("win32") " call Decho("using win32:",expand("")) let savedShell=[&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash] set shell& shellcmdflag& shellxquote& shellxescape& set shellquote& shellpipe& shellredir& shellslash& - exe a:cmd - let [&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash] = savedShell + try + exe a:cmd + finally + let [&shell,&shellcmdflag,&shellxquote,&shellxescape,&shellquote,&shellpipe,&shellredir,&shellslash] = savedShell + endtry else " call Decho("exe ".a:cmd,'~'.expand("")) exe a:cmd @@ -12272,7 +11409,7 @@ fun! s:NetrwHumanReadable(sz) " call Dfunc("s:NetrwHumanReadable(sz=".a:sz.") type=".type(a:sz)." style=".g:netrw_sizestyle ) if g:netrw_sizestyle == 'h' - if a:sz >= 1000000000 + if a:sz >= 1000000000 let sz = printf("%.1f",a:sz/1000000000.0)."g" elseif a:sz >= 10000000 let sz = printf("%d",a:sz/1000000)."m" @@ -12603,29 +11740,24 @@ endfun " --------------------------------------------------------------------- " s:ShowLink: used to modify thin and tree listings to show links {{{2 fun! s:ShowLink() -" " call Dfunc("s:ShowLink()") -" " call Decho("b:netrw_curdir<".(exists("b:netrw_curdir")? b:netrw_curdir : "doesn't exist").">",'~'.expand("")) -" " call Decho(printf("line#%4d: %s",line("."),getline(".")),'~'.expand("")) if exists("b:netrw_curdir") norm! $?\a - let fname = b:netrw_curdir.'/'.s:NetrwGetWord() + if exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST && exists("w:netrw_treetop") + let basedir = s:NetrwTreePath(w:netrw_treetop) + else + let basedir = b:netrw_curdir.'/' + endif + let fname = basedir.s:NetrwGetWord() let resname = resolve(fname) -" " call Decho("fname <".fname.">",'~'.expand("")) -" " call Decho("resname <".resname.">",'~'.expand("")) -" " call Decho("b:netrw_curdir<".b:netrw_curdir.">",'~'.expand("")) - if resname =~ '^\M'.b:netrw_curdir.'/' - let dirlen = strlen(b:netrw_curdir) - let resname = strpart(resname,dirlen+1) -" " call Decho("resname<".resname."> (b:netrw_curdir elided)",'~'.expand("")) + if resname =~ '^\M'.basedir + let dirlen = strlen(basedir) + let resname = strpart(resname,dirlen) endif let modline = getline(".")."\t --> ".resname -" " call Decho("fname <".fname.">",'~'.expand("")) -" " call Decho("modline<".modline.">",'~'.expand("")) setl noro ma call setline(".",modline) setl ro noma nomod endif -" " call Dret("s:ShowLink".((exists("fname")? ' : '.fname : 'n/a'))) endfun " --------------------------------------------------------------------- @@ -12700,7 +11832,7 @@ endfun fun! s:ShellEscape(s, ...) if has('win32') && $SHELL == '' && &shellslash return printf('"%s"', substitute(a:s, '"', '""', 'g')) - endif + endif let f = a:0 > 0 ? a:1 : 0 return shellescape(a:s, f) endfun @@ -12786,8 +11918,6 @@ endfun " * interprets result " See netrw#UserMaps() fun! s:UserMaps(islocal,funcname) -" call Dfunc("s:UserMaps(islocal=".a:islocal.",funcname<".a:funcname.">)") - if !exists("b:netrw_curdir") let b:netrw_curdir= getcwd() endif @@ -12796,30 +11926,22 @@ fun! s:UserMaps(islocal,funcname) if type(result) == 1 " if result from user's funcref is a string... -" call Decho("result string from user funcref<".result.">",'~'.expand("")) if result == "refresh" -" call Decho("refreshing display",'~'.expand("")) - call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) elseif result != "" -" call Decho("executing result<".result.">",'~'.expand("")) exe result endif elseif type(result) == 3 " if result from user's funcref is a List... -" call Decho("result List from user funcref<".string(result).">",'~'.expand("")) for action in result if action == "refresh" -" call Decho("refreshing display",'~'.expand("")) - call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./')) + call s:NetrwRefresh(a:islocal,s:NetrwBrowseChgDir(a:islocal,'./',0)) elseif action != "" -" call Decho("executing action<".action.">",'~'.expand("")) exe action endif endfor endif - -" call Dret("s:UserMaps") endfun " ========================== diff --git a/usr/share/vim/vim91/autoload/netrwFileHandlers.vim b/usr/share/vim/vim91/autoload/netrwFileHandlers.vim deleted file mode 100644 index 2b6f8f7a0f1..00000000000 --- a/usr/share/vim/vim91/autoload/netrwFileHandlers.vim +++ /dev/null @@ -1,363 +0,0 @@ -" netrwFileHandlers: contains various extension-based file handlers for -" netrw's browsers' x command ("eXecute launcher") -" Maintainer: This runtime file is looking for a new maintainer. -" Original Author: Charles E. Campbell -" Date: Sep 18, 2020 -" Version: 11 -" Copyright: Copyright (C) 1999-2012 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, -" netrwFileHandlers.vim is provided *as is* and comes with no -" warranty of any kind, either expressed or implied. In no -" event will the copyright holder be liable for any damages -" resulting from the use of this software. -" -" Rom 6:23 (WEB) For the wages of sin is death, but the free gift of God {{{1 -" is eternal life in Christ Jesus our Lord. - -" --------------------------------------------------------------------- -" Load Once: {{{1 -if exists("g:loaded_netrwFileHandlers") || &cp - finish -endif -let g:loaded_netrwFileHandlers= "v11" -if v:version < 702 - echohl WarningMsg - echo "***warning*** this version of netrwFileHandlers needs vim 7.2" - echohl Normal - finish -endif -let s:keepcpo= &cpo -set cpo&vim - -" --------------------------------------------------------------------- -" netrwFileHandlers#Invoke: {{{1 -fun! netrwFileHandlers#Invoke(exten,fname) -" call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)") - let exten= a:exten - " list of supported special characters. Consider rcs,v --- that can be - " supported with a NFH_rcsCOMMAv() handler - if exten =~ '[@:,$!=\-+%?;~]' - let specials= { -\ '@' : 'AT', -\ ':' : 'COLON', -\ ',' : 'COMMA', -\ '$' : 'DOLLAR', -\ '!' : 'EXCLAMATION', -\ '=' : 'EQUAL', -\ '-' : 'MINUS', -\ '+' : 'PLUS', -\ '%' : 'PERCENT', -\ '?' : 'QUESTION', -\ ';' : 'SEMICOLON', -\ '~' : 'TILDE'} - let exten= substitute(a:exten,'[@:,$!=\-+%?;~]','\=specials[submatch(0)]','ge') -" call Decho('fname<'.fname.'> done with dictionary') - endif - - if a:exten != "" && exists("*NFH_".exten) - " support user NFH_*() functions -" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') - exe "let ret= NFH_".exten.'("'.a:fname.'")' - elseif a:exten != "" && exists("*s:NFH_".exten) - " use builtin-NFH_*() functions -" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")') - exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")' - endif - -" call Dret("netrwFileHandlers#Invoke 0 : ret=".ret) - return 0 -endfun - -" --------------------------------------------------------------------- -" s:NFH_html: handles html when the user hits "x" when the {{{1 -" cursor is atop a *.html file -fun! s:NFH_html(pagefile) -" call Dfunc("s:NFH_html(".a:pagefile.")") - - let page= substitute(a:pagefile,'^','file://','') - - if executable("mozilla") -" call Decho("executing !mozilla ".page) - exe "!mozilla ".shellescape(page,1) - elseif executable("netscape") -" call Decho("executing !netscape ".page) - exe "!netscape ".shellescape(page,1) - else -" call Dret("s:NFH_html 0") - return 0 - endif - -" call Dret("s:NFH_html 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_htm: handles html when the user hits "x" when the {{{1 -" cursor is atop a *.htm file -fun! s:NFH_htm(pagefile) -" call Dfunc("s:NFH_htm(".a:pagefile.")") - - let page= substitute(a:pagefile,'^','file://','') - - if executable("mozilla") -" call Decho("executing !mozilla ".page) - exe "!mozilla ".shellescape(page,1) - elseif executable("netscape") -" call Decho("executing !netscape ".page) - exe "!netscape ".shellescape(page,1) - else -" call Dret("s:NFH_htm 0") - return 0 - endif - -" call Dret("s:NFH_htm 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_jpg: {{{1 -fun! s:NFH_jpg(jpgfile) -" call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)") - - if executable("gimp") - exe "silent! !gimp -s ".shellescape(a:jpgfile,1) - elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") -" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'")) - exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:jpgfile,1) - else -" call Dret("s:NFH_jpg 0") - return 0 - endif - -" call Dret("s:NFH_jpg 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_gif: {{{1 -fun! s:NFH_gif(giffile) -" call Dfunc("s:NFH_gif(giffile<".a:giffile.">)") - - if executable("gimp") - exe "silent! !gimp -s ".shellescape(a:giffile,1) - elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") - exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:giffile,1) - else -" call Dret("s:NFH_gif 0") - return 0 - endif - -" call Dret("s:NFH_gif 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_png: {{{1 -fun! s:NFH_png(pngfile) -" call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)") - - if executable("gimp") - exe "silent! !gimp -s ".shellescape(a:pngfile,1) - elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") - exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pngfile,1) - else -" call Dret("s:NFH_png 0") - return 0 - endif - -" call Dret("s:NFH_png 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_pnm: {{{1 -fun! s:NFH_pnm(pnmfile) -" call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)") - - if executable("gimp") - exe "silent! !gimp -s ".shellescape(a:pnmfile,1) - elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") - exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:pnmfile,1) - else -" call Dret("s:NFH_pnm 0") - return 0 - endif - -" call Dret("s:NFH_pnm 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_bmp: visualize bmp files {{{1 -fun! s:NFH_bmp(bmpfile) -" call Dfunc("s:NFH_bmp(bmpfile<".a:bmpfile.">)") - - if executable("gimp") - exe "silent! !gimp -s ".a:bmpfile - elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE") - exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".shellescape(a:bmpfile,1) - else -" call Dret("s:NFH_bmp 0") - return 0 - endif - -" call Dret("s:NFH_bmp 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_pdf: visualize pdf files {{{1 -fun! s:NFH_pdf(pdf) -" call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)") - if executable("gs") - exe 'silent! !gs '.shellescape(a:pdf,1) - elseif executable("pdftotext") - exe 'silent! pdftotext -nopgbrk '.shellescape(a:pdf,1) - else -" call Dret("s:NFH_pdf 0") - return 0 - endif - -" call Dret("s:NFH_pdf 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_doc: visualize doc files {{{1 -fun! s:NFH_doc(doc) -" call Dfunc("s:NFH_doc(doc<".a:doc.">)") - - if executable("oowriter") - exe 'silent! !oowriter '.shellescape(a:doc,1) - redraw! - else -" call Dret("s:NFH_doc 0") - return 0 - endif - -" call Dret("s:NFH_doc 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_sxw: visualize sxw files {{{1 -fun! s:NFH_sxw(sxw) -" call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)") - - if executable("oowriter") - exe 'silent! !oowriter '.shellescape(a:sxw,1) - redraw! - else -" call Dret("s:NFH_sxw 0") - return 0 - endif - -" call Dret("s:NFH_sxw 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_xls: visualize xls files {{{1 -fun! s:NFH_xls(xls) -" call Dfunc("s:NFH_xls(xls<".a:xls.">)") - - if executable("oocalc") - exe 'silent! !oocalc '.shellescape(a:xls,1) - redraw! - else -" call Dret("s:NFH_xls 0") - return 0 - endif - -" call Dret("s:NFH_xls 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_ps: handles PostScript files {{{1 -fun! s:NFH_ps(ps) -" call Dfunc("s:NFH_ps(ps<".a:ps.">)") - if executable("gs") -" call Decho("exe silent! !gs ".a:ps) - exe "silent! !gs ".shellescape(a:ps,1) - redraw! - elseif executable("ghostscript") -" call Decho("exe silent! !ghostscript ".a:ps) - exe "silent! !ghostscript ".shellescape(a:ps,1) - redraw! - elseif executable("gswin32") -" call Decho("exe silent! !gswin32 ".shellescape(a:ps,1)) - exe "silent! !gswin32 ".shellescape(a:ps,1) - redraw! - else -" call Dret("s:NFH_ps 0") - return 0 - endif - -" call Dret("s:NFH_ps 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_eps: handles encapsulated PostScript files {{{1 -fun! s:NFH_eps(eps) -" call Dfunc("s:NFH_eps()") - if executable("gs") - exe "silent! !gs ".shellescape(a:eps,1) - redraw! - elseif executable("ghostscript") - exe "silent! !ghostscript ".shellescape(a:eps,1) - redraw! - elseif executable("ghostscript") - exe "silent! !ghostscript ".shellescape(a:eps,1) - redraw! - elseif executable("gswin32") - exe "silent! !gswin32 ".shellescape(a:eps,1) - redraw! - else -" call Dret("s:NFH_eps 0") - return 0 - endif -" call Dret("s:NFH_eps 0") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_fig: handles xfig files {{{1 -fun! s:NFH_fig(fig) -" call Dfunc("s:NFH_fig()") - if executable("xfig") - exe "silent! !xfig ".a:fig - redraw! - else -" call Dret("s:NFH_fig 0") - return 0 - endif - -" call Dret("s:NFH_fig 1") - return 1 -endfun - -" --------------------------------------------------------------------- -" s:NFH_obj: handles tgif's obj files {{{1 -fun! s:NFH_obj(obj) -" call Dfunc("s:NFH_obj()") - if has("unix") && executable("tgif") - exe "silent! !tgif ".a:obj - redraw! - else -" call Dret("s:NFH_obj 0") - return 0 - endif - -" call Dret("s:NFH_obj 1") - return 1 -endfun - -let &cpo= s:keepcpo -unlet s:keepcpo -" --------------------------------------------------------------------- -" Modelines: {{{1 -" vim: fdm=marker diff --git a/usr/share/vim/vim91/autoload/racket.vim b/usr/share/vim/vim91/autoload/racket.vim index 50c24b0b06a..02b493b84d5 100644 --- a/usr/share/vim/vim91/autoload/racket.vim +++ b/usr/share/vim/vim91/autoload/racket.vim @@ -1,6 +1,6 @@ " Maintainer: D. Ben Knoble " URL: https://github.com/benknoble/vim-racket -" Last Change: 2023 Sep 22 +" Last Change: 2024 Nov 12 vim9script def MakePatternFromLiterals(xs: list): string @@ -170,7 +170,7 @@ def PosLT(left: dict, right: dict): bool enddef def IsForFold(word: string): bool - return ['for/fold', 'for/foldr', 'for*/fold', 'for*/foldr']->index(word) >= 0 + return ['for/fold', 'for/foldr', 'for/lists', 'for*/fold', 'for*/foldr', 'for*/lists']->index(word) >= 0 enddef def IsSecondForm(blnum: number, bcol: number, vlnum: number): bool @@ -209,5 +209,5 @@ def IsSecondForm(blnum: number, bcol: number, vlnum: number): bool endwhile # assert_report(printf('forms seen pre-return: %d', forms_seen)) - return forms_seen == 2 || (forms_seen == 1 && !empty(stack)) + return (forms_seen == 2 && empty(stack)) || (forms_seen == 1 && !empty(stack)) enddef diff --git a/usr/share/vim/vim91/autoload/tar.vim b/usr/share/vim/vim91/autoload/tar.vim index 9c4f16d7f60..436e24eb674 100644 --- a/usr/share/vim/vim91/autoload/tar.vim +++ b/usr/share/vim/vim91/autoload/tar.vim @@ -1,6 +1,6 @@ " tar.vim: Handles browsing tarfiles " AUTOLOAD PORTION -" Date: Nov 14, 2023 +" Date: Nov 11, 2024 " Version: 32b (with modifications from the Vim Project) " Maintainer: This runtime file is looking for a new maintainer. " Former Maintainer: Charles E Campbell @@ -23,7 +23,7 @@ if &cp || exists("g:loaded_tar") finish endif -let g:loaded_tar= "v32a" +let g:loaded_tar= "v32b" if v:version < 702 echohl WarningMsg echo "***warning*** this version of tar needs vim 7.2" @@ -41,7 +41,7 @@ if !exists("g:tar_browseoptions") let g:tar_browseoptions= "Ptf" endif if !exists("g:tar_readoptions") - let g:tar_readoptions= "OPxf" + let g:tar_readoptions= "pPxf" endif if !exists("g:tar_cmd") let g:tar_cmd= "tar" @@ -80,7 +80,7 @@ if !exists("g:tar_copycmd") let g:tar_copycmd= g:netrw_localcopycmd endif if !exists("g:tar_extractcmd") - let g:tar_extractcmd= "tar -xf" + let g:tar_extractcmd= "tar -pxf" endif " set up shell quoting character @@ -294,6 +294,41 @@ fun! tar#Read(fname,mode) set report=10 let tarfile = substitute(a:fname,'tarfile:\(.\{-}\)::.*$','\1','') let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','') + +" changing the directory to the temporary earlier to allow tar to extract the file with permissions intact + if !exists("*mkdir") + redraw! + echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None + let &report= repkeep + return + endif + + let curdir= getcwd() + let tmpdir= tempname() + let b:curdir= tmpdir + let b:tmpdir= curdir + if tmpdir =~ '\.' + let tmpdir= substitute(tmpdir,'\.[^.]*$','','e') + endif + call mkdir(tmpdir,"p") + + " attempt to change to the indicated directory + try + exe "cd ".fnameescape(tmpdir) + catch /^Vim\%((\a\+)\)\=:E344/ + redraw! + echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None + let &report= repkeep + return + endtry + + " place temporary files under .../_ZIPVIM_/ + if isdirectory("_ZIPVIM_") + call s:Rmdir("_ZIPVIM_") + endif + call mkdir("_ZIPVIM_") + cd _ZIPVIM_ + if has("win32unix") && executable("cygpath") " assuming cygwin let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') @@ -332,9 +367,10 @@ fun! tar#Read(fname,mode) if tarfile =~# '\.bz2$' exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname elseif tarfile =~# '\.\(gz\)$' exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp - + exe "read ".fname elseif tarfile =~# '\(\.tgz\|\.tbz\|\.txz\)' if has("unix") && executable("file") let filekind= system("file ".shellescape(tarfile,1)) @@ -343,20 +379,27 @@ fun! tar#Read(fname,mode) endif if filekind =~ "bzip2" exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname elseif filekind =~ "XZ" exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname elseif filekind =~ "Zstandard" exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname else exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname endif elseif tarfile =~# '\.lrp$' exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname elseif tarfile =~# '\.lzma$' exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname elseif tarfile =~# '\.\(xz\|txz\)$' exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. @@ -364,6 +407,16 @@ fun! tar#Read(fname,mode) endif " call Decho("8: exe silent r! ".g:tar_cmd." -".g:tar_readoptions.tar_secure.shellescape(tarfile,1)." ".shellescape(fname,1).decmp) exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp + exe "read ".fname + endif + + redraw! + +if v:shell_error != 0 + cd .. + call s:Rmdir("_ZIPVIM_") + exe "cd ".fnameescape(curdir) + echohl Error | echo "***error*** (tar#Read) sorry, unable to open or extract ".tarfile." with ".fname | echohl None endif if doro @@ -388,6 +441,10 @@ fun! tar#Write(fname) " call Dfunc("tar#Write(fname<".a:fname.">) b:tarfile<".b:tarfile."> tblfile_".winnr()."<".s:tblfile_{winnr()}.">") let repkeep= &report set report=10 + + " temporary buffer variable workaround because too fucking tired. but it works now + let curdir= b:curdir + let tmpdir= b:tmpdir if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-' redraw! @@ -404,44 +461,6 @@ fun! tar#Write(fname) " call Dret("tar#Write") return endif - if !exists("*mkdir") - redraw! -" call Decho("***error*** (tar#Write) sorry, mkdir() doesn't work on your system") - echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None - let &report= repkeep -" call Dret("tar#Write") - return - endif - - let curdir= getcwd() - let tmpdir= tempname() -" call Decho("orig tempname<".tmpdir.">") - if tmpdir =~ '\.' - let tmpdir= substitute(tmpdir,'\.[^.]*$','','e') - endif -" call Decho("tmpdir<".tmpdir.">") - call mkdir(tmpdir,"p") - - " attempt to change to the indicated directory - try - exe "cd ".fnameescape(tmpdir) - catch /^Vim\%((\a\+)\)\=:E344/ - redraw! -" call Decho("***error*** (tar#Write) cannot cd to temporary directory") - echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None - let &report= repkeep -" call Dret("tar#Write") - return - endtry -" call Decho("current directory now: ".getcwd()) - - " place temporary files under .../_ZIPVIM_/ - if isdirectory("_ZIPVIM_") - call s:Rmdir("_ZIPVIM_") - endif - call mkdir("_ZIPVIM_") - cd _ZIPVIM_ -" call Decho("current directory now: ".getcwd()) let tarfile = substitute(b:tarfile,'tarfile:\(.\{-}\)::.*$','\1','') let fname = substitute(b:tarfile,'tarfile:.\{-}::\(.*\)$','\1','') diff --git a/usr/share/vim/vim91/autoload/tutor.vim b/usr/share/vim/vim91/autoload/tutor.vim new file mode 100644 index 00000000000..3265fdde369 --- /dev/null +++ b/usr/share/vim/vim91/autoload/tutor.vim @@ -0,0 +1,219 @@ +" vim: fdm=marker et ts=4 sw=4 + +" Setup: {{{1 +function! tutor#SetupVim() + if !exists('g:did_load_ftplugin') || g:did_load_ftplugin != 1 + filetype plugin on + endif + if has('syntax') + if !exists('g:syntax_on') || g:syntax_on == 0 + syntax on + endif + endif +endfunction + +" Loads metadata file, if available +function! tutor#LoadMetadata() + let b:tutor_metadata = json_decode(join(readfile(expand('%').'.json'), "\n")) +endfunction + +" Mappings: {{{1 + +function! tutor#SetNormalMappings() + nnoremap :call tutor#FollowLink(0) + nnoremap <2-LeftMouse> :call tutor#MouseDoubleClick() + nnoremap >> :call tutor#InjectCommand() +endfunction + +function! tutor#MouseDoubleClick() + if foldclosed(line('.')) > -1 + normal! zo + else + if match(getline('.'), '^#\{1,} ') > -1 + silent normal! zc + else + call tutor#FollowLink(0) + endif + endif +endfunction + +function! tutor#InjectCommand() + let l:cmd = substitute(getline('.'), '^\s*', '', '') + exe l:cmd + redraw | echohl WarningMsg | echon "tutor: ran" | echohl None | echon " " | echohl Statement | echon l:cmd +endfunction + +function! tutor#FollowLink(force) + let l:stack_s = join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'), '') + if l:stack_s =~# 'tutorLink' + let l:link_start = searchpairpos('\[', '', ')', 'nbcW') + let l:link_end = searchpairpos('\[', '', ')', 'ncW') + if l:link_start[0] == l:link_end[0] + let l:linkData = getline(l:link_start[0])[l:link_start[1]-1:l:link_end[1]-1] + else + return + endif + let l:target = matchstr(l:linkData, '(\@<=.*)\@=') + if a:force != 1 && match(l:target, '\*.\+\*') > -1 + call cursor(l:link_start[0], l:link_end[1]) + call search(l:target, '') + normal! ^ + elseif a:force != 1 && match(l:target, '^@tutor:') > -1 + let l:tutor = matchstr(l:target, '@tutor:\zs.*') + exe "Tutor ".l:tutor + else + exe "help ".l:target + endif + endif +endfunction + +" Folding And Info: {{{1 + +function! tutor#TutorFolds() + if getline(v:lnum) =~# '^#\{1,6}' + return ">". len(matchstr(getline(v:lnum), '^#\{1,6}')) + else + return "=" + endif +endfunction + +" Marks: {{{1 + +function! tutor#ApplyMarks() + hi! link tutorExpect Special + if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect') + let b:tutor_sign_id = 1 + for expct in keys(b:tutor_metadata['expect']) + let lnum = eval(expct) + call matchaddpos('tutorExpect', [lnum]) + call tutor#CheckLine(lnum) + endfor + endif +endfunction + +function! tutor#ApplyMarksOnChanged() + if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect') + let lnum = line('.') + if index(keys(b:tutor_metadata['expect']), string(lnum)) > -1 + call tutor#CheckLine(lnum) + endif + endif +endfunction + +function! tutor#CheckLine(line) + if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect') + let bufn = bufnr('%') + let ctext = getline(a:line) + if b:tutor_metadata['expect'][string(a:line)] == -1 || ctext ==# b:tutor_metadata['expect'][string(a:line)] + exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorok buffer=".bufn + else + exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorbad buffer=".bufn + endif + let b:tutor_sign_id+=1 + endif +endfunction + +" Tutor Cmd: {{{1 + +function! s:Locale() + if exists('v:lang') && v:lang =~ '\a\a' + let l:lang = v:lang + elseif $LC_ALL =~ '\a\a' + let l:lang = $LC_ALL + elseif $LANG =~ '\a\a' + let l:lang = $LANG + else + let l:lang = 'en_US' + endif + return split(l:lang, '_') +endfunction + +function! s:GlobPath(lp, pat) + if version >= 704 && has('patch279') + return globpath(a:lp, a:pat, 1, 1) + else + return split(globpath(a:lp, a:pat, 1), '\n') + endif +endfunction + +function! s:Sort(a, b) + let mod_a = fnamemodify(a:a, ':t') + let mod_b = fnamemodify(a:b, ':t') + if mod_a == mod_b + let retval = 0 + elseif mod_a > mod_b + if match(mod_a, '^vim-') > -1 && match(mod_b, '^vim-') == -1 + let retval = -1 + else + let retval = 1 + endif + else + if match(mod_b, '^vim-') > -1 && match(mod_a, '^vim-') == -1 + let retval = 1 + else + let retval = -1 + endif + endif + return retval +endfunction + +function! s:GlobTutorials(name) + " search for tutorials: + " 1. non-localized + let l:tutors = s:GlobPath(&rtp, 'tutor/'.a:name.'.tutor') + " 2. localized for current locale + let l:locale_tutors = s:GlobPath(&rtp, 'tutor/'.s:Locale()[0].'/'.a:name.'.tutor') + " 3. fallback to 'en' + if len(l:locale_tutors) == 0 + let l:locale_tutors = s:GlobPath(&rtp, 'tutor/en/'.a:name.'.tutor') + endif + call extend(l:tutors, l:locale_tutors) + return uniq(sort(l:tutors, 's:Sort'), 's:Sort') +endfunction + +function! tutor#TutorCmd(tutor_name) + if match(a:tutor_name, '[[:space:]]') > 0 + echom "Only one argument accepted (check spaces)" + return + endif + + if a:tutor_name == '' + let l:tutor_name = 'vim-01-beginner.tutor' + else + let l:tutor_name = a:tutor_name + endif + + if match(l:tutor_name, '\.tutor$') > 0 + let l:tutor_name = fnamemodify(l:tutor_name, ':r') + endif + + let l:tutors = s:GlobTutorials(l:tutor_name) + + if len(l:tutors) == 0 + echom "No tutorial with that name found" + return + endif + + if len(l:tutors) == 1 + let l:to_open = l:tutors[0] + else + let l:idx = 0 + let l:candidates = ['Several tutorials with that name found. Select one:'] + for candidate in map(copy(l:tutors), + \'fnamemodify(v:val, ":h:h:t")."/".s:Locale()[0]."/".fnamemodify(v:val, ":t")') + let l:idx += 1 + call add(l:candidates, l:idx.'. '.candidate) + endfor + let l:tutor_to_open = inputlist(l:candidates) + let l:to_open = l:tutors[l:tutor_to_open-1] + endif + + call tutor#SetupVim() + exe "edit ".l:to_open +endfunction + +function! tutor#TutorCmdComplete(lead,line,pos) + let l:tutors = s:GlobTutorials('*') + let l:names = uniq(sort(map(l:tutors, 'fnamemodify(v:val, ":t:r")'), 's:Sort')) + return join(l:names, "\n") +endfunction diff --git a/usr/share/vim/vim91/autoload/typst.vim b/usr/share/vim/vim91/autoload/typst.vim index 55edd23928c..6d097dd922e 100644 --- a/usr/share/vim/vim91/autoload/typst.vim +++ b/usr/share/vim/vim91/autoload/typst.vim @@ -1,6 +1,6 @@ " Language: Typst " Maintainer: Gregory Anders -" Last Change: 2024-07-14 +" Last Change: 2024 Nov 02 " Based on: https://github.com/kaarmu/typst.vim function! typst#indentexpr() abort @@ -18,6 +18,9 @@ function! typst#indentexpr() abort " Use last indent for block comments if l:synname == 'typstCommentBlock' return l:ind + " do not change the indents of bullet lists + elseif l:synname == 'typstMarkupBulletList' + return indent(a:lnum) endif if l:pline =~ '\v[{[(]\s*$' @@ -31,6 +34,31 @@ function! typst#indentexpr() abort return l:ind endfunction +function typst#foldexpr() + let line = getline(v:lnum) + + " Whenever the user wants to fold nested headers under the parent + let nested = get(g:, "typst_foldnested", 1) + + " Regular headers + let depth = match(line, '\(^=\+\)\@<=\( .*$\)\@=') + + " Do not fold nested regular headers + if depth > 1 && !nested + let depth = 1 + endif + + if depth > 0 + " check syntax, it should be typstMarkupHeading + let syncode = synstack(v:lnum, 1) + if len(syncode) > 0 && synIDattr(syncode[0], 'name') ==# 'typstMarkupHeading' + return ">" . depth + endif + endif + + return "=" +endfunction + " Gets the previous non-blank line that is not a comment. function! s:get_prev_nonblank(lnum) abort let l:lnum = prevnonblank(a:lnum) diff --git a/usr/share/vim/vim91/compiler/cppcheck.vim b/usr/share/vim/vim91/compiler/cppcheck.vim index ed7c46e90f9..4df12d1714f 100644 --- a/usr/share/vim/vim91/compiler/cppcheck.vim +++ b/usr/share/vim/vim91/compiler/cppcheck.vim @@ -1,15 +1,15 @@ " vim compiler file " Compiler: cppcheck (C++ static checker) " Maintainer: Vincent B. (twinside@free.fr) -" Last Change: 2024 Oct 4 by @Konfekt +" Last Change: 2024 Nov 08 by @Konfekt -if exists("cppcheck") - finish -endif +if exists("current_compiler") | finish | endif let current_compiler = "cppcheck" let s:cpo_save = &cpo -set cpo-=C +set cpo&vim + +let s:slash = has('win32')? '\' : '/' if !exists('g:c_cppcheck_params') let g:c_cppcheck_params = '--verbose --force --inline-suppr' @@ -20,12 +20,12 @@ endif let &l:makeprg = 'cppcheck --quiet' \ ..' --template="{file}:{line}:{column}: {severity}: [{id}] {message} {callstack}"' - \ ..' '..get(b:, 'c_cppcheck_params', - \ g:c_cppcheck_params..' '..(&filetype ==# 'cpp' ? ' --language=c++' : '')) + \ ..' '..get(b:, 'c_cppcheck_params', get(g:, 'c_cppcheck_params', (&filetype ==# 'cpp' ? ' --language=c++' : ''))) \ ..' '..get(b:, 'c_cppcheck_includes', get(g:, 'c_cppcheck_includes', \ (filereadable('compile_commands.json') ? '--project=compile_commands.json' : - \ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I')))) -silent CompilerSet makeprg + \ (!empty(glob('*'..s:slash..'compile_commands.json', 1, 1)) ? '--project='..glob('*'..s:slash..'compile_commands.json', 1, 1)[0] : + \ (empty(&path) ? '' : '-I')..join(map(filter(split(&path, ','), 'isdirectory(v:val)'),'shellescape(v:val)'), ' -I'))))) +exe 'CompilerSet makeprg='..escape(&l:makeprg, ' "') CompilerSet errorformat= \%f:%l:%c:\ %tarning:\ %m, diff --git a/usr/share/vim/vim91/compiler/maven.vim b/usr/share/vim/vim91/compiler/maven.vim new file mode 100644 index 00000000000..ef8d8a6fb29 --- /dev/null +++ b/usr/share/vim/vim91/compiler/maven.vim @@ -0,0 +1,40 @@ +" Vim compiler file +" Compiler: Maven +" Maintainer: D. Ben Knoble +" Maintainer: Konfekt +" Original Source: https://github.com/JalaiAmitahl/maven-compiler.vim/blob/master/compiler/mvn.vim +" (Copyright Dan Taylor, distributed under the same terms as LICENSE) +" Original Source: https://github.com/mikelue/vim-maven-plugin/blob/master/compiler/maven.vim +" (distributed under same terms as LICENSE per +" https://github.com/mikelue/vim-maven-plugin/issues/13) +" Last Change: 2024 Nov 12 + +if exists("current_compiler") + finish +endif +let current_compiler = "maven" + +CompilerSet makeprg=mvn\ --batch-mode + +" Error message for POM +CompilerSet errorformat=[FATAL]\ Non-parseable\ POM\ %f:\ %m%\\s%\\+@%.%#line\ %l\\,\ column\ %c%.%#, +CompilerSet errorformat+=[%tRROR]\ Malformed\ POM\ %f:\ %m%\\s%\\+@%.%#line\ %l\\,\ column\ %c%.%# + +" Java related build messages +CompilerSet errorformat+=[%tARNING]\ %f:[%l\\,%c]\ %m +CompilerSet errorformat+=[%tRROR]\ %f:[%l\\,%c]\ %m +CompilerSet errorformat+=%A[%t%[A-Z]%#]\ %f:[%l\\,%c]\ %m,%Z +CompilerSet errorformat+=%A%f:[%l\\,%c]\ %m,%Z + +" jUnit related build messages +CompilerSet errorformat+=%+E\ \ %#test%m,%Z +CompilerSet errorformat+=%+E[ERROR]\ Please\ refer\ to\ %f\ for\ the\ individual\ test\ results. +" Message from JUnit 5(5.3.X), TestNG(6.14.X), JMockit(1.43), and AssertJ(3.11.X) +CompilerSet errorformat+=%+E%>[ERROR]\ %.%\\+Time\ elapsed:%.%\\+<<<\ FAILURE!, +CompilerSet errorformat+=%+E%>[ERROR]\ %.%\\+Time\ elapsed:%.%\\+<<<\ ERROR!, +CompilerSet errorformat+=%+Z%\\s%#at\ %f(%\\f%\\+:%l), +CompilerSet errorformat+=%+C%.%# + +" Misc message removal +CompilerSet errorformat+=%-G[INFO]\ %.%#, +CompilerSet errorformat+=%-G[debug]\ %.%# diff --git a/usr/share/vim/vim91/compiler/mypy.vim b/usr/share/vim/vim91/compiler/mypy.vim new file mode 100644 index 00000000000..891488626a9 --- /dev/null +++ b/usr/share/vim/vim91/compiler/mypy.vim @@ -0,0 +1,19 @@ +" Vim compiler file +" Compiler: Mypy (Python static checker) +" Maintainer: @Konfekt +" Last Change: 2024 Nov 07 + +if exists("current_compiler") | finish | endif +let current_compiler = "mypy" + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=mypy +let &l:makeprg = 'mypy --show-column-numbers ' + \ ..get(b:, 'mypy_makeprg_params', get(g:, 'mypy_makeprg_params', '--strict --ignore-missing-imports')) +exe 'CompilerSet makeprg='..escape(&l:makeprg, ' "') +CompilerSet errorformat=%f:%l:%c:\ %t%*[^:]:\ %m + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/usr/share/vim/vim91/compiler/pylint.vim b/usr/share/vim/vim91/compiler/pylint.vim index 14e9696dbb4..4c9c23e125b 100644 --- a/usr/share/vim/vim91/compiler/pylint.vim +++ b/usr/share/vim/vim91/compiler/pylint.vim @@ -1,13 +1,20 @@ " Vim compiler file -" Compiler: Pylint for Python -" Maintainer: Daniel Moch -" Last Change: 2016 May 20 -" 2024 Apr 03 by The Vim Project (removed :CompilerSet definition) - -if exists("current_compiler") - finish -endif +" Compiler: Pylint for Python +" Maintainer: Daniel Moch +" Last Change: 2024 Nov 07 by The Vim Project (added params variable) + +if exists("current_compiler") | finish | endif let current_compiler = "pylint" -CompilerSet makeprg=pylint\ --output-format=text\ --msg-template=\"{path}:{line}:{column}:{C}:\ [{symbol}]\ {msg}\"\ --reports=no +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=ruff +let &l:makeprg = 'pylint ' . + \ '--output-format=text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" --reports=no ' . + \ get(b:, "pylint_makeprg_params", get(g:, "pylint_makeprg_params", '--jobs=0')) +exe 'CompilerSet makeprg='..escape(&l:makeprg, ' "') CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/usr/share/vim/vim91/compiler/ruff.vim b/usr/share/vim/vim91/compiler/ruff.vim new file mode 100644 index 00000000000..11a69740d8f --- /dev/null +++ b/usr/share/vim/vim91/compiler/ruff.vim @@ -0,0 +1,19 @@ +" Vim compiler file +" Compiler: Ruff (Python linter) +" Maintainer: @pbnj-dragon +" Last Change: 2024 Nov 07 + +if exists("current_compiler") | finish | endif +let current_compiler = "ruff" + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=ruff +let &l:makeprg= 'ruff check --output-format=concise ' + \ ..get(b:, 'ruff_makeprg_params', get(g:, 'ruff_makeprg_params', '--preview')) +exe 'CompilerSet makeprg='..escape(&l:makeprg, ' "') +CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m,%f:%l:%c\ -\ %m,%f: + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/usr/share/vim/vim91/defaults.vim b/usr/share/vim/vim91/defaults.vim index ff8ce8ea18f..953cec700cc 100644 --- a/usr/share/vim/vim91/defaults.vim +++ b/usr/share/vim/vim91/defaults.vim @@ -1,7 +1,7 @@ " The default vimrc file. " " Maintainer: The Vim Project -" Last change: 2023 Aug 10 +" Last Change: 2024 Nov 14 " Former Maintainer: Bram Moolenaar " " This is loaded if no vimrc file was found. @@ -39,7 +39,6 @@ set backspace=indent,eol,start set history=200 " keep 200 lines of command line history set ruler " show the cursor position all the time set showcmd " display incomplete commands -set wildmenu " display completion matches in a status line set ttimeout " time out for key codes set ttimeoutlen=100 " wait up to 100ms after Esc for special key @@ -107,14 +106,19 @@ if 1 " (happens when dropping a file on gvim), for a commit or rebase message " (likely a different one than last time), and when using xxd(1) to filter " and edit binary files (it transforms input files back and forth, causing - " them to have dual nature, so to speak) + " them to have dual nature, so to speak) or when running the new tutor autocmd BufReadPost * \ let line = line("'\"") \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit' - \ && index(['xxd', 'gitrebase'], &filetype) == -1 + \ && index(['xxd', 'gitrebase', 'tutor'], &filetype) == -1 \ | execute "normal! g`\"" \ | endif + " Set the default background for putty to dark. Putty usually sets the + " $TERM to xterm and by default it starts with a dark background which + " makes syntax highlighting often hard to read with bg=light + " undo this using: ":au! vimStartup TermResponse" + autocmd TermResponse * if v:termresponse == "\e[>0;136;0c" | set bg=dark | endif augroup END " Quite a few people accidentally type "q:" instead of ":q" and get confused diff --git a/usr/share/vim/vim91/doc/autocmd.txt b/usr/share/vim/vim91/doc/autocmd.txt index f200a30e502..6ca00a6e1ef 100644 --- a/usr/share/vim/vim91/doc/autocmd.txt +++ b/usr/share/vim/vim91/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.1. Last change: 2024 Aug 18 +*autocmd.txt* For Vim version 9.1. Last change: 2024 Oct 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1254,10 +1254,19 @@ TerminalWinOpen Just after a terminal buffer was created, with TermResponse After the response to |t_RV| is received from the terminal. The value of |v:termresponse| can be used to do things depending on the - terminal version. Note that this event may be - triggered halfway executing another event, - especially if file I/O, a shell command or - anything else that takes time is involved. + terminal version. + This is used in |defaults.vim| to detect + putty terminal and set a dark background: > + + au TermResponse * + \ if v:termresponse == "\e[>0;136;0c" + \ set bg=dark + \ endif +< + Note: that this event may be triggered halfway + executing another event, especially if file + I/O, a shell command or anything else that + takes time is involved. *TermResponseAll* TermResponseAll After the response to |t_RV|, |t_RC|, |t_RS|, |t_RB|, |t_RF|, or |t_u7| are received from diff --git a/usr/share/vim/vim91/doc/builtin.txt b/usr/share/vim/vim91/doc/builtin.txt index 32167d67fb8..ab63681980f 100644 --- a/usr/share/vim/vim91/doc/builtin.txt +++ b/usr/share/vim/vim91/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2024 Oct 14 +*builtin.txt* For Vim version 9.1. Last change: 2024 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -222,6 +222,7 @@ getbufline({buf}, {lnum} [, {end}]) getbufoneline({buf}, {lnum}) String line {lnum} of buffer {buf} getbufvar({buf}, {varname} [, {def}]) any variable {varname} in buffer {buf} +getcellpixels() List get character cell pixel size getcellwidths() List get character cell width overrides getchangelist([{buf}]) List list of change list items getchar([{expr}]) Number or String @@ -467,9 +468,9 @@ prop_type_get({name} [, {props}]) prop_type_list([{props}]) List get list of property types pum_getpos() Dict position and size of pum if visible pumvisible() Number whether popup menu is visible -py3eval({expr}) any evaluate |python3| expression -pyeval({expr}) any evaluate |Python| expression -pyxeval({expr}) any evaluate |python_x| expression +py3eval({expr} [, {locals}]) any evaluate |python3| expression +pyeval({expr} [, {locals}]) any evaluate |Python| expression +pyxeval({expr} [, {locals}]) any evaluate |python_x| expression rand([{expr}]) Number get pseudo-random number range({expr} [, {max} [, {stride}]]) List items from {expr} to {max} @@ -1625,7 +1626,7 @@ charclass({string}) *charclass()* The character class is one of: 0 blank 1 punctuation - 2 word character + 2 word character (depends on 'iskeyword') 3 emoji other specific Unicode class The class is used in patterns and word motions. @@ -3786,6 +3787,15 @@ getbufvar({buf}, {varname} [, {def}]) *getbufvar()* Return type: any, depending on {varname} +getcellpixels() *getcellpixels()* + Returns a |List| of terminal cell pixel size. + List format is [xpixels, ypixels]. + Only works on (terminal) Unix. For gVim, on other systems and + on failure returns []. + + Return type: list + + getcellwidths() *getcellwidths()* Returns a |List| of cell widths of character ranges overridden by |setcellwidths()|. The format is equal to the argument of @@ -4836,7 +4846,7 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()* < Return type: list -< + getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()* Same as |getregion()|, but returns a list of positions describing the buffer text segments bound by {pos1} and @@ -4893,6 +4903,7 @@ getregtype([{regname}]) *getregtype()* < Return type: |String| + getscriptinfo([{opts}]) *getscriptinfo()* Returns a |List| with information about all the sourced Vim scripts in the order they were sourced, like what @@ -5202,7 +5213,7 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]]) *glob()* on {list} -glob2regpat({string}) *glob2regpat()* +glob2regpat({string}) *glob2regpat()* Convert a file pattern, as used by glob(), into a search pattern. The result can be used to match with a string that is a file name. E.g. > @@ -5655,7 +5666,7 @@ iconv({string}, {from}, {to}) *iconv()* Return type: |String| -id({item}) *id()* +id({item}) *id()* The result is a unique String associated with the {item} and not with the {item}'s contents. It is only valid while the {item} exists and is referenced. It is valid only in the @@ -7080,7 +7091,7 @@ matchbufline({buf}, {pat}, {lnum}, {end}, [, {dict}]) Return type: list> or list -matchdelete({id} [, {win}) *matchdelete()* *E802* *E803* +matchdelete({id} [, {win}) *matchdelete()* *E802* *E803* Deletes a match with ID {id} previously defined by |matchadd()| or one of the |:match| commands. Returns 0 if successful, otherwise -1. See example for |matchadd()|. All matches can @@ -8126,9 +8137,14 @@ pumvisible() *pumvisible()* Return type: |Number| -py3eval({expr}) *py3eval()* +py3eval({expr} [, {locals}]) *py3eval()* Evaluate Python expression {expr} and return its result converted to Vim data structures. + If a {locals} |Dictionary| is given, it defines set of local + variables available in the expression. The keys are variable + names and the values are the variable values. |Dictionary| and + |List| values are referenced, and may be updated by the + expression (as if |python-bindeval| was used). Numbers and strings are returned as they are (strings are copied though, Unicode strings are additionally converted to 'encoding'). @@ -8140,15 +8156,17 @@ py3eval({expr}) *py3eval()* Can also be used as a |method|: > GetExpr()->py3eval() + 'b",".join(l)'->py3eval({'l': ['a', 'b', 'c']}) < Return type: any, depending on {expr} {only available when compiled with the |+python3| feature} *E858* *E859* -pyeval({expr}) *pyeval()* +pyeval({expr} [, {locals}]) *pyeval()* Evaluate Python expression {expr} and return its result converted to Vim data structures. + For {locals} see |py3eval()|. Numbers and strings are returned as they are (strings are copied though). Lists are represented as Vim |List| type. @@ -8164,9 +8182,10 @@ pyeval({expr}) *pyeval()* {only available when compiled with the |+python| feature} -pyxeval({expr}) *pyxeval()* +pyxeval({expr} [, {locals}]) *pyxeval()* Evaluate Python expression {expr} and return its result converted to Vim data structures. + For {locals} see |py3eval()|. Uses Python 2 or 3, see |python_x| and 'pyxversion'. See also: |pyeval()|, |py3eval()| @@ -11954,7 +11973,7 @@ wildmenumode() *wildmenumode()* For example to make work like in wildmode, use: > :cnoremap wildmenumode() ? "\\" : "\" < - (Note, this needs the 'wildcharm' option set appropriately). + (Note: this needs the 'wildcharm' option set appropriately). Return type: |Number| diff --git a/usr/share/vim/vim91/doc/change.txt b/usr/share/vim/vim91/doc/change.txt index 785f4accae0..e4366551d68 100644 --- a/usr/share/vim/vim91/doc/change.txt +++ b/usr/share/vim/vim91/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 9.1. Last change: 2024 Oct 07 +*change.txt* For Vim version 9.1. Last change: 2024 Nov 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -586,6 +586,8 @@ comment (starting with '"') after the `:!` command. program {filter} (for {Visual} see |Visual-mode|). :{range}![!]{filter} [!][arg] *:range!* + For executing external commands see |:!| + Filter {range} lines through the external program {filter}. Vim replaces the optional bangs with the latest given command and appends the optional [arg]. diff --git a/usr/share/vim/vim91/doc/develop.txt b/usr/share/vim/vim91/doc/develop.txt index 678a9246115..84aa53dc8c3 100644 --- a/usr/share/vim/vim91/doc/develop.txt +++ b/usr/share/vim/vim91/doc/develop.txt @@ -1,4 +1,4 @@ -*develop.txt* For Vim version 9.1. Last change: 2024 May 11 +*develop.txt* For Vim version 9.1. Last change: 2024 Nov 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -157,6 +157,7 @@ VIM IS... NOT *design-not* being less consistent over all platforms. But functional GUI features are welcomed. + ============================================================================== 2. Coding style *coding-style* @@ -165,23 +166,30 @@ stick to these rules, to keep the sources readable and maintainable. This list is not complete. Look in the source code for more examples. +The code repository contains an editorconfig file, that can be used together +with the distributed editorconfig plugin |editorconfig-install| to ensure the +recommended style is followed. + MAKING CHANGES *style-changes* The basic steps to make changes to the code: 1. Get the code from github. That makes it easier to keep your changed version in sync with the main code base (it may be a while before your - changes will be included). You do need to spend some time learning git, - it's not the most user friendly tool. + changes will be included). 2. Adjust the documentation. Doing this first gives you an impression of how your changes affect the user. 3. Make the source code changes. 4. Check ../doc/todo.txt if the change affects any listed item. -5. Make a patch with "git diff". You can also create a pull request on - github, but it's the diff that matters. -6. Make a note about what changed, preferably mentioning the problem and the +5. Add a test to src/testdir to verify the new behaviour and ensure it won't + regress in the future. +6. Make a patch with "git diff". +7. Make a note about what changed, preferably mentioning the problem and the solution. Send an email to the |vim-dev| maillist with an explanation and - include the diff. Or create a pull request on github. + include the diff. + +For any non-trivial change, please always create a pull request on github, +since this triggers the test suite. C COMPILER *style-compiler* *ANSI-C* *C89* *C99* @@ -191,52 +199,234 @@ Later standards, such as C99, are not widely supported, or at least not 100% supported. Therefore we use only some of the C99 features and explicitly disallow some (this will gradually be adjusted over time). -Please don't make changes everywhere to use the C99 features, it causes merge -problems for existing patches. Only use them for new and changed code. +Features not to be used ~ + +These C99 features are not to be used, because not enough compilers support +them: +- Variable length arrays (even in C11 this is an optional feature). +- C99 _Bool and _Complex types. +- "inline" (it's hardly ever needed, let the optimizer do its work) +- flexible array members: Not supported by HP-UX C compiler (John Marriott) -Comments ~ -Traditionally Vim uses /* comments */. We intend to keep it that way -for file and function headers and larger blocks of code, E.g.: +COMMENTS *style-comments* + +Try to avoid putting multiline comments inside a function body: if the +function is so complex that you need to separately comment parts of it, you +should probably rethink the structure of the function. + +For file headers and function descriptions use: > + /* + * Description + */ +< +For everything else use: > + // comment +< + + +INDENTATION *style-indentation* + +We use 4 space to indent the code. If you are using Vim to edit the source, +you don't need to do anything due to the |modeline|. + +For other editors an `.editorconfig` is provided at the root of the repo. + + +DECLARATIONS *style-declarations* + +Declare, when possible, `for` loop variables in the guard: +OK: > + for (int i = 0; i < len; ++i) +< +Wrong: > + int i; + for (i = 0; i < len; ++i) +< +Always declare a variable with a default value: +OK: > + int n = 0; + int *ptr = NULL; +< +Wrong: > + int n; + int *ptr; +< + + +BRACES *style-braces* + +All curly braces must be returned onto a new line: +OK: > + if (cond) + { + cmd; + cmd; + } + else + { + cmd; + cmd; + } +< +Wrong: > + if (cond) { + cmd; + cmd; + } else { + cmd; + cmd; + } +< +OK: > + while (cond) + { + cmd; + } +< +Wrong: > + while (cond) { + cmd; + } +< +When a block has one line, including comments, the braces can be left out. +OK: > + if (cond) + cmd; + else + cmd; +< +Wrong: > + if (cond) /* - * The "foo" argument does something useful. - * Return OK or FAIL. + * comment */ -For new code or lines of code that change, it is preferred to use // comments. -Especially when it comes after code: - int some_var; // single line comment useful here + cmd; + else + cmd; +< +When an `if`/`else` has braces on one block, the other should have it too. +OK: > + if (cond) + { + cmd; + } + else + { + cmd; + cmd; + } +< +Wrong: > + if (cond) + cmd; + else + { + cmd; + cmd; + } + + if (cond) + { + cmd; + cmd; + } + else + cmd; +< +OK: > + while (cond) + cmd; +< +Wrong: +> + while (cond) + if (cond) + cmd; +< + + +TYPES *style-types* + +Use descriptive types. You can find a list of them in the src/structs.h file +and probably in a typedef in the file you are working on. + +Note that all custom types are postfixed with "_T" + +OK: > + int is_valid_line_number(linenr_T lnum); +< +Wrong: > + int is_valid_line_number(unsigned long lnum); +< + + +SPACES AND PUNCTUATION *style-spaces* -Enums ~ +No space between a function name and the bracket: -The last item in an enum may have a trailing comma. C89 didn't allow this. +OK: func(arg); +Wrong: func (arg); -Types ~ +Do use a space after `if`, `while`, `switch`, etc. -"long long" is allowed and can be expected to be 64 bits. Use %lld in printf -formats. Also "long long unsigned" with %llu. +OK: if (arg) for (;;) +Wrong: if(arg) for(;;) -Declarations ~ +Use a space after a comma or semicolon: -Now that the minimal supported compiler is MSVC 2015 declarations do not need -to be at the start of a block. However, it is often a good idea to do this -anyway. +OK: func(arg1, arg2); for (i = 0; i < 2; ++i) +Wrong: func(arg1,arg2); for (i = 0;i < 2;++i) -Declaration of the for loop variable inside the loop is recommended: - for (int i = 0; i < len; ++i) -Since this is clearly an advantage we'll use this more often. +Use a space before and after '=', '+', '/', etc. +Wrong: var=a*5; +OK: var = a * 5; -Not to be used ~ +Use empty lines to group similar actions together. -These C99 features are not to be used, because not enough compilers support -them: -- Variable length arrays (even in C11 this is an optional feature). -- _Bool and _Complex types. -- "inline" (it's hardly ever needed, let the optimizer do its work) -- flexible array members: Not supported by HP-UX C compiler (John Marriott) +OK: > + msg_puts_title(_("\n--- Signs ---")); + msg_putchar('\n'); + + if (rbuf == NULL) + buf = firstbuf; + else + buf = rbuf; + while (buf != NULL && !got_int) +< +Wrong: > + msg_puts_title(_("\n--- Signs ---")); + msg_putchar('\n'); + if (rbuf == NULL) + buf = firstbuf; + else + buf = rbuf; + while (buf != NULL && !got_int) +< -USE OF COMMON FUNCTIONS *style-functions* + +FUNCTIONS *style-functions* + +Use function declarations with the return type on a separate indented line. + +OK: > + int + function_name(int arg1, int arg2) + { + } +< +Wrong: > + int function_name(int arg1, int arg2) + { + } +< + +Give meaningful names to function parameters. + + +USE OF COMMON FUNCTIONS *style-common-functions* Some functions that are common to use, have a special Vim version. Always consider using the Vim version, because they were introduced with a reason. @@ -311,27 +501,30 @@ get_env_value() Linux system function VARIOUS *style-various* -Typedef'ed names should end in "_T": > - typedef int some_T; -Define'ed names should be uppercase: > +Define'd names should be uppercase: > #define SOME_THING +< + Features always start with "FEAT_": > #define FEAT_FOO +< Don't use '\"', some compilers can't handle it. '"' works fine. -Don't use: +Don't use: > #if HAVE_SOME +< Some compilers can't handle that and complain that "HAVE_SOME" is not defined. -Use +Use > #ifdef HAVE_SOME -or +< +or > #if defined(HAVE_SOME) - +< STYLE *style-examples* -General rule: One statement per line. +One statement per line. Wrong: if (cond) a = 1; @@ -349,101 +542,6 @@ OK: do a = 1; while (cond); -Wrong: if (cond) { - cmd; - cmd; - } else { - cmd; - cmd; - } - -OK: if (cond) - { - cmd; - cmd; - } - else - { - cmd; - cmd; - } - -When a block has one line the braces can be left out. When an if/else has -braces on one block, it usually looks better when the other block also has -braces: -OK: if (cond) - cmd; - else - cmd; - -OK: if (cond) - { - cmd; - } - else - { - cmd; - cmd; - } - -Use ANSI (new style) function declarations with the return type on a separate -indented line. - -Wrong: int function_name(int arg1, int arg2) - -OK: /* - * Explanation of what this function is used for. - * - * Return value explanation. - */ - int - function_name( - int arg1, // short comment about arg1 - int arg2) // short comment about arg2 - { - int local; // comment about local - - local = arg1 * arg2; - - - -SPACES AND PUNCTUATION *style-spaces* - -No space between a function name and the bracket: - -Wrong: func (arg); -OK: func(arg); - -Do use a space after if, while, switch, etc. - -Wrong: if(arg) for(;;) -OK: if (arg) for (;;) - -Use a space after a comma and semicolon: - -Wrong: func(arg1,arg2); for (i = 0;i < 2;++i) -OK: func(arg1, arg2); for (i = 0; i < 2; ++i) - -Use a space before and after '=', '+', '/', etc. - -Wrong: var=a*5; -OK: var = a * 5; - -In general: Use empty lines to group lines of code together. Put a comment -just above the group of lines. This makes it easier to quickly see what is -being done. - -OK: /* Prepare for building the table. */ - get_first_item(); - table_idx = 0; - - /* Build the table */ - while (has_item()) - table[table_idx++] = next_item(); - - /* Finish up. */ - cleanup_items(); - generate_hash(table); ============================================================================== 3. Design decisions *design-decisions* diff --git a/usr/share/vim/vim91/doc/editing.txt b/usr/share/vim/vim91/doc/editing.txt index 6f004bb2549..a70515d6ff2 100644 --- a/usr/share/vim/vim91/doc/editing.txt +++ b/usr/share/vim/vim91/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 9.1. Last change: 2024 Oct 13 +*editing.txt* For Vim version 9.1. Last change: 2024 Oct 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1058,6 +1058,15 @@ explanation of when the copy is made and when the file is renamed. If the creation of a backup file fails, the write is not done. If you want to write anyway add a '!' to the command. + *file-watcher* +When you notice issues with programs, that act upon when a buffer is written +(like inotify, entr or fswatch) or when external applications execute Vim to +edit the file (like git) and those programs do not seem to notice that the +original file has been changed, you may want to consider switching the +'backupcopy' option value to "yes". This makes sure, Vim writes to the same +file, that those watcher programs expect, without creating a new file (which +prevents them from detecting that the file has changed). See also |crontab| + *write-permissions* When writing a new file the permissions are read-write. For unix the mask is 0o666 with additionally umask applied. When writing a file that was read Vim diff --git a/usr/share/vim/vim91/doc/eval.txt b/usr/share/vim/vim91/doc/eval.txt index b911d3323c0..b2fb93c8f8c 100644 --- a/usr/share/vim/vim91/doc/eval.txt +++ b/usr/share/vim/vim91/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 9.1. Last change: 2024 Jul 28 +*eval.txt* For Vim version 9.1. Last change: 2024 Nov 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -2026,6 +2026,7 @@ v:cmdbang Set like v:cmdarg for a file read/write command. When a "!" was used the value is 1, otherwise it is 0. Note that this can only be used in autocommands. For user commands || can be used. + *v:collate* *collate-variable* v:collate The current locale setting for collation order of the runtime environment. This allows Vim scripts to be aware of the diff --git a/usr/share/vim/vim91/doc/filetype.txt b/usr/share/vim/vim91/doc/filetype.txt index 252551c3598..06fc8292356 100644 --- a/usr/share/vim/vim91/doc/filetype.txt +++ b/usr/share/vim/vim91/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*filetype.txt* For Vim version 9.1. Last change: 2024 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -667,6 +667,19 @@ HARE *ft-hare* Since the text for this plugin is rather long it has been put in a separate file: |ft_hare.txt|. +IDRIS2 *ft-idris2-plugin* + +By default the following options are set: > + + setlocal shiftwidth=2 tabstop=2 expandtab + setlocal comments=s1:{-,mb:-,ex:-},:\|\|\|,:-- + setlocal commentstring=--\ %s + setlocal wildignore+=*.ibc + +To use tabs instead of spaces for indentation, set the following variable +in your vimrc: > + + let g:idris2#allow_tabchar = 1 JAVA *ft-java-plugin* @@ -830,6 +843,12 @@ To enable folding use this: > let g:markdown_recommended_style = 0 +ORG *ft-org-plugin* + +To enable folding use this: > + let g:org_folding = 1 +< + PDF *ft-pdf-plugin* Two maps, and , are provided to simulate a tag stack for navigating @@ -939,6 +958,19 @@ TYPST *ft-typst-plugin* *g:typst_conceal* When |TRUE| the Typst filetype plugin will set the 'conceallevel' option to 2. + *g:typst_folding* +When |TRUE| the Typst filetype plugin will fold headings. (default: |FALSE|) + +To enable: > + let g:typst_folding = 1 +< + *g:typst_foldnested* +When |TRUE| the Typst filetype plugin will fold nested heading under their +parents. (default: |TRUE|) + +To disable: > + let g:typst_foldnested = 0 +< VIM *ft-vim-plugin* The Vim filetype plugin defines mappings to move to the start and end of diff --git a/usr/share/vim/vim91/doc/gui.txt b/usr/share/vim/vim91/doc/gui.txt index 071de9c4b13..4fdfc0f05a7 100644 --- a/usr/share/vim/vim91/doc/gui.txt +++ b/usr/share/vim/vim91/doc/gui.txt @@ -1,4 +1,4 @@ -*gui.txt* For Vim version 9.1. Last change: 2024 Jul 17 +*gui.txt* For Vim version 9.1. Last change: 2024 Nov 07 VIM REFERENCE MANUAL by Bram Moolenaar @@ -474,6 +474,8 @@ When the "unnamed" string is included in the 'clipboard' option, the unnamed register is the same as the "* register. Thus you can yank to and paste the selection without prepending "* to commands. +See also |W23|. + ============================================================================== 5. Menus *menus* diff --git a/usr/share/vim/vim91/doc/gui_x11.txt b/usr/share/vim/vim91/doc/gui_x11.txt index dbd4b108436..0658bfab983 100644 --- a/usr/share/vim/vim91/doc/gui_x11.txt +++ b/usr/share/vim/vim91/doc/gui_x11.txt @@ -1,4 +1,4 @@ -*gui_x11.txt* For Vim version 9.1. Last change: 2024 Apr 22 +*gui_x11.txt* For Vim version 9.1. Last change: 2024 Nov 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -708,6 +708,14 @@ Examples: (assuming the default option values) Note that the text in the "+ register remains available when making a Visual selection, which makes other text available in the "* register. That allows overwriting selected text. + + *W23* +When you are yanking into the "* or "+ register and Vim cannot establish a +connection to the X11 selection (or clipboard), it will use register 0 and +output a warning: + + Warning: Clipboard register not available, using register 0 ~ + *x11-cut-buffer* There are, by default, 8 cut-buffers: CUT_BUFFER0 to CUT_BUFFER7. Vim only uses CUT_BUFFER0, which is the one that xterm uses by default. diff --git a/usr/share/vim/vim91/doc/help.txt b/usr/share/vim/vim91/doc/help.txt index faa5f327155..77ea273ec6b 100644 --- a/usr/share/vim/vim91/doc/help.txt +++ b/usr/share/vim/vim91/doc/help.txt @@ -1,4 +1,4 @@ -*help.txt* For Vim version 9.1. Last change: 2024 May 27 +*help.txt* For Vim version 9.1. Last change: 2024 Nov 07 VIM - main help file k @@ -232,6 +232,7 @@ Standard plugins ~ |pi_paren.txt| Highlight matching parens |pi_spec.txt| Filetype plugin to work with rpm spec files |pi_tar.txt| Tar file explorer +|pi_tutor.txt| Interactive tutorial for Vim |pi_vimball.txt| Create a self-installing Vim script |pi_zip.txt| Zip archive explorer diff --git a/usr/share/vim/vim91/doc/helphelp.txt b/usr/share/vim/vim91/doc/helphelp.txt index 40039e39164..8ade446e6ec 100644 --- a/usr/share/vim/vim91/doc/helphelp.txt +++ b/usr/share/vim/vim91/doc/helphelp.txt @@ -1,4 +1,4 @@ -*helphelp.txt* For Vim version 9.1. Last change: 2024 Apr 10 +*helphelp.txt* For Vim version 9.1. Last change: 2024 Nov 03 VIM REFERENCE MANUAL by Bram Moolenaar @@ -246,6 +246,62 @@ command: > To rebuild the help tags in the runtime directory (requires write permission there): > :helptags $VIMRUNTIME/doc +< + *help-TOC* *help-toc-install* + +If you want to access an interactive table of contents, from any position in +the file, you can use the helptoc plugin. Load the plugin with: > + + packadd helptoc + +Then you can use the `:HelpToc` command to open a popup menu. +The latter supports the following normal commands: > + + key | effect + ----+--------------------------------------------------------- + j | select next entry + k | select previous entry + J | same as j, and jump to corresponding line in main buffer + K | same as k, and jump to corresponding line in main buffer + c | select nearest entry from cursor position in main buffer + g | select first entry + G | select last entry + H | collapse one level + L | expand one level + p | print current entry on command-line + + P | same as p but automatically, whenever selection changes + | press multiple times to toggle feature on/off + + q | quit menu + z | redraw menu with current entry at center + + | increase width of popup menu + - | decrease width of popup menu + ? | show/hide a help window + / | search for pattern + + | scroll down half a page + | scroll up half a page + | scroll down a whole page + | scroll up a whole page + | select first entry + | select last entry + +The plugin can also provide a table of contents in man pages, markdown files, +and terminal buffers. In the latter, the entries will be the past executed +shell commands. To find those, the following pattern is used: > + + ^\w\+@\w\+:\f\+\$\s + +This is meant to match a default bash prompt. If it doesn't match your prompt, +you can change the regex with the `shell_prompt` key from the `g:helptoc` +dictionary variable: > + + let g:helptoc = {'shell_prompt': 'regex matching your shell prompt'} + +Tip: After inserting a pattern to look for with the `/` command, if you press + instead of , you can then get more context for each remaining entry +by pressing `J` or `K`. ============================================================================== 2. Translated help files *help-translated* diff --git a/usr/share/vim/vim91/doc/if_pyth.txt b/usr/share/vim/vim91/doc/if_pyth.txt index 623684152b7..480ff02c276 100644 --- a/usr/share/vim/vim91/doc/if_pyth.txt +++ b/usr/share/vim/vim91/doc/if_pyth.txt @@ -1,4 +1,4 @@ -*if_pyth.txt* For Vim version 9.1. Last change: 2024 May 16 +*if_pyth.txt* For Vim version 9.1. Last change: 2024 Nov 09 VIM REFERENCE MANUAL by Paul Moore @@ -201,6 +201,10 @@ vim.eval(str) *python-eval* [{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name': ~ 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] ~ + NOTE: In Vim9 script, local variables in def functions are not visible + to python evaluations. To pass local variables to python evaluations, + use the {locals} dict when calling |py3eval()| and friends. + vim.bindeval(str) *python-bindeval* Like |python-eval|, but returns special objects described in |python-bindeval-objects|. These python objects let you modify (|List| @@ -741,6 +745,10 @@ To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()| functions to evaluate Python expressions and pass their values to Vim script. |pyxeval()| is also available. +You can inject local variables into the evaluation using the optional {locals} +dict. This can be particularly useful in vim9script where vim.eval +|python-eval| will not find locals in a def func. + The Python value "None" is converted to v:none. ============================================================================== diff --git a/usr/share/vim/vim91/doc/indent.txt b/usr/share/vim/vim91/doc/indent.txt index 9266f3a4086..8f347d7d942 100644 --- a/usr/share/vim/vim91/doc/indent.txt +++ b/usr/share/vim/vim91/doc/indent.txt @@ -1,4 +1,4 @@ -*indent.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*indent.txt* For Vim version 9.1. Last change: 2024 Nov 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -813,6 +813,38 @@ Detail: : GetCSSIndent() else : -1 +IDRIS2 *ft-idris2-indent* + +Idris 2 indentation can be configured with several variables that control the +indentation level for different language constructs: + +The "g:idris2_indent_if" variable controls the indentation of `then` and `else` +blocks after `if` statements. Defaults to 3. + +The "g:idris2_indent_case" variable controls the indentation of patterns in +`case` expressions. Defaults to 5. + +The "g:idris2_indent_let" variable controls the indentation after `let` +bindings. Defaults to 4. + +The "g:idris2_indent_rewrite" variable controls the indentation after `rewrite` +expressions. Defaults to 8. + +The "g:idris2_indent_where" variable controls the indentation of `where` +blocks. Defaults to 6. + +The "g:idris2_indent_do" variable controls the indentation in `do` blocks. +Defaults to 3. + +Example configuration: > + + let g:idris2_indent_if = 2 + let g:idris2_indent_case = 4 + let g:idris2_indent_let = 4 + let g:idris2_indent_rewrite = 8 + let g:idris2_indent_where = 6 + let g:idris2_indent_do = 3 +< MATLAB *ft-matlab-indent* *matlab-indent* *matlab-indenting* diff --git a/usr/share/vim/vim91/doc/message.txt b/usr/share/vim/vim91/doc/message.txt index 6453b95fabf..69d8bc7c6ff 100644 --- a/usr/share/vim/vim91/doc/message.txt +++ b/usr/share/vim/vim91/doc/message.txt @@ -1,4 +1,4 @@ -*message.txt* For Vim version 9.1. Last change: 2024 Mar 13 +*message.txt* For Vim version 9.1. Last change: 2024 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -29,7 +29,7 @@ depends on the 'shortmess' option. Clear messages, keeping only the {count} most recent ones. -The number of remembered messages is fixed at 200. +The number of remembered messages is determined by the 'msghistory' option. *g<* The "g<" command can be used to see the last page of previous command output. diff --git a/usr/share/vim/vim91/doc/options.txt b/usr/share/vim/vim91/doc/options.txt index 48ca25adf74..1aa5cccf7d7 100644 --- a/usr/share/vim/vim91/doc/options.txt +++ b/usr/share/vim/vim91/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 9.1. Last change: 2024 Oct 14 +*options.txt* For Vim version 9.1. Last change: 2024 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -439,10 +439,11 @@ Note: In the future more global options can be made |global-local|. Using ":setlocal" on a global option might work differently then. *option-value-function* -Some options ('completefunc', 'imactivatefunc', 'imstatusfunc', 'omnifunc', -'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') are set to -a function name or a function reference or a lambda function. When using a -lambda it will be converted to the name, e.g. "123". Examples: +Some options ('completefunc', 'findfunc', 'imactivatefunc', 'imstatusfunc', +'omnifunc', 'operatorfunc', 'quickfixtextfunc', 'tagfunc' and 'thesaurusfunc') +are set to a function name or a function reference or a lambda function. When +using a lambda it will be converted to the name, e.g. "123". +Examples: > set opfunc=MyOpFunc set opfunc=function('MyOpFunc') @@ -1151,12 +1152,13 @@ A jump table for the options with a short description can be found at |Q_op|. useful for example in source trees where all the files are symbolic or hard links and any changes should stay in the local source tree, not be propagated back to the original source. - *crontab* + *crontab* One situation where "no" and "auto" will cause problems: A program that opens a file, invokes Vim to edit that file, and then tests if the open file was changed (through the file descriptor) will check the backup file instead of the newly created file. "crontab -e" is an - example. + example, as are several |file-watcher| daemons like inotify. In that + case you probably want to switch this option. When a copy is made, the original file is truncated and then filled with the new text. This means that protection bits, owner and @@ -3402,7 +3404,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'fileformat'* *'ff'* 'fileformat' 'ff' string (MS-Windows default: "dos", - Unix, macOS default: "unix") + Unix default: "unix") local to buffer This gives the of the current buffer, which is used for reading/writing the buffer from/to a file: @@ -3425,7 +3427,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'fileformats'* *'ffs'* 'fileformats' 'ffs' string (default: Vim+Vi MS-Windows: "dos,unix", - Vim Unix, macOS: "unix,dos", + Vim Unix: "unix,dos", Vi Cygwin: "unix,dos", Vi others: "") global @@ -3513,7 +3515,7 @@ A jump table for the options with a short description can be found at |Q_op|. Only alphanumeric characters, '-' and '_' can be used. *'fillchars'* *'fcs'* -'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~") +'fillchars' 'fcs' string (default "vert:|,fold:-,eob:~,lastline:@") global or local to window |global-local| Characters to fill the statuslines, vertical separators and special lines in the window. @@ -3551,6 +3553,56 @@ A jump table for the options with a short description can be found at |Q_op|. eob EndOfBuffer |hl-EndOfBuffer| lastline NonText |hl-NonText| + *'findfunc'* *'ffu'* *E1514* +'findfunc' 'ffu' string (default empty) + global or local to buffer |global-local| + {not available when compiled without the |+eval| + feature} + Function that is called to obtain the filename(s) for the |:find| + command. When this option is empty, the internal |file-searching| + mechanism is used. + + The value can be the name of a function, a |lambda| or a |Funcref|. + See |option-value-function| for more information. + + The function is called with two arguments. The first argument is a + |String| and is the |:find| command argument. The second argument is + a |Boolean| and is set to |v:true| when the function is called to get + a List of command-line completion matches for the |:find| command. + The function should return a List of strings. + + The function is called only once per |:find| command invocation. + The function can process all the directories specified in 'path'. + + If a match is found, the function should return a |List| containing + one or more file names. If a match is not found, the function + should return an empty List. + + If any errors are encountered during the function invocation, an + empty List is used as the return value. + + It is not allowed to change text or jump to another window while + executing the 'findfunc' |textlock|. + + This option cannot be set from a |modeline| or in the |sandbox|, for + security reasons. + + Examples: +> + " Use glob() + func FindFuncGlob(cmdarg, cmdcomplete) + let pat = a:cmdcomplete ? $'{a:cmdarg}*' : a:cmdarg + return glob(pat, v:false, v:true) + endfunc + set findfunc=FindFuncGlob + + " Use the 'git ls-files' output + func FindGitFiles(cmdarg, cmdcomplete) + let fnames = systemlist('git ls-files') + return fnames->filter('v:val =~? a:cmdarg') + endfunc + set findfunc=FindGitFiles +< *'fixendofline'* *'fixeol'* *'nofixendofline'* *'nofixeol'* 'fixendofline' 'fixeol' boolean (default on) local to buffer @@ -4388,7 +4440,8 @@ A jump table for the options with a short description can be found at |Q_op|. global A history of ":" commands, and a history of previous search patterns is remembered. This option decides how many entries may be stored in - each of these histories (see |cmdline-editing|). + each of these histories (see |cmdline-editing| and 'msghistory' for + the number of messages to remember). The maximum value is 10000. NOTE: This option is set to the Vi default value when 'compatible' is set and to the Vim default value when 'compatible' is reset. @@ -4916,7 +4969,7 @@ A jump table for the options with a short description can be found at |Q_op|. set and to the Vim default value when 'compatible' is reset. *'isprint'* *'isp'* -'isprint' 'isp' string (default for Win32 and macOS: +'isprint' 'isp' string (default for Win32 and VMS: "@,~-255"; otherwise: "@,161-255") global The characters given by this option are displayed directly on the @@ -5865,6 +5918,12 @@ A jump table for the options with a short description can be found at |Q_op|. time in msec between two mouse clicks for the second click to be recognized as a multi click. + *'msghistory'* *'mhi'* +'msghistory' 'mhi' number (default 500) + global + Determines how many entries are remembered in the |:messages| history. + The maximum value is 10000. + *'mzquantum'* *'mzq'* 'mzquantum' 'mzq' number (default 100) global @@ -6741,9 +6800,6 @@ A jump table for the options with a short description can be found at |Q_op|. $VIMRUNTIME, $VIM/vimfiles/after, $HOME/vimfiles/after" - macOS: "$VIM:vimfiles, - $VIMRUNTIME, - $VIM:vimfiles:after" Haiku: "$BE_USER_SETTINGS/vim, $VIM/vimfiles, $VIMRUNTIME, @@ -8704,7 +8760,9 @@ A jump table for the options with a short description can be found at |Q_op|. be restored if possible, see |X11|. When this option contains printf-style '%' items, they will be - expanded according to the rules used for 'statusline'. + expanded according to the rules used for 'statusline'. If it contains + an invalid '%' format, the value is used as-is and no error or warning + will be given when the value is set. This option cannot be set in a modeline when 'modelineexpr' is off. Example: > @@ -9054,7 +9112,6 @@ A jump table for the options with a short description can be found at |Q_op|. for Win32: "$HOME/vimfiles/view", for Unix: "$HOME/.vim/view" or "$XDG_CONFIG_HOME/vim/view" - for macOS: "$VIM/vimfiles/view", for VMS: "sys$login:vimfiles/view") global {not available when compiled without the |+mksession| @@ -9380,7 +9437,7 @@ A jump table for the options with a short description can be found at |Q_op|. happens when there are special characters. *'wildmenu'* *'wmnu'* *'nowildmenu'* *'nowmnu'* -'wildmenu' 'wmnu' boolean (default off, set in |defaults.vim|) +'wildmenu' 'wmnu' boolean (default on) global When 'wildmenu' is on, command-line completion operates in an enhanced mode. On pressing 'wildchar' (usually ) to invoke completion, diff --git a/usr/share/vim/vim91/doc/os_mac.txt b/usr/share/vim/vim91/doc/os_mac.txt index 0421fb7b19b..0bf197d6d58 100644 --- a/usr/share/vim/vim91/doc/os_mac.txt +++ b/usr/share/vim/vim91/doc/os_mac.txt @@ -1,4 +1,4 @@ -*os_mac.txt* For Vim version 9.1. Last change: 2019 Apr 21 +*os_mac.txt* For Vim version 9.1. Last change: 2024 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar et al. @@ -118,9 +118,13 @@ Shift-Control-2. When reporting any Mac specific bug or feature change, please use the vim-mac maillist |vim-mac|. However, you need to be subscribed. An alternative is to -send a message to the current MacVim maintainers: +report issues either directly at the Vim github repository: - mac@vim.org +https://github.com/vim/vim/issues + +or for MacVim specific issues, you may report those over here: + +https://github.com/macvim-dev/macvim/issues ============================================================================== 7. Compiling Vim *mac-compile* diff --git a/usr/share/vim/vim91/doc/pattern.txt b/usr/share/vim/vim91/doc/pattern.txt index 4351944df92..6ebef9e44f9 100644 --- a/usr/share/vim/vim91/doc/pattern.txt +++ b/usr/share/vim/vim91/doc/pattern.txt @@ -1,4 +1,4 @@ -*pattern.txt* For Vim version 9.1. Last change: 2024 Jun 18 +*pattern.txt* For Vim version 9.1. Last change: 2024 Nov 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -164,7 +164,7 @@ or auto suspended with nohlsearch plugin. See |nohlsearch-install|. When 'shortmess' does not include the "S" flag, Vim will automatically show an -index, on which the cursor is. This can look like this: > +index, on which the cursor is. This can look like this: > [1/5] Cursor is on first of 5 matches. [1/>99] Cursor is on first of more than 99 matches. @@ -757,7 +757,7 @@ overview. \([a-z]\+\)\zs,\1 ",abc" in "abc,abc" \@123<= - Like "\@<=" but only look back 123 bytes. This avoids trying lots + Like "\@<=" but only look back 123 bytes. This avoids trying lots of matches that are known to fail and make executing the pattern very slow. Example, check if there is a "<" just before "span": /<\@1<=span @@ -783,7 +783,7 @@ overview. \(\/\/.*\)\@ /\%Vfoo.*ba\%Vr -< This also works if only "foo bar" was Visually selected. This: > +< This also works if only "foo bar" was Visually selected. This: > /\%Vfoo.*bar\%V < would match "foo bar" if the Visual selection continues after the "r". Only works for the current buffer. @@ -1014,7 +1014,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on): < To match all characters after the current virtual column (where the cursor is): > /\%>.v.* -< Column 17 is not included, because this is a |/zero-width| match. To +< Column 17 is not included, because this is a |/zero-width| match. To include the column use: > /^.*\%17v. < This command does the same thing, but also matches when there is no @@ -1138,11 +1138,11 @@ x A single character, with no special meaning, matches itself in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'. - If two characters in the sequence are separated by '-', this is shorthand for the full list of ASCII characters between them. E.g., - "[0-9]" matches any decimal digit. If the starting character exceeds - the ending character, e.g. [c-a], E944 occurs. Non-ASCII characters + "[0-9]" matches any decimal digit. If the starting character exceeds + the ending character, e.g. [c-a], E944 occurs. Non-ASCII characters can be used, but the character values must not be more than 256 apart - in the old regexp engine. For example, searching by [\u3000-\u4000] - after setting re=1 emits a E945 error. Prepending \%#=2 will fix it. + in the old regexp engine. For example, searching by [\u3000-\u4000] + after setting re=1 emits a E945 error. Prepending \%#=2 will fix it. - A character class expression is evaluated to the set of characters belonging to that character class. The following character classes are supported: @@ -1208,7 +1208,7 @@ x A single character, with no special meaning, matches itself any character that's not in "^]-\bdertnoUux". "[\xyz]" matches '\', 'x', 'y' and 'z'. It's better to use "\\" though, future expansions may use other characters after '\'. - - Omitting the trailing ] is not considered an error. "[]" works like + - Omitting the trailing ] is not considered an error. "[]" works like "[]]", it matches the ']' character. - The following translations are accepted when the 'l' flag is not included in 'cpoptions': @@ -1444,14 +1444,14 @@ Finally, these constructs are unique to Perl: display you may get unexpected results. That is because Vim looks for a match in the line where redrawing starts. - Also see |matcharg()| and |getmatches()|. The former returns + Also see |matcharg()| and |getmatches()|. The former returns the highlight group and pattern of a previous |:match| command. The latter returns a list with highlight groups and patterns defined by both |matchadd()| and |:match|. Highlighting matches using |:match| are limited to three matches (aside from |:match|, |:2match| and |:3match| are - available). |matchadd()| does not have this limitation and in + available). |matchadd()| does not have this limitation and in addition makes it possible to prioritize matches. Another example, which highlights all characters in virtual @@ -1480,7 +1480,7 @@ Finally, these constructs are unique to Perl: with the lowest number has priority if several match at the same position. It uses the match id 3. The ":3match" command is used by (Vim < 9.0.2054) |matchparen| - plugin. You are suggested to use ":match" for manual matching + plugin. You are suggested to use ":match" for manual matching and ":2match" for another plugin or even better make use of the more flexible |matchadd()| (and similar) functions instead. @@ -1489,10 +1489,10 @@ Finally, these constructs are unique to Perl: Fuzzy matching refers to matching strings using a non-exact search string. Fuzzy matching will match a string, if all the characters in the search string -are present anywhere in the string in the same order. Case is ignored. In a +are present anywhere in the string in the same order. Case is ignored. In a matched string, other characters can be present between two consecutive -characters in the search string. If the search string has multiple words, then -each word is matched separately. So the words in the search string can be +characters in the search string. If the search string has multiple words, then +each word is matched separately. So the words in the search string can be present in any order in a string. Fuzzy matching assigns a score for each matched string based on the following @@ -1511,8 +1511,8 @@ will match the strings "GetPattern", "PatternGet", "getPattern", "patGetter", "getSomePattern", "MatchpatternGet" etc. The functions |matchfuzzy()| and |matchfuzzypos()| can be used to fuzzy search -a string in a List of strings. The matchfuzzy() function returns a List of -matching strings. The matchfuzzypos() functions returns the List of matches, +a string in a List of strings. The matchfuzzy() function returns a List of +matching strings. The matchfuzzypos() functions returns the List of matches, the matching positions and the fuzzy match scores. The "f" flag of `:vimgrep` enables fuzzy matching. diff --git a/usr/share/vim/vim91/doc/pi_netrw.txt b/usr/share/vim/vim91/doc/pi_netrw.txt index 1271bb689ba..a783fe9ac30 100644 --- a/usr/share/vim/vim91/doc/pi_netrw.txt +++ b/usr/share/vim/vim91/doc/pi_netrw.txt @@ -1,4 +1,4 @@ -*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Jul 13 +*pi_netrw.txt* For Vim version 9.1. Last change: 2024 Nov 12 ------------------------------------------------ NETRW REFERENCE MANUAL by Charles E. Campbell @@ -8,7 +8,7 @@ Author: Charles E. Campbell Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright* The VIM LICENSE applies to the files in this package, including - netrw.vim, pi_netrw.txt, netrwFileHandlers.vim, netrwSettings.vim, and + netrw.vim, pi_netrw.txt, netrwSettings.vim, and syntax/netrw.vim. Like anything else that's free, netrw.vim and its associated files are provided *as is* and comes with no warranty of any kind, either expressed or implied. No guarantees of @@ -54,9 +54,10 @@ Copyright: Copyright (C) 2017 Charles E Campbell *netrw-copyright* 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| + Change Listing Style (thin wide long tree)..........|netrw-i| Changing To A Bookmarked Directory..................|netrw-gb| + Quick hide/unhide of dot-files......................|netrw-gh| + Changing local-only File Permission.................|netrw-gp| Changing To A Predecessor Directory.................|netrw-u| Changing To A Successor Directory...................|netrw-U| Customizing Browsing With A Special Handler.........|netrw-x| @@ -1469,98 +1470,106 @@ With either form of the command, netrw will first ask for confirmation that the removal is in fact what you want to do. If netrw doesn't have permission to remove a file, it will issue an error message. - *netrw-gx* CUSTOMIZING BROWSING WITH A SPECIAL HANDLER *netrw-x* *netrw-handler* {{{2 - (also see |netrw_filehandler|) Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are best seen with a special handler (ie. a tool provided with your computer's -operating system). Netrw allows one to invoke such special handlers by: > +operating system). Netrw allows one to invoke such special handlers by: - * when Exploring, hit the "x" key - * when editing, hit gx with the cursor atop the special filename -< (latter not available if the |g:netrw_nogx| variable exists) + * hitting gx with the cursor atop the file path or alternatively x + in a netrw buffer; the former can be disabled by defining the + |g:netrw_nogx| variable + * when in command line, typing :Open , see |:Open| below. -Netrw determines which special handler by the following method: - - * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to - view files. Examples of useful settings (place into your <.vimrc>): > - - :let g:netrw_browsex_viewer= "kfmclient exec" -< or > - :let g:netrw_browsex_viewer= "xdg-open" -< - 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 - * for Mac OS X : open is used. - * otherwise the netrwFileHandler plugin is used. - -The file's suffix is used by these various approaches to determine an -appropriate application to use to "handle" these files. Such things as -OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps, -*.eps) can be handled. - -The gx mapping extends to all buffers; apply "gx" while atop a word and netrw -will apply a special handler to it (like "x" works when in a netrw buffer). One may also use visual mode (see |visual-start|) to select the text that the -special handler will use. Normally gx uses expand("") to pick up the -text under the cursor; one may change what |expand()| uses via the +special handler will use. Normally gx checks for a close-by URL or file name +to pick up the text under the cursor; one may change what |expand()| uses via the |g:netrw_gx| variable (options include "", ""). Note that expand("") depends on the |'isfname'| setting. Alternatively, one may select the text to be used by gx by making a visual selection (see |visual-block|) and then pressing gx. +The selection function can be adapted for each filetype by adding a function +`Netrw_get_URL_`, where is given by the 'filetype'. +The function should return the URL or file name to be used by gx, and will +fall back to the default behavior if it returns an empty string. +For example, special handlers for links Markdown and HTML are + +" make gx work on concealed links regardless of exact cursor position: > + + function Netrw_get_URL_markdown() + " markdown URL such as [link text](http://ya.ru 'yandex search') + try + let save_view = winsaveview() + if searchpair('\[.\{-}\](', '', ')\zs', 'cbW', '', line('.')) > 0 + return matchstr(getline('.')[col('.')-1:], + \ '\[.\{-}\](\zs' .. g:netrw_regex_url .. '\ze\(\s\+.\{-}\)\?)') + endif + return '' + finally + call winrestview(save_view) + endtry + endfunction + + function Netrw_get_URL_html() + " HTML URL such as Python is here + " + try + let save_view = winsaveview() + if searchpair('\|/>\)\zs', 'cbW', '', line('.')) > 0 + return matchstr(getline('.')[col('.') - 1 : ], + \ 'href=["'.."'"..']\?\zs\S\{-}\ze["'.."'"..']\?/\?>') + endif + return '' + finally + call winrestview(save_view) + endtry + endfunction +< +Other than a file path, the text under the cursor may be a URL. Netrw uses +by default the following regular expression to determine if the text under the +cursor is a URL: +> + :let g:netrw_regex_url = '\%(\%(http\|ftp\|irc\)s\?\|file\)://\S\{-}' +< Associated setting variables: |g:netrw_gx| control how gx picks up the text under the cursor |g:netrw_nogx| prevent gx map while editing |g:netrw_suppress_gx_mesg| controls gx's suppression of browser messages - *netrw_filehandler* +OPENING FILES AND LAUNCHING APPS *netrw-gx* *:Open* *:Launch* {{{2 -When |g:netrw_browsex_viewer| exists and is "-", then netrw will attempt to -handle the special file with a vim function. The "x" map applies a function -to a file, based on its extension. Of course, the handler function must exist -for it to be called! -> - Ex. mypgm.html x -> NFH_html("scp://user@host/some/path/mypgm.html") +Netrw determines which special handler by the following method: -< Users may write their own netrw File Handler functions to - support more suffixes with special handling. See - for examples on how to make - file handler functions. As an example: > + * if |g:netrw_browsex_viewer| exists, then it will be used to attempt to + view files. + If the viewer you wish to use does not support handling of a remote URL + directory, set |g:netrw_browsex_support_remote| to 0. + * otherwise: - " NFH_suffix(filename) - fun! NFH_suffix(filename) - ..do something special with filename.. - endfun -< -These functions need to be defined in some file in your .vim/plugin -(vimfiles\plugin) directory. Vim's function names may not have punctuation -characters (except for the underscore) in them. To support suffices that -contain such characters, netrw will first convert the suffix using the -following table: > - - @ -> AT ! -> EXCLAMATION % -> PERCENT - : -> COLON = -> EQUAL ? -> QUESTION - , -> COMMA - -> MINUS ; -> SEMICOLON - $ -> DOLLAR + -> PLUS ~ -> TILDE -< -So, for example: > + * for Windows : explorer.exe is used + * for Mac OS X : open is used. + * for Linux : xdg-open is used. + +To open a path (or URL) by the appropriate handler, type > - file.rcs,v -> NFH_rcsCOMMAv() + :Open < -If more such translations are necessary, please send me email: > - NcampObell@SdrPchip.AorgM-NOSPAM -with a request. (remove the embedded NOSPAM first) +No escaping, neither for the shell nor for Vim's command-line, is needed. -Associated setting variable: |g:netrw_browsex_viewer| +To launch a specific application , often being > + :Launch . + +Since can be arbitrarily complex, in particular contain many file +paths, the escaping is left to the user. + +If you disabled the netrw plugin by setting g:loaded_netrwPlugin (see +|netrw-noload|), then you can use > + + :call netrw#Launch(' ') + :call netrw#Open('') +< *netrw-curdir* DELETING BOOKMARKS *netrw-mB* {{{2 @@ -2583,12 +2592,7 @@ your browsing preferences. (see also: |netrw-settings|) *g:netrw_browsex_viewer* specify user's preference for a viewer: > "kfmclient exec" "gnome-open" -< If > - "-" -< is used, then netrwFileHandler() will look for - 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|). diff --git a/usr/share/vim/vim91/doc/pi_paren.txt b/usr/share/vim/vim91/doc/pi_paren.txt index 719353fa942..049889699d7 100644 --- a/usr/share/vim/vim91/doc/pi_paren.txt +++ b/usr/share/vim/vim91/doc/pi_paren.txt @@ -1,4 +1,4 @@ -*pi_paren.txt* For Vim version 9.1. Last change: 2013 May 08 +*pi_paren.txt* For Vim version 9.1. Last change: 2024 Nov 04 VIM REFERENCE MANUAL by Bram Moolenaar @@ -10,6 +10,7 @@ The functionality mentioned here is a |standard-plugin|. This plugin is only available if 'compatible' is not set. You can avoid loading this plugin by setting the "loaded_matchparen" variable: > + :let loaded_matchparen = 1 The plugin installs CursorMoved, CursorMovedI and WinEnter autocommands to @@ -29,6 +30,16 @@ the ":highlight" command. Example: > :hi MatchParen ctermbg=blue guibg=lightblue +By default the plugin will highlight both the paren under the cursor and the +matching one using the |hl-MatchParen| highlighting group. This may result in +the cursor briefly disappearing from the screen as the MatchParen colors take +over the cursor highlight. To prevent this from happening and have the plugin +only highlight the matching paren and not the one under the cursor +(effectively leaving the cursor style unchanged), you can set the +"matchparen_disable_cursor_hl" variable: > + + :let matchparen_disable_cursor_hl = 1 + The characters to be matched come from the 'matchpairs' option. You can change the value to highlight different matches. Note that not everything is possible. For example, you can't highlight single or double quotes, because @@ -46,10 +57,10 @@ are: closed folds. - 'synmaxcol' times 2 bytes before or after the cursor to avoid a delay in a long line with syntax highlighting. -- A timeout of 300 msec (60 msec in Insert mode). This can be changed with the - g:matchparen_timeout and g:matchparen_insert_timeout variables and their - buffer-local equivalents b:matchparen_timeout and - b:matchparen_insert_timeout. +- A timeout of 300 msec (60 msec in Insert mode). This can be changed with + the "g:matchparen_timeout" and "g:matchparen_insert_timeout" variables and + their buffer-local equivalents "b:matchparen_timeout" and + "b:matchparen_insert_timeout". If you would like the |%| command to work better, the matchit plugin can be used, see |matchit-install|. This plugin also helps to skip matches in diff --git a/usr/share/vim/vim91/doc/pi_tutor.txt b/usr/share/vim/vim91/doc/pi_tutor.txt new file mode 100644 index 00000000000..618fe745ac4 --- /dev/null +++ b/usr/share/vim/vim91/doc/pi_tutor.txt @@ -0,0 +1,52 @@ +*pi_tutor.txt* For Vim version 9.1. Last change: 2024 Nov 09 + +INTERACTIVE TUTORIALS FOR VIM *vim-tutor-mode* + +vim-tutor-mode provides a system to follow and create interactive tutorials +for vim and third party plugins. It replaces the venerable `vimtutor` system. + +============================================================================= +1. Usage *vim-tutor-usage* + +vim-tutor-mode tutorials are hypertext documents, they have rich text and +contain links. To stand out from the rest of the text, links are underlined. +You can follow them by placing the cursor over them and pressing , or +by double-clicking them. + +1.1 Commands +------------ + *:Tutor* +:Tutor {tutorial} Opens a tutorial. Command-line completion for + {tutorial} is provided, the candidates are a list of + '.tutor' files found in the 'tutor/' folder in + the 'runtimepath'. Tutorials prefixed with 'vim-' + will always be shown first. + + If no {tutorial} is provided, the command starts the + 'vim-01-beginner' tutorial, which is equivalent to + Vim's `vimtutor`. + +============================================================================= +2. Creating tutorials *vim-tutor-create* + +Writing vim-tutor-mode tutorials is easy. For an overview of the format used, +please consult the 'tutor.tutor' file: > + + :Tutor tutor +< +New tutorials must be placed in the 'tutor/' folder in the 'runtimepath' +to be detected by the :Tutor command. + +It is recommended to use a less formal style when writing tutorials than in +regular documentation (unless the content requires it). + +============================================================================= +3. Contributing + +Development of the plugin is done over at github [1]. Feel free to report +issues and make suggestions. + +[1]: https://github.com/fmoralesc/vim-tutor-mode + +============================================================================= + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/usr/share/vim/vim91/doc/quickfix.txt b/usr/share/vim/vim91/doc/quickfix.txt index e7536446b27..671630d6678 100644 --- a/usr/share/vim/vim91/doc/quickfix.txt +++ b/usr/share/vim/vim91/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*quickfix.txt* For Vim version 9.1. Last change: 2024 Nov 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -361,7 +361,7 @@ processing a quickfix or location list command, it will be aborted. Example: > :g/mypattern/caddexpr expand("%") .. ":" .. line(".") .. ":" .. getline(".") < - *:lad* *:addd* *:laddexpr* + *:lad* *:ladd* *:laddexpr* :lad[dexpr] {expr} Same as ":caddexpr", except the location list for the current window is used instead of the quickfix list. @@ -1405,6 +1405,32 @@ being checked. To disable this set g:perl_compiler_force_warnings to a zero value. For example: > let g:perl_compiler_force_warnings = 0 +MYPY TYPE CHECKER *compiler-mypy* + +Commonly used compiler options can be added to 'makeprg' by setting the +b/g:mypy_makeprg_params variable. For example: > + + let b:mypy_makeprg_params = "--warn-unused-ignores" + +The global default is "--strict --ignore-missing-imports". + +RUFF LINTER *compiler-ruff* + +Commonly used compiler options can be added to 'makeprg' by setting the +b/g:ruff_makeprg_params variable. For example: > + + let b:ruff_makeprg_params = "--max-line-length "..&textwidth + +The global default is "--preview". + +PYLINT LINTER *compiler-pylint* + +Commonly used compiler options can be added to 'makeprg' by setting the +b/g:pylint_makeprg_params variable. For example: > + + let b:pylint_makeprg_params = "--max-line-length "..&textwidth + +The global default is "--jobs=0" to use (almost) all cores. PYUNIT COMPILER *compiler-pyunit* diff --git a/usr/share/vim/vim91/doc/quickref.txt b/usr/share/vim/vim91/doc/quickref.txt index 42b5228a8f8..a43d28f1e3a 100644 --- a/usr/share/vim/vim91/doc/quickref.txt +++ b/usr/share/vim/vim91/doc/quickref.txt @@ -1,4 +1,4 @@ -*quickref.txt* For Vim version 9.1. Last change: 2024 Mar 03 +*quickref.txt* For Vim version 9.1. Last change: 2024 Nov 02 VIM REFERENCE MANUAL by Bram Moolenaar @@ -707,6 +707,7 @@ Short explanation of each option: *option-list* 'fileignorecase' 'fic' ignore case when using file names 'filetype' 'ft' type of file, used for autocommands 'fillchars' 'fcs' characters to use for displaying special items +'findfunc' 'ffu' function to be called for the |:find| command 'fixendofline' 'fixeol' make sure last line in file has 'fkmap' 'fk' obsolete option for Farsi 'foldclose' 'fcl' close a fold when the cursor leaves it diff --git a/usr/share/vim/vim91/doc/repeat.txt b/usr/share/vim/vim91/doc/repeat.txt index 73d6458d552..d85e580f51c 100644 --- a/usr/share/vim/vim91/doc/repeat.txt +++ b/usr/share/vim/vim91/doc/repeat.txt @@ -1,4 +1,4 @@ -*repeat.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*repeat.txt* For Vim version 9.1. Last change: 2024 Oct 16 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1398,9 +1398,9 @@ For example, to profile the one_script.vim script file: > clear the profiling statistics and start profiling again. :prof[ile] pause - Don't profile until the following `:profile continue`. Can be - used when doing something that should not be counted (e.g., an - external command). Does not nest. + Stop profiling until the next `:profile continue` command. + Can be used when doing something that should not be counted + (e.g., an external command). Does not nest. :prof[ile] continue Continue profiling after `:profile pause`. diff --git a/usr/share/vim/vim91/doc/syntax.txt b/usr/share/vim/vim91/doc/syntax.txt index 1c66042cc3b..b0c77db1d4f 100644 --- a/usr/share/vim/vim91/doc/syntax.txt +++ b/usr/share/vim/vim91/doc/syntax.txt @@ -1,4 +1,4 @@ -*syntax.txt* For Vim version 9.1. Last change: 2024 Oct 13 +*syntax.txt* For Vim version 9.1. Last change: 2024 Nov 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1679,20 +1679,20 @@ on" command in your .vimrc file. When you edit an existing Fortran file, the syntax script will assume free source form if the fortran_free_source variable has been set, and assumes fixed source form if the fortran_fixed_source variable has been set. Suppose -neither of these variables have been set. In that case, the syntax script attempts to -determine which source form has been used by examining the file extension -using conventions common to the ifort, gfortran, Cray, NAG, and PathScale -compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 for -free-source). No default is used for the .fpp and .ftn file extensions because -different compilers treat them differently. If none of this works, then the -script examines the first five columns of the first 500 lines of your file. If -no signs of free source form are detected, then the file is assumed to be in -fixed source form. The algorithm should work in the vast majority of cases. -In some cases, such as a file that begins with 500 or more full-line comments, -the script may incorrectly decide that the code is in fixed form. If that -happens, just add a non-comment statement beginning anywhere in the first five -columns of the first twenty-five lines, save (:w), and then reload (:e!) the -file. +neither of these variables have been set. In that case, the syntax script +attempts to determine which source form has been used by examining the file +extension using conventions common to the ifort, gfortran, Cray, NAG, and +PathScale compilers (.f, .for, .f77 for fixed-source, .f90, .f95, .f03, .f08 +for free-source). No default is used for the .fpp and .ftn file extensions +because different compilers treat them differently. If none of this works, +then the script examines the first five columns of the first 500 lines of your +file. If no signs of free source form are detected, then the file is assumed +to be in fixed source form. The algorithm should work in the vast majority of +cases. In some cases, such as a file that begins with 500 or more full-line +comments, the script may incorrectly decide that the code is in fixed form. +If that happens, just add a non-comment statement beginning anywhere in the +first five columns of the first twenty-five lines, save (:w), and then reload +(:e!) the file. Vendor extensions ~ Fixed-form Fortran requires a maximum line length of 72 characters but the @@ -2226,9 +2226,9 @@ define the vim variable 'lace_case_insensitive' in your startup file: > LF (LFRC) *lf.vim* *ft-lf-syntax* *g:lf_shell_syntax* *b:lf_shell_syntax* -For the lf file manager configuration files (lfrc) the shell commands -syntax highlighting can be changed globally and per buffer by setting -a different 'include' command search pattern using these variables: +For the lf file manager configuration files (lfrc) the shell commands syntax +highlighting can be changed globally and per buffer by setting a different +'include' command search pattern using these variables: > let g:lf_shell_syntax = "syntax/dosbatch.vim" let b:lf_shell_syntax = "syntax/zsh.vim" @@ -2538,9 +2538,10 @@ set "msql_minlines" to the value you desire. Example: > :let msql_minlines = 200 -NEOMUTT *neomutt.vim* *ft-neomuttrc-syntax* *ft-neomuttlog-syntax* +NEOMUTT *neomutt.vim* *ft-neomuttrc-syntax* + *ft-neomuttlog-syntax* -To disable the default NeoMutt log colors > +To disable the default NeoMutt log colors: > :let g:neolog_disable_default_colors = 1 @@ -2669,7 +2670,7 @@ To specify elements that should not be concealed, set the following variable: > :let g:pandoc#syntax#conceal#blacklist = [] -This is a list of the rules wich can be used here: +This is a list of the rules which can be used here: - titleblock - image @@ -2710,9 +2711,9 @@ specified. Default = 1 > :let g:pandoc#syntax#codeblocks#embeds#use = 1 -For specify what languages and using what syntax files to highlight embeds. This is a -list of language names. When the language pandoc and vim use don't match, you -can use the "PANDOC=VIM" syntax. For example: > +For specify what languages and using what syntax files to highlight embeds. +This is a list of language names. When the language pandoc and vim use don't +match, you can use the "PANDOC=VIM" syntax. For example: > :let g:pandoc#syntax#codeblocks#embeds#langs = ["ruby", "bash=sh"] @@ -3922,7 +3923,7 @@ set "tf_minlines" to the value you desire. Example: > :let tf_minlines = your choice < TYPESCRIPT *typescript.vim* *ft-typescript-syntax* - *typescriptreact.vim* *ft-typescriptreact-syntax* + *typescriptreact.vim* *ft-typescriptreact-syntax* There is one option to control the TypeScript syntax highlighting. @@ -5309,12 +5310,15 @@ of colors by using the `:colorscheme` command, for example: > This is basically the same as > :echo g:colors_name < In case g:colors_name has not been defined :colo will - output "default". When compiled without the |+eval| - feature it will output "unknown". + output "default". Its palette is defined in the file + "$VIMRUNTIME/syntax/syncolor.vim" and is based on + legacy versions of peachpuff and desert. When compiled + without the |+eval| feature it will output "unknown". :colo[rscheme] {name} Load color scheme {name}. This searches 'runtimepath' for the file "colors/{name}.vim". The first one that is found is loaded. + Use `:colo default` to load the default colorscheme. Also searches all plugins in 'packpath', first below "start" and then under "opt". @@ -5718,8 +5722,8 @@ guisp={color-name} *highlight-guisp* :highlight Comment guifg=#11f0c3 guibg=#ff00ff < If you are authoring a color scheme and use the same hexadecimal value - repeatedly, you can define a (lower case) name for it in |v:colornames|. - For example: > + repeatedly, you can define a (lower case) name for it in + |v:colornames|. For example: > # provide a default value for this color but allow the user to # override it. @@ -6139,7 +6143,8 @@ This will set the "w:current_syntax" variable to "foo". The value of restoring "b:current_syntax", since the syntax files do set "b:current_syntax". The value set by the syntax file is assigned to "w:current_syntax". -Note: This resets the 'spell', 'spellcapcheck' and 'spellfile' options. +Note: This resets the 'spell', 'spellcapcheck', 'spellfile' and 'spelloptions' +options. Once a window has its own syntax, syntax commands executed from other windows on the same buffer (including :syntax clear) have no effect. Conversely, diff --git a/usr/share/vim/vim91/doc/tags b/usr/share/vim/vim91/doc/tags index c3089bb6e6d..d61bdc7e208 100644 --- a/usr/share/vim/vim91/doc/tags +++ b/usr/share/vim/vim91/doc/tags @@ -269,6 +269,7 @@ $quote eval.txt /*$quote* 'fex' options.txt /*'fex'* 'ff' options.txt /*'ff'* 'ffs' options.txt /*'ffs'* +'ffu' options.txt /*'ffu'* 'fic' options.txt /*'fic'* 'fileencoding' options.txt /*'fileencoding'* 'fileencodings' options.txt /*'fileencodings'* @@ -277,6 +278,7 @@ $quote eval.txt /*$quote* 'fileignorecase' options.txt /*'fileignorecase'* 'filetype' options.txt /*'filetype'* 'fillchars' options.txt /*'fillchars'* +'findfunc' options.txt /*'findfunc'* 'fixendofline' options.txt /*'fixendofline'* 'fixeol' options.txt /*'fixeol'* 'fk' options.txt /*'fk'* @@ -499,6 +501,7 @@ $quote eval.txt /*$quote* 'mesg' vi_diff.txt /*'mesg'* 'mfd' options.txt /*'mfd'* 'mh' options.txt /*'mh'* +'mhi' options.txt /*'mhi'* 'mis' options.txt /*'mis'* 'mkspellmem' options.txt /*'mkspellmem'* 'ml' options.txt /*'ml'* @@ -529,6 +532,7 @@ $quote eval.txt /*$quote* 'mousetime' options.txt /*'mousetime'* 'mp' options.txt /*'mp'* 'mps' options.txt /*'mps'* +'msghistory' options.txt /*'msghistory'* 'msm' options.txt /*'msm'* 'mzq' options.txt /*'mzq'* 'mzquantum' options.txt /*'mzquantum'* @@ -2127,6 +2131,7 @@ $quote eval.txt /*$quote* :LP pi_logipat.txt /*:LP* :LPE pi_logipat.txt /*:LPE* :LPF pi_logipat.txt /*:LPF* +:Launch pi_netrw.txt /*:Launch* :Lexplore pi_netrw.txt /*:Lexplore* :Lfilter quickfix.txt /*:Lfilter* :LogiPat pi_logipat.txt /*:LogiPat* @@ -2144,6 +2149,7 @@ $quote eval.txt /*$quote* :Ntree pi_netrw.txt /*:Ntree* :Nw pi_netrw.txt /*:Nw* :Nwrite pi_netrw.txt /*:Nwrite* +:Open pi_netrw.txt /*:Open* :Over terminal.txt /*:Over* :P various.txt /*:P* :Pexplore pi_netrw.txt /*:Pexplore* @@ -2173,6 +2179,7 @@ $quote eval.txt /*$quote* :Termdebug terminal.txt /*:Termdebug* :TermdebugCommand terminal.txt /*:TermdebugCommand* :Texplore pi_netrw.txt /*:Texplore* +:Tutor pi_tutor.txt /*:Tutor* :Until terminal.txt /*:Until* :Up terminal.txt /*:Up* :UseVimball pi_vimball.txt /*:UseVimball* @@ -2211,7 +2218,6 @@ $quote eval.txt /*$quote* :abo windows.txt /*:abo* :aboveleft windows.txt /*:aboveleft* :abstract vim9class.txt /*:abstract* -:addd quickfix.txt /*:addd* :al windows.txt /*:al* :all windows.txt /*:all* :am gui.txt /*:am* @@ -2731,6 +2737,7 @@ $quote eval.txt /*$quote* :lab quickfix.txt /*:lab* :labove quickfix.txt /*:labove* :lad quickfix.txt /*:lad* +:ladd quickfix.txt /*:ladd* :laddb quickfix.txt /*:laddb* :laddbuffer quickfix.txt /*:laddbuffer* :laddexpr quickfix.txt /*:laddexpr* @@ -4572,6 +4579,7 @@ E1510 change.txt /*E1510* E1511 options.txt /*E1511* E1512 options.txt /*E1512* E1513 message.txt /*E1513* +E1514 options.txt /*E1514* E152 helphelp.txt /*E152* E153 helphelp.txt /*E153* E154 helphelp.txt /*E154* @@ -5812,6 +5820,7 @@ W19 autocmd.txt /*W19* W20 if_pyth.txt /*W20* W21 if_pyth.txt /*W21* W22 userfunc.txt /*W22* +W23 gui_x11.txt /*W23* WORD motion.txt /*WORD* WSL os_win32.txt /*WSL* WWW intro.txt /*WWW* @@ -6554,9 +6563,12 @@ compiler-hpada ft_ada.txt /*compiler-hpada* compiler-javac quickfix.txt /*compiler-javac* compiler-make quickfix.txt /*compiler-make* compiler-manx quickfix.txt /*compiler-manx* +compiler-mypy quickfix.txt /*compiler-mypy* compiler-pandoc quickfix.txt /*compiler-pandoc* compiler-perl quickfix.txt /*compiler-perl* +compiler-pylint quickfix.txt /*compiler-pylint* compiler-pyunit quickfix.txt /*compiler-pyunit* +compiler-ruff quickfix.txt /*compiler-ruff* compiler-select quickfix.txt /*compiler-select* compiler-tex quickfix.txt /*compiler-tex* compiler-typst quickfix.txt /*compiler-typst* @@ -7114,6 +7126,7 @@ file-read insert.txt /*file-read* file-searching editing.txt /*file-searching* file-type filetype.txt /*file-type* file-types filetype.txt /*file-types* +file-watcher editing.txt /*file-watcher* file_readable() builtin.txt /*file_readable()* filecopy() builtin.txt /*filecopy()* fileencoding-changed version6.txt /*fileencoding-changed* @@ -7322,6 +7335,8 @@ ft-html-omni insert.txt /*ft-html-omni* ft-html-syntax syntax.txt /*ft-html-syntax* ft-htmlos-syntax syntax.txt /*ft-htmlos-syntax* ft-ia64-syntax syntax.txt /*ft-ia64-syntax* +ft-idris2-indent indent.txt /*ft-idris2-indent* +ft-idris2-plugin filetype.txt /*ft-idris2-plugin* ft-inform-syntax syntax.txt /*ft-inform-syntax* ft-java-plugin filetype.txt /*ft-java-plugin* ft-java-syntax syntax.txt /*ft-java-syntax* @@ -7369,6 +7384,7 @@ ft-neomuttlog-syntax syntax.txt /*ft-neomuttlog-syntax* ft-neomuttrc-syntax syntax.txt /*ft-neomuttrc-syntax* ft-nroff-syntax syntax.txt /*ft-nroff-syntax* ft-ocaml-syntax syntax.txt /*ft-ocaml-syntax* +ft-org-plugin filetype.txt /*ft-org-plugin* ft-pandoc-syntax syntax.txt /*ft-pandoc-syntax* ft-papp-syntax syntax.txt /*ft-papp-syntax* ft-pascal-syntax syntax.txt /*ft-pascal-syntax* @@ -7746,6 +7762,8 @@ g:typescript_host_keyword syntax.txt /*g:typescript_host_keyword* g:typst_cmd quickfix.txt /*g:typst_cmd* g:typst_conceal filetype.txt /*g:typst_conceal* g:typst_embedded_languages syntax.txt /*g:typst_embedded_languages* +g:typst_folding filetype.txt /*g:typst_folding* +g:typst_foldnested filetype.txt /*g:typst_foldnested* g:var eval.txt /*g:var* g:vim_indent indent.txt /*g:vim_indent* g:vim_indent_cont indent.txt /*g:vim_indent_cont* @@ -7825,6 +7843,7 @@ getbufinfo() builtin.txt /*getbufinfo()* getbufline() builtin.txt /*getbufline()* getbufoneline() builtin.txt /*getbufoneline()* getbufvar() builtin.txt /*getbufvar()* +getcellpixels() builtin.txt /*getcellpixels()* getcellwidths() builtin.txt /*getcellwidths()* getchangelist() builtin.txt /*getchangelist()* getchar() builtin.txt /*getchar()* @@ -8053,11 +8072,13 @@ hasmapto() builtin.txt /*hasmapto()* hebrew hebrew.txt /*hebrew* hebrew.txt hebrew.txt /*hebrew.txt* help helphelp.txt /*help* +help-TOC helphelp.txt /*help-TOC* help-buffer-options helphelp.txt /*help-buffer-options* help-context help.txt /*help-context* help-curwin tips.txt /*help-curwin* help-summary usr_02.txt /*help-summary* help-tags tags 1 +help-toc-install helphelp.txt /*help-toc-install* help-translated helphelp.txt /*help-translated* help-writing helphelp.txt /*help-writing* help-xterm-window helphelp.txt /*help-xterm-window* @@ -9121,7 +9142,6 @@ netrw-write pi_netrw.txt /*netrw-write* netrw-x pi_netrw.txt /*netrw-x* netrw-xfer pi_netrw.txt /*netrw-xfer* netrw.vim pi_netrw.txt /*netrw.vim* -netrw_filehandler pi_netrw.txt /*netrw_filehandler* netterm-mouse options.txt /*netterm-mouse* network pi_netrw.txt /*network* new() vim9class.txt /*new()* @@ -9269,6 +9289,7 @@ o_CTRL-V motion.txt /*o_CTRL-V* o_V motion.txt /*o_V* o_object-select motion.txt /*o_object-select* o_v motion.txt /*o_v* +obj-var-type-any vim9class.txt /*obj-var-type-any* object vim9class.txt /*object* object-const-variable vim9class.txt /*object-const-variable* object-empty() vim9class.txt /*object-empty()* @@ -9318,6 +9339,7 @@ options.txt options.txt /*options.txt* optwin options.txt /*optwin* or() builtin.txt /*or()* oracle ft_sql.txt /*oracle* +os-support vi_diff.txt /*os-support* os2 os_os2.txt /*os2* os390 os_390.txt /*os390* os_390.txt os_390.txt /*os_390.txt* @@ -9429,6 +9451,7 @@ pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* pi_paren.txt pi_paren.txt /*pi_paren.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt* pi_tar.txt pi_tar.txt /*pi_tar.txt* +pi_tutor.txt pi_tutor.txt /*pi_tutor.txt* pi_vimball.txt pi_vimball.txt /*pi_vimball.txt* pi_zip.txt pi_zip.txt /*pi_zip.txt* pkzip options.txt /*pkzip* @@ -10228,12 +10251,18 @@ strstr() builtin.txt /*strstr()* strtrans() builtin.txt /*strtrans()* strutf16len() builtin.txt /*strutf16len()* strwidth() builtin.txt /*strwidth()* +style-braces develop.txt /*style-braces* style-changes develop.txt /*style-changes* +style-comments develop.txt /*style-comments* +style-common-functions develop.txt /*style-common-functions* style-compiler develop.txt /*style-compiler* +style-declarations develop.txt /*style-declarations* style-examples develop.txt /*style-examples* style-functions develop.txt /*style-functions* +style-indentation develop.txt /*style-indentation* style-names develop.txt /*style-names* style-spaces develop.txt /*style-spaces* +style-types develop.txt /*style-types* style-various develop.txt /*style-various* sub-menu-priority gui.txt /*sub-menu-priority* sub-replace-\= change.txt /*sub-replace-\\=* @@ -10659,6 +10688,7 @@ termdebug-stepping terminal.txt /*termdebug-stepping* termdebug-timeout terminal.txt /*termdebug-timeout* termdebug-variables terminal.txt /*termdebug-variables* termdebug_disasm_window terminal.txt /*termdebug_disasm_window* +termdebug_evaluate_in_popup terminal.txt /*termdebug_evaluate_in_popup* termdebug_map_K terminal.txt /*termdebug_map_K* termdebug_map_minus terminal.txt /*termdebug_map_minus* termdebug_map_plus terminal.txt /*termdebug_map_plus* @@ -11228,6 +11258,9 @@ vim-script-intro usr_41.txt /*vim-script-intro* vim-script-library eval.txt /*vim-script-library* vim-security intro.txt /*vim-security* vim-shebang various.txt /*vim-shebang* +vim-tutor-create pi_tutor.txt /*vim-tutor-create* +vim-tutor-mode pi_tutor.txt /*vim-tutor-mode* +vim-tutor-usage pi_tutor.txt /*vim-tutor-usage* vim-use intro.txt /*vim-use* vim-variable eval.txt /*vim-variable* vim.b if_lua.txt /*vim.b* diff --git a/usr/share/vim/vim91/doc/terminal.txt b/usr/share/vim/vim91/doc/terminal.txt index 5020ed5b458..637277ab592 100644 --- a/usr/share/vim/vim91/doc/terminal.txt +++ b/usr/share/vim/vim91/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 9.1. Last change: 2024 Jul 28 +*terminal.txt* For Vim version 9.1. Last change: 2024 Nov 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1537,6 +1537,7 @@ If there is no g:termdebug_config you can use: > < However, the latter form will be deprecated in future releases. + Mappings ~ The termdebug plugin enables a few default mappings. All those mappings are reset to their original values once the termdebug session concludes. @@ -1591,6 +1592,7 @@ If the current window has enough horizontal space, it will be vertically split and the Var window will be shown side by side with the source code window (and the height options won't be used). + Communication ~ *termdebug-communication* There is another, hidden, buffer, which is used for Vim to communicate with @@ -1675,18 +1677,23 @@ If there is no g:termdebug_config you can use: > However, the latter form will be deprecated in future releases. + Change default signs ~ *termdebug_signs* Termdebug uses the hex number of the breakpoint ID in the signcolumn to -represent breakpoints. if it is greater than "0xFF", then it will be displayed +represent breakpoints. If it is greater than "0xFF", then it will be displayed as "F+", due to we really only have two screen cells for the sign. +You may also use decimal breakpoint signs instead, in which case IDs greater +than 99 will be displayed as "9+". -If you want to customize the breakpoint signs: > +If you want to customize the breakpoint signs to show `>>` in the signcolumn: > let g:termdebug_config['sign'] = '>>' -If there is no g:terminal_config yet you can use: > +If you would like to use decimal (base 10) breakpoint signs: > + let g:termdebug_config['sign_decimal'] = 1 +If the variable g:termdebug_config does not yet exist, you can use: > let g:termdebug_config = {'sign': '>>'} - -After this, breakpoints will be displayed as `>>` in the signcolumn. +Likewise, to enable decimal signs: > + let g:termdebug_config = {'sign_decimal': 1} Window toolbar ~ @@ -1716,4 +1723,18 @@ Set the wide value to 1 to use a vertical split without ever changing 'columns'. This is useful when the terminal can't be resized by Vim. +Evaluate in Popup Window at Cursor ~ + *termdebug_evaluate_in_popup* +By default |:Evaluate| will simply echo its output. For larger entities this +might become difficult to read or even truncated. +Alternatively, the evaluation result may be output into a popup window at the +current cursor position: > + let g:termdebug_config['evaluate_in_popup'] = v:true +This can also be used in a "one-shot" manner: > + func OnCursorHold() + let g:termdebug_config['evaluate_in_popup'] = v:true + :Evaluate + let g:termdebug_config['evaluate_in_popup'] = v:false + endfunc +< vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/usr/share/vim/vim91/doc/todo.txt b/usr/share/vim/vim91/doc/todo.txt index 530b05dd3fa..2f186548282 100644 --- a/usr/share/vim/vim91/doc/todo.txt +++ b/usr/share/vim/vim91/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 9.1. Last change: 2024 Sep 29 +*todo.txt* For Vim version 9.1. Last change: 2024 Oct 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -55,32 +55,17 @@ When a help item can't be found, then open 'helpfile'. Search for the tag in that file and gtive E149 only when not found. Helps for a tiny Vim installed without all the help files. -SpellCap highlight not updated - PR #12428 - Virtual text problems: -- If 'list' is on, 'below' virtual text which includes 1 or 2 characters are - gone (Issue #12028) - Virtual text aligned "above": Wrong indentation when using tabs (Issue #12232) -- Virtual text to the right of the line that isn't visible doesn't cause the - 'extends' character to show in 'list' mode. #12478 -- Virtual text to the right of the line that fits exactly on screen causes - that line and all lines below it not to be displayed (Issue #12213) -- Window screen gets wrong when a virtual text is placed on 'above' or - 'below' on an empty line (Issue #11959) - truncated Virtual text below an empty line causes display error #12493 When 'virtualedit' is "all" and 'cursorcolumn' is set, the wrong column may be highlighted. (van-de-bugger, 2018 Jan 23, #2576) -Improve profiling by caching matching functions: PR #12192 - With 'smoothscroll' set and "lastline" in 'display', moving the cursor to a wrapping line that makes the display scroll up may scroll much more than needed, thus jump-scrolling. (part of issue 12411) - -Implement foreach() PR #12166 - Errors when running tests with valgrind: - test_codestyle.vim: e.g.: command line..script /home/mool/vim/vim91/src/testdir/runtest.vim[569]..function RunTheTest[52]..Test_test_files line 6: keycode_check.vim: space before tab: Expected 0 but got 7 @@ -117,7 +102,6 @@ Upcoming larger works: Further Vim9 improvements: - Classes and Interfaces. See |vim9-classes| - - Cannot use class type of itself in the method (Issue #12369) - Getting member of variable with "any" type should be handled at runtime. Remove temporary solution from #12096 / patch 9.0.1375. - "obj.Method()" does not always work in a compiled function, assumes "obj" @@ -127,9 +111,6 @@ Further Vim9 improvements: Possibly issue #11981 can be fixed at the same time (has two examples). - Forward declaration of a class? E.g. for Clone() function. Email lifepillar 2023 Mar 26 - - When "Meta" is a class, is "const MetaAlias = Meta" allowed? It should - either work or given an error. Possibly give an error now and implement it - later (using a typedef). #12006 - how about lock/unlock? - For chaining, allow using the class name as type for function return value. @@ -147,7 +128,7 @@ Further Vim9 improvements: has(featureName), len(someString) - Implement as part of an expression: ++expr, --expr, expr++, expr--. - The use of the literal value "null" and the type specific "null_xxx" - values is confusing (#13458, #11770). + values is confusing (#13433, #11770). Information missing in terminfo: - Codes used for focus gained and lost termcodes are hard-coded in @@ -225,8 +206,6 @@ Popup windows: positioned? PopupNew? Could be used to set some options or move it out of the way. (#5737) However, it may also cause trouble, changing the popup of another plugin. -- Width is not computed correctly when minwidth and maxwidth are &columns - and padding and a scrollbar are used. (#6676) - Should popup_getoptions() also return the mask? #7774 - Add a way to use popup_menu() synchronously: instead of invoking the callback, return the choice. (Ben Jackson, #6534) @@ -296,8 +275,6 @@ Terminal emulator window: - Use CTRL-W CTRL-K to enter a digraph? #5371 - When Vim runs in the terminal and changes the title, the statusline needs to be redrawn. -- GUI: When using ":set go+=!" a system() call causes the hit-enter prompt. - (#3327) - Allow for specifying the directory, with ++cwd={dir}. - When pasting should call vterm_keyboard_start_paste(), e.g. when using K_MIDDLEMOUSE, calling insert_reg(). @@ -323,9 +300,6 @@ Cursor is after the end of the line: #12137. Crash when a variable is removed while listing variables (Issue #11435) -Autoconf: must use autoconf 2.69, later version generates lots of warnings -- try using autoconf 2.71 and fix all "obsolete" warnings #11322 - Problem with Visual highlight when 'linebreak' and 'showbreak' are set. #11272 @@ -343,8 +317,6 @@ Support dark mode for MS-Windows: #12282 Remote command escapes single quote with backslash, should be doubling the single quote in vim_strsave_escaped_ext() #12202. -PR to add custom and customlist completion types. #12228 - Can deref_func_name() and deref_function_name() be merged? Using :global with a pattern containing \zs doesn't use the line where \zs diff --git a/usr/share/vim/vim91/doc/undo.txt b/usr/share/vim/vim91/doc/undo.txt index 7a83e776e38..1d6a481c6e4 100644 --- a/usr/share/vim/vim91/doc/undo.txt +++ b/usr/share/vim/vim91/doc/undo.txt @@ -1,4 +1,4 @@ -*undo.txt* For Vim version 9.1. Last change: 2024 Sep 29 +*undo.txt* For Vim version 9.1. Last change: 2024 Nov 09 VIM REFERENCE MANUAL by Bram Moolenaar @@ -183,7 +183,7 @@ g- Go to older text state. With a count repeat that many g+ Go to newer text state. With a count repeat that many times. *:lat* *:later* -:lat[er] {count} Go to newer text state {count} times. +:lat[er] {count} Go to newer text state {count} times. :lat[er] {N}s Go to newer text state about {N} seconds later. :lat[er] {N}m Go to newer text state about {N} minutes later. :lat[er] {N}h Go to newer text state about {N} hours later. diff --git a/usr/share/vim/vim91/doc/usr_01.txt b/usr/share/vim/vim91/doc/usr_01.txt index fdf1b5386ba..604e26bfec4 100644 --- a/usr/share/vim/vim91/doc/usr_01.txt +++ b/usr/share/vim/vim91/doc/usr_01.txt @@ -1,4 +1,4 @@ -*usr_01.txt* For Vim version 9.1. Last change: 2024 May 11 +*usr_01.txt* For Vim version 9.1. Last change: 2024 Nov 03 VIM USER MANUAL - by Bram Moolenaar @@ -107,6 +107,8 @@ For more info see |vimrc| and |compatible-default|. ============================================================================== *01.3* Using the Vim tutor *tutor* *vimtutor* +For the interactive tutor, see |vim-tutor-mode| + Instead of reading the text (boring!) you can use the vimtutor to learn your first Vim commands. This is a 30-minute tutorial that teaches the most basic Vim functionality hands-on. @@ -118,8 +120,11 @@ On Unix, if Vim has been properly installed, you can start it from the shell: On MS-Windows you can find it in the Program/Vim menu. Or execute vimtutor.bat in the $VIMRUNTIME directory. -This will make a copy of the tutor file, so that you can edit it without -the risk of damaging the original. +This will make a copy of chapter 1 tutor file, so that you can edit it without +the risk of damaging the original. To continue with chapter 2, you can use +the following command: > + vimtutor -c 2 +< There are a few translated versions of the tutor. To find out if yours is available, use the two-letter language code. For French: > diff --git a/usr/share/vim/vim91/doc/usr_10.txt b/usr/share/vim/vim91/doc/usr_10.txt index 4ffd235562b..29ccd9f8879 100644 --- a/usr/share/vim/vim91/doc/usr_10.txt +++ b/usr/share/vim/vim91/doc/usr_10.txt @@ -1,4 +1,4 @@ -*usr_10.txt* For Vim version 9.1. Last change: 2019 Nov 22 +*usr_10.txt* For Vim version 9.1. Last change: 2024 Nov 12 VIM USER MANUAL - by Bram Moolenaar @@ -736,6 +736,11 @@ The "!!" command filters the current line through a filter. In Unix the "date" command prints the current time and date. "!!date" replaces the current line with the output of "date". This is useful to add a timestamp to a file. +Note: There is a difference between "!cmd" (e.g. using it without any file +range) and "{range}!cmd". While the former will simply execute the external +command and Vim will show the output, the latter will filter {range}lines +through the filter and replace that range by the result of the filter command. +See |:!| and |:range!| for details. WHEN IT DOESN'T WORK diff --git a/usr/share/vim/vim91/doc/usr_41.txt b/usr/share/vim/vim91/doc/usr_41.txt index af67429eceb..36907d249ca 100644 --- a/usr/share/vim/vim91/doc/usr_41.txt +++ b/usr/share/vim/vim91/doc/usr_41.txt @@ -1,4 +1,4 @@ -*usr_41.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*usr_41.txt* For Vim version 9.1. Last change: 2024 Nov 11 VIM USER MANUAL - by Bram Moolenaar @@ -778,6 +778,7 @@ String manipulation: *string-functions* strdisplaywidth() size of string when displayed, deals with tabs setcellwidths() set character cell width overrides getcellwidths() get character cell width overrides + getcellpixels() get character cell pixel size reverse() reverse the order of characters in a string substitute() substitute a pattern match with a string submatch() get a specific match in ":s" and substitute() @@ -1394,6 +1395,7 @@ Various: *various-functions* did_filetype() check if a FileType autocommand was used diff() diff two Lists of strings eventhandler() check if invoked by an event handler + getcellpixels() get List of cell pixel size getpid() get process ID of Vim getscriptinfo() get list of sourced vim scripts getimstatus() check if IME status is active diff --git a/usr/share/vim/vim91/doc/usr_51.txt b/usr/share/vim/vim91/doc/usr_51.txt index a74795e46c7..a6e547b9d03 100644 --- a/usr/share/vim/vim91/doc/usr_51.txt +++ b/usr/share/vim/vim91/doc/usr_51.txt @@ -1,4 +1,4 @@ -*usr_51.txt* For Vim version 9.1. Last change: 2024 Apr 04 +*usr_51.txt* For Vim version 9.1. Last change: 2024 Nov 13 VIM USER MANUAL - by Bram Moolenaar @@ -656,6 +656,8 @@ an example: > CompilerSet errorformat& " use the default 'errorformat' CompilerSet makeprg=nmake +Note: arguments need to be escaped according to |option-backslash|. + When you write a compiler plugin for the Vim distribution or for a system-wide runtime directory, use the mechanism mentioned above. When "current_compiler" was already set by a user plugin nothing will be done. diff --git a/usr/share/vim/vim91/doc/various.txt b/usr/share/vim/vim91/doc/various.txt index 4c267941d76..5f0ad0635ce 100644 --- a/usr/share/vim/vim91/doc/various.txt +++ b/usr/share/vim/vim91/doc/various.txt @@ -1,4 +1,4 @@ -*various.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*various.txt* For Vim version 9.1. Last change: 2024 Nov 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -254,7 +254,8 @@ g8 Print the hex values of the bytes used in the *:!cmd* *:!* :!{cmd} Execute {cmd} with the shell. See also the 'shell' - and 'shelltype' option. + and 'shelltype' option. For the filter command, see + |:range!|. *E34* Any '!' in {cmd} is replaced with the previous external command (see also 'cpoptions'). But not when diff --git a/usr/share/vim/vim91/doc/version9.txt b/usr/share/vim/vim91/doc/version9.txt index 400ccd74aef..10e13f846ac 100644 --- a/usr/share/vim/vim91/doc/version9.txt +++ b/usr/share/vim/vim91/doc/version9.txt @@ -1,4 +1,4 @@ -*version9.txt* For Vim version 9.1. Last change: 2024 Oct 14 +*version9.txt* For Vim version 9.1. Last change: 2024 Nov 14 VIM REFERENCE MANUAL by Bram Moolenaar @@ -31790,7 +31790,7 @@ Changed ~ - The features |++builtin_terms|, |+cmdline_info|, |+cmdwin|, |+file_in_path|, |+float|, |+path_extra|, |+textobjects|, |+wildignore| and |+wildmenu| are available in all the builds. -- Support for Windows-XP is dropped. +- Support for Windows-XP is dropped (starting with v9.0.0496) - Support for VisVim is removed. - The "small" and "big" builds are dropped in favor of "tiny" and "huge" builds. @@ -41600,6 +41600,13 @@ Changed~ - |:keeppatterns| preserves the last substitute pattern when used with |:s| - |setqflist()| and |setloclist()| can optionally try to preserve the current selection in the quickfix list with the "u" action. +- the putty terminal is detected using an |TermResponse| autocommand in + |defaults.vim| and Vim switches to a dark background +- the |help-TOC| package is included to ease navigating the documentation. +- an interactive tutor plugin has been included |vim-tutor-mode|, can be + started via |:Tutor| +- improve the |vimtutor| and add a second chapter for more advanced tips +- allow to pass local Vim script variables to python interpreter |py3eval()| *added-9.2* Added ~ @@ -41614,6 +41621,7 @@ Functions: ~ |foreach()| apply function to List items |getcmdcomplpat()| Shell command line completion |getcmdprompt()| get prompt for input()/confirm() +|getcellpixels()| get List of terminal cell pixel size |getregion()| get a region of text from a buffer |getregionpos()| get a list of positions for a region |id()| get unique identifier for a Dict, List, Object, @@ -41649,6 +41657,9 @@ Options: ~ 'completeitemalign' Order of |complete-items| in Insert mode completion popup +'findfunc' Vim function to obtain the results for a |:find| + command +'msghistory' Max number of messages to remember 'winfixbuf' Keep buffer focused in a window 'tabclose' Which tab page to focus after closing a tab page 't_xo' Terminal uses XON/XOFF handshaking (e.g. vt420) diff --git a/usr/share/vim/vim91/doc/vi_diff.txt b/usr/share/vim/vim91/doc/vi_diff.txt index 58bce5e53ed..b96f77907c7 100644 --- a/usr/share/vim/vim91/doc/vi_diff.txt +++ b/usr/share/vim/vim91/doc/vi_diff.txt @@ -1,4 +1,4 @@ -*vi_diff.txt* For Vim version 9.1. Last change: 2024 Oct 05 +*vi_diff.txt* For Vim version 9.1. Last change: 2024 Nov 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -21,6 +21,7 @@ is missing something or because Posix is beside the mark). 6. Supported Vi features |vi-features| 7. Command-line arguments |cmdline-arguments| 8. POSIX compliance |posix-compliance| +9. Supported Operating Systems |os-support| ============================================================================== 1. Simulated command *simulated-command* @@ -1361,5 +1362,37 @@ These are remarks about running the POSIX test suite: 1 instead of 2. - ex test 534 fails because .exrc isn't read in silent mode. +============================================================================== +9. Supported Operating systems *os-support* + +Vim tries to support some old operating systems, however support for older +operating systems might be dropped if maintenance becomes a burden or can no +longer be verified. + +Here is the status of some operating systems. Note fully supported means, +support is verified as part of the CI test suite. + +System | Status:~ +--------------------------------+----------------------------------------- +Amiga (OS4, AROS & MorphOS): | still supported (?) +Haiku: | still supported (?) +Linux: | fully supported (on maintained versions) +Mac OS: | fully supported up until v10.6 (?) +MS-Windows 7, 8, 10, 11: | fully supported +UNIX: | supported (on maintained versions) +OpenVMS: | supported +QNX: | still supported (?) +zOS/OS390: | still supported (?) + +The following operating systems are no longer supported: + +System | Status:~ +--------------------------------+----------------------------------------- +Atari MiNT | support was dropped with v8.2.1215 +BeOS: | support was dropped with v8.2.0849 +MS-DOS: | support was dropped with v7.4.1399 +MS-Windows XP and Vista: | support was dropped with v9.0.0496 +OS/2 | support was dropped with v7.4.1008 +RISC OS: | support was dropped with v7.3.0187 vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/usr/share/vim/vim91/doc/vim9class.txt b/usr/share/vim/vim91/doc/vim9class.txt index ef96aa9076e..a06c2c6e082 100644 --- a/usr/share/vim/vim91/doc/vim9class.txt +++ b/usr/share/vim/vim91/doc/vim9class.txt @@ -1,4 +1,4 @@ -*vim9class.txt* For Vim version 9.1. Last change: 2024 Apr 13 +*vim9class.txt* For Vim version 9.1. Last change: 2024 Nov 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -873,6 +873,33 @@ Note that the method name must start with "new". If there is no method called "new()" then the default constructor is added, even though there are other constructor methods. +Using variable type "any" for an Object~ + *obj-var-type-any* +You can use a variable declared with type "any" to hold an object. e.g. +> + vim9script + class A + var n = 10 + def Get(): number + return this.n + enddef + endclass + + def Fn(o: any) + echo o.n + echo o.Get() + enddef + + var a = A.new() + Fn(a) +< +In this example, Vim cannot determine the type of the parameter "o" for +function Fn() at compile time. It can be either a |Dict| or an |Object| +value. Therefore, at runtime, when the type is known, the object member +variable and method are looked up. This process is not efficient, so it is +recommended to use a more specific type whenever possible for better +efficiency. + Compiling methods in a Class ~ *class-compile* The |:defcompile| command can be used to compile all the class and object diff --git a/usr/share/vim/vim91/filetype.vim b/usr/share/vim/vim91/filetype.vim index 98cb23e284c..0c51bb09a11 100644 --- a/usr/share/vim/vim91/filetype.vim +++ b/usr/share/vim/vim91/filetype.vim @@ -283,7 +283,7 @@ au BufNewFile,BufRead *.blade.php setf blade au BufNewFile,BufRead *.bl setf blank " Bitbake -au BufNewFile,BufRead *.bb,*.bbappend,*.bbclass,*/build/conf/*.conf,*/meta{-*,}/conf/*.conf setf bitbake +au BufNewFile,BufRead *.bb,*.bbappend,*.bbclass,*/build/conf/*.conf,*/meta{-*,}/conf/*.conf,*/project-spec/configs/*.conf setf bitbake " Blkid cache file au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml @@ -570,6 +570,9 @@ au BufNewFile,BufRead *.dsp call dist#ft#FTdsp() au BufNewFile,BufRead *.xcu,*.xlb,*.xlc,*.xba setf xml au BufNewFile,BufRead psprint.conf,sofficerc setf dosini +" Libtool files +au BufNewFile,BufRead *.lo,*.la,*.lai setf sh + " Lynx config files au BufNewFile,BufRead lynx.cfg setf lynx @@ -751,8 +754,12 @@ au BufNewFile,BufRead *.dsl " DTD (Document Type Definition for XML) au BufNewFile,BufRead *.dtd setf dtd -" DTS/DSTI/DTSO (device tree files) -au BufNewFile,BufRead *.dts,*.dtsi,*.dtso,*.its,*.keymap setf dts +" Devicetree (.its for U-Boot Flattened Image Trees, .keymap for ZMK keymap, and +" .overlay for Zephyr overlay) +au BufNewFile,BufRead *.dts,*.dtsi,*.dtso setf dts +au BufNewFile,BufRead *.its setf dts +au BufNewFile,BufRead *.keymap setf dts +au BufNewFile,BufRead *.overlay setf dts " Earthfile au BufNewFile,BufRead Earthfile setf earthfile @@ -1126,6 +1133,10 @@ au BufNewFile,BufRead indent.pro call dist#ft#ProtoCheck('indent') " IDL (Interactive Data Language), Prolog, Cproto or zsh module C au BufNewFile,BufRead *.pro call dist#ft#ProtoCheck('idlang') +" Idris2 +au BufNewFile,BufRead *.idr setf idris2 +au BufNewFile,BufRead *.lidr setf lidris2 + " Indent RC au BufNewFile,BufRead indentrc setf indent @@ -1145,6 +1156,9 @@ au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2 " Ipfilter au BufNewFile,BufRead ipf.conf,ipf6.conf,ipf.rules setf ipfilter +" Ipkg for Idris 2 language +au BufNewFile,BufRead *.ipkg setf ipkg + " Informix 4GL (source - canonical, include file, I4GL+M4 preproc.) au BufNewFile,BufRead *.4gl,*.4gh,*.m4gl setf fgl @@ -1318,6 +1332,9 @@ au BufRead,BufNewFile *.ldg,*.ledger,*.journal setf ledger " lf configuration (lfrc) au BufNewFile,BufRead lfrc setf lf +" Leo +au BufNewFile,BufRead *.leo setf leo + " Less au BufNewFile,BufRead *.less setf less @@ -1334,7 +1351,7 @@ au BufNewFile,BufRead */etc/sensors.conf,*/etc/sensors3.conf setf sensors au BufNewFile,BufRead lftp.conf,.lftprc,*lftp/rc setf lftp " Lifelines (or Lex for C++!) -au BufNewFile,BufRead *.ll setf lifelines +au BufNewFile,BufRead *.ll call dist#ft#FTll() " Lilo: Linux loader au BufNewFile,BufRead lilo.conf setf lilo @@ -1455,6 +1472,9 @@ au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md \ setf markdown | \ endif +" Org (Emacs' org-mode) +au BufNewFile,BufRead *.org setf org + " Mason (it used to include *.comp, are those Mason files?) au BufNewFile,BufRead *.mason,*.mhtml setf mason @@ -2423,6 +2443,9 @@ au BufNewFile,BufRead *.sml setf sml " Sratus VOS command macro au BufNewFile,BufRead *.cm setf voscm +" Sway (programming language) +au BufNewFile,BufRead *.sw setf sway + " Swift au BufNewFile,BufRead *.swift,*.swiftinterface setf swift au BufNewFile,BufRead *.swift.gyb setf swiftgyb @@ -2579,6 +2602,9 @@ au BufNewFile,BufReadPost *.tsscl setf tsscl " TSV Files au BufNewFile,BufRead *.tsv setf tsv +" Tutor mode +au BufNewFile,BufReadPost *.tutor setf tutor + " TWIG files au BufNewFile,BufReadPost *.twig setf twig @@ -2815,7 +2841,7 @@ au BufNewFile,BufRead xorg.conf,xorg.conf-4 let b:xf86conf_xfree86_version = 4 | au BufNewFile,BufRead */etc/xinetd.conf setf xinetd " Xilinx Vivado/Vitis project files and block design files -au BufNewFile,BufRead *.xpr,*.xpfm,*.spfm,*.bxml setf xml +au BufNewFile,BufRead *.xpr,*.xpfm,*.spfm,*.bxml,*.mmi setf xml au BufNewFile,BufRead *.bd,*.bda,*.xci setf json " XS Perl extension interface language @@ -2896,6 +2922,7 @@ au BufNewFile,BufRead *.y call dist#ft#FTy() " Yaml au BufNewFile,BufRead *.yaml,*.yml,*.eyaml setf yaml +au BufNewFile,BufRead */.kube/config setf yaml " Raml au BufNewFile,BufRead *.raml setf raml diff --git a/usr/share/vim/vim91/ftplugin/cook.vim b/usr/share/vim/vim91/ftplugin/cook.vim new file mode 100644 index 00000000000..3697803e74c --- /dev/null +++ b/usr/share/vim/vim91/ftplugin/cook.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Cooklang +" Maintainer: Riley Bruins +" Last Change: 2024 Nov 03 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:-- commentstring=--\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/usr/share/vim/vim91/ftplugin/dune.vim b/usr/share/vim/vim91/ftplugin/dune.vim index 6e20a8fabb3..7608d53527a 100644 --- a/usr/share/vim/vim91/ftplugin/dune.vim +++ b/usr/share/vim/vim91/ftplugin/dune.vim @@ -6,13 +6,14 @@ " 2023 Aug 28 - Added undo_ftplugin (Vim Project) " 2018 Nov 03 - Added commentstring (Markus Mottl) " 2017 Sep 06 - Initial version (Etienne Millon) +" 2024 Nov 09 - use setl instead of :set if exists("b:did_ftplugin") finish endif let b:did_ftplugin=1 -set lisp +setl lisp " Comment string setl commentstring=;\ %s diff --git a/usr/share/vim/vim91/ftplugin/idris2.vim b/usr/share/vim/vim91/ftplugin/idris2.vim new file mode 100644 index 00000000000..54e5acef901 --- /dev/null +++ b/usr/share/vim/vim91/ftplugin/idris2.vim @@ -0,0 +1,34 @@ +" Vim ftplugin file +" Language: Idris 2 +" Last Change: 2024 Nov 05 +" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma +" License: Vim (see :h license) +" Repository: https://github.com/ShinKage/idris2-nvim +" +" Based on ftplugin/idris2.vim from https://github.com/edwinb/idris2-vim + +if exists("b:did_ftplugin") + finish +endif + +setlocal shiftwidth=2 +setlocal tabstop=2 + +" Set g:idris2#allow_tabchar = 1 to use tabs instead of spaces +if exists('g:idris2#allow_tabchar') && g:idris2#allow_tabchar != 0 + setlocal noexpandtab +else + setlocal expandtab +endif + +setlocal comments=s1:{-,mb:-,ex:-},:\|\|\|,:-- +setlocal commentstring=--\ %s + +" makes ? a part of a word, e.g. for named holes `vzipWith f [] [] = ?vzipWith_rhs_3`, uncomment if want to reenable +" setlocal iskeyword+=? + +setlocal wildignore+=*.ibc + +let b:undo_ftplugin = "setlocal shiftwidth< tabstop< expandtab< comments< commentstring< iskeyword< wildignore<" + +let b:did_ftplugin = 1 diff --git a/usr/share/vim/vim91/ftplugin/ipkg.vim b/usr/share/vim/vim91/ftplugin/ipkg.vim new file mode 100644 index 00000000000..70ae26ec177 --- /dev/null +++ b/usr/share/vim/vim91/ftplugin/ipkg.vim @@ -0,0 +1,19 @@ +" Vim ftplugin file +" Language: Ipkg +" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma +" Last Change: 2024 Nov 05 +" Author: ShinKage +" License: Vim (see :h license) +" Repository: https://github.com/ShinKage/idris2-nvim + +if exists("b:did_ftplugin") + finish +endif + +setlocal comments=:-- +setlocal commentstring=--\ %s +setlocal wildignore+=*.ibc + +let b:undo_ftplugin = "setlocal shiftwidth< tabstop< expandtab< comments< commentstring< iskeyword< wildignore<" + +let b:did_ftplugin = 1 diff --git a/usr/share/vim/vim91/ftplugin/leo.vim b/usr/share/vim/vim91/ftplugin/leo.vim new file mode 100644 index 00000000000..a009c02df46 --- /dev/null +++ b/usr/share/vim/vim91/ftplugin/leo.vim @@ -0,0 +1,13 @@ +" Vim filetype plugin +" Language: Leo +" Maintainer: Riley Bruins +" Last Change: 2024 Nov 03 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl comments=:// commentstring=//\ %s + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/usr/share/vim/vim91/ftplugin/llvm.vim b/usr/share/vim/vim91/ftplugin/llvm.vim new file mode 100644 index 00000000000..148b12f102d --- /dev/null +++ b/usr/share/vim/vim91/ftplugin/llvm.vim @@ -0,0 +1,12 @@ +" Vim filetype plugin file +" Language: LLVM IR +" Last Change: 2024 Oct 22 +" Maintainer: Wu, Zhenyu + +if exists("b:did_ftplugin") | finish | endif +let b:did_ftplugin = 1 + +setl comments=:; +setl commentstring=;\ %s + +let b:undo_ftplugin = "setl commentstring< comments<" diff --git a/usr/share/vim/vim91/ftplugin/org.vim b/usr/share/vim/vim91/ftplugin/org.vim new file mode 100644 index 00000000000..45a5e19d49c --- /dev/null +++ b/usr/share/vim/vim91/ftplugin/org.vim @@ -0,0 +1,37 @@ +" Vim filetype plugin file +" Language: Org +" Maintainer: Luca Saccarola +" Last Change: 2024 Nov 14 + +if exists("b:did_ftplugin") + finish +endif +let b:did_ftplugin = 1 + +if exists('b:undo_ftplugin') + let b:undo_ftplugin .= "|setl cms< com< fo< flp<" +else + let b:undo_ftplugin = "setl cms< com< fo< flp<" +endif + +setl commentstring=#\ %s +setl comments=fb:*,fb:-,fb:+,b:#,b:\: + +setl formatoptions+=nql +setl formatlistpat=^\\s*\\(\\(\\d\\|\\a\\)\\+[.)]\\|[+-]\\)\\s\\+ + +function OrgFoldExpr() + let l:depth = match(getline(v:lnum), '\(^\*\+\)\@<=\( .*$\)\@=') + if l:depth > 0 && synIDattr(synID(v:lnum, 1, 1), 'name') =~# '\m^orgHeadline' + return ">" . l:depth + endif + return "=" +endfunction + +if has("folding") && get(g:, 'org_folding', 0) + setl foldexpr=OrgFoldExpr() + setl foldmethod=expr + let b:undo_ftplugin .= "|setl foldexpr< foldmethod<" +endif + +" vim: ts=8 sts=2 sw=2 et diff --git a/usr/share/vim/vim91/ftplugin/racket.vim b/usr/share/vim/vim91/ftplugin/racket.vim index 7bfd87ddc37..52768d67f5a 100644 --- a/usr/share/vim/vim91/ftplugin/racket.vim +++ b/usr/share/vim/vim91/ftplugin/racket.vim @@ -3,7 +3,7 @@ " Maintainer: D. Ben Knoble " Previous Maintainer: Will Langstroth " URL: https://github.com/benknoble/vim-racket -" Last Change: 2024 May 28 +" Last Change: 2024 Jun 01 if exists("b:did_ftplugin") finish @@ -16,19 +16,20 @@ set cpo&vim " quick hack to allow adding values setlocal iskeyword=@,!,#-',*-:,<-Z,a-z,~,_,94 +setlocal shiftwidth=2 softtabstop=2 + " Enable auto begin new comment line when continuing from an old comment line setlocal comments=:;;;;,:;;;,:;;,:; setlocal formatoptions+=r -"setlocal commentstring=;;\ %s -setlocal commentstring=#\|\ %s\ \|# +setlocal commentstring=;;\ %s setlocal formatprg=raco\ fmt " Undo our settings when the filetype changes away from Racket " (this should be amended if settings/mappings are added above!) let b:undo_ftplugin = - \ "setlocal iskeyword< lispwords< lisp< comments< formatoptions< formatprg<" + \ "setlocal iskeyword< shiftwidth< softtabstop< comments< formatoptions< formatprg<" \. " | setlocal commentstring<" if !exists("no_plugin_maps") && !exists("no_racket_maps") diff --git a/usr/share/vim/vim91/ftplugin/sway.vim b/usr/share/vim/vim91/ftplugin/sway.vim new file mode 100644 index 00000000000..35970b257cd --- /dev/null +++ b/usr/share/vim/vim91/ftplugin/sway.vim @@ -0,0 +1,15 @@ +" Vim filetype plugin +" Language: Sway +" Maintainer: Riley Bruins +" Last Change: 2024 Nov 01 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setl commentstring=//\ %s +" From Rust comments +setl comments=s0:/*!,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,:// + +let b:undo_ftplugin = 'setl com< cms<' diff --git a/usr/share/vim/vim91/ftplugin/tutor.vim b/usr/share/vim/vim91/ftplugin/tutor.vim new file mode 100644 index 00000000000..30783d9799a --- /dev/null +++ b/usr/share/vim/vim91/ftplugin/tutor.vim @@ -0,0 +1,45 @@ +" vim: fdm=marker + +" Base: {{{1 +call tutor#SetupVim() + +" Buffer Settings: {{{1 +setlocal noreadonly +if !exists('g:tutor_debug') || g:tutor_debug == 0 + setlocal buftype=nofile + setlocal concealcursor+=inv + setlocal conceallevel=2 +else + setlocal buftype= + setlocal concealcursor& + setlocal conceallevel=0 +endif +setlocal noundofile + +setlocal keywordprg=:help +setlocal iskeyword=@,-,_ + +" The user will have to enable the folds himself, but we provide the foldexpr +" function. +setlocal foldmethod=manual +setlocal foldexpr=tutor#TutorFolds() +setlocal foldlevel=4 + +" Load metadata if it exists: {{{1 +if filereadable(expand('%').'.json') + call tutor#LoadMetadata() +endif + +" Mappings: {{{1 + +call tutor#SetNormalMappings() + +" Checks: {{{1 + +sign define tutorok text=✓ texthl=tutorOK +sign define tutorbad text=✗ texthl=tutorX + +if !exists('g:tutor_debug') || g:tutor_debug == 0 + call tutor#ApplyMarks() + autocmd! TextChanged,TextChangedI call tutor#ApplyMarksOnChanged() +endif diff --git a/usr/share/vim/vim91/ftplugin/typst.vim b/usr/share/vim/vim91/ftplugin/typst.vim index 895fc688d9c..3841e427f30 100644 --- a/usr/share/vim/vim91/ftplugin/typst.vim +++ b/usr/share/vim/vim91/ftplugin/typst.vim @@ -1,7 +1,7 @@ " Vim filetype plugin file " Language: Typst " Maintainer: Gregory Anders -" Last Change: 2024 Oct 04 +" Last Change: 2024 Oct 21 " Based on: https://github.com/kaarmu/typst.vim if exists('b:did_ftplugin') @@ -21,6 +21,12 @@ if get(g:, 'typst_conceal', 0) let b:undo_ftplugin .= ' cole<' endif +if has("folding") && get(g:, 'typst_folding', 0) + setlocal foldexpr=typst#foldexpr() + setlocal foldmethod=expr + let b:undo_ftplugin .= "|setl foldexpr< foldmethod<" +endif + if !exists('current_compiler') compiler typst let b:undo_ftplugin ..= "| compiler make" diff --git a/usr/share/vim/vim91/indent/idris2.vim b/usr/share/vim/vim91/indent/idris2.vim new file mode 100644 index 00000000000..d3c306e0a19 --- /dev/null +++ b/usr/share/vim/vim91/indent/idris2.vim @@ -0,0 +1,183 @@ +" Vim indent file +" Language: Idris 2 +" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma +" Author: raichoo +" Last Change: 2024 Nov 05 +" License: Vim (see :h license) +" Repository: https://github.com/ShinKage/idris2-nvim +" +" indentation for idris (idris-lang.org) +" +" Based on haskell indentation by motemen +" +" Indentation configuration variables: +" +" g:idris2_indent_if (default: 3) +" Controls indentation after 'if' statements +" Example: +" if condition +" >>>then expr +" >>>else expr +" +" g:idris2_indent_case (default: 5) +" Controls indentation of case expressions +" Example: +" case x of +" >>>>>Left y => ... +" >>>>>Right z => ... +" +" g:idris2_indent_let (default: 4) +" Controls indentation after 'let' bindings +" Example: +" let x = expr in +" >>>>body +" +" g:idris2_indent_rewrite (default: 8) +" Controls indentation after 'rewrite' expressions +" Example: +" rewrite proof in +" >>>>>>>>expr +" +" g:idris2_indent_where (default: 6) +" Controls indentation of 'where' blocks +" Example: +" function args +" >>>>>>where helper = expr +" +" g:idris2_indent_do (default: 3) +" Controls indentation in 'do' blocks +" Example: +" do x <- action +" >>>y <- action +" +" Example configuration in .vimrc: +" let g:idris2_indent_if = 2 + +if exists('b:did_indent') + finish +endif + +setlocal indentexpr=GetIdrisIndent() +setlocal indentkeys=!^F,o,O,} + +let b:did_indent = 1 +let b:undo_indent = "setlocal indentexpr< indentkeys<" + +" we want to use line continuations (\) BEGINNING +let s:cpo_save = &cpo +set cpo&vim + +" Define defaults for indent configuration +let s:indent_defaults = { + \ 'idris2_indent_if': 3, + \ 'idris2_indent_case': 5, + \ 'idris2_indent_let': 4, + \ 'idris2_indent_rewrite': 8, + \ 'idris2_indent_where': 6, + \ 'idris2_indent_do': 3 + \ } + +" we want to use line continuations (\) END +let &cpo = s:cpo_save +unlet s:cpo_save + +" Set up indent settings with user overrides +for [key, default] in items(s:indent_defaults) + let varname = 'g:' . key + if !exists(varname) + execute 'let' varname '=' default + endif +endfor + +if exists("*GetIdrisIndent") + finish +endif + +function! GetIdrisIndent() + let prevline = getline(v:lnum - 1) + + if prevline =~ '\s\+(\s*.\+\s\+:\s\+.\+\s*)\s\+->\s*$' + return match(prevline, '(') + elseif prevline =~ '\s\+{\s*.\+\s\+:\s\+.\+\s*}\s\+->\s*$' + return match(prevline, '{') + endif + + if prevline =~ '[!#$%&*+./<>?@\\^|~-]\s*$' + let s = match(prevline, '[:=]') + if s > 0 + return s + 2 + else + return match(prevline, '\S') + endif + endif + + if prevline =~ '[{([][^})\]]\+$' + return match(prevline, '[{([]') + endif + + if prevline =~ '\\s\+.\+\\s*$' + return match(prevline, '\') + g:idris2_indent_let + endif + + if prevline =~ '\\s\+.\+\\s*$' + return match(prevline, '\') + g:idris2_indent_rewrite + endif + + if prevline !~ '\' + let s = match(prevline, '\.*\&.*\zs\') + if s > 0 + return s + endif + + let s = match(prevline, '\') + if s > 0 + return s + g:idris2_indent_if + endif + endif + + if prevline =~ '\(\\|\\|=\|[{([]\)\s*$' + return match(prevline, '\S') + &shiftwidth + endif + + if prevline =~ '\\s\+\S\+.*$' + return match(prevline, '\') + g:idris2_indent_where + endif + + if prevline =~ '\\s\+\S\+.*$' + return match(prevline, '\') + g:idris2_indent_do + endif + + if prevline =~ '^\s*\<\(co\)\?data\>\s\+[^=]\+\s\+=\s\+\S\+.*$' + return match(prevline, '=') + endif + + if prevline =~ '\\s\+([^)]*)\s*$' + return match(prevline, '\S') + &shiftwidth + endif + + if prevline =~ '\\s\+.\+\\s*$' + return match(prevline, '\') + g:idris2_indent_case + endif + + if prevline =~ '^\s*\(\\|\<\(co\)\?data\>\)\s\+\S\+\s*$' + return match(prevline, '\(\\|\<\(co\)\?data\>\)') + &shiftwidth + endif + + if prevline =~ '^\s*\(\\|\\)\s*([^(]*)\s*$' + return match(prevline, '\(\\|\\)') + &shiftwidth + endif + + if prevline =~ '^\s*\\s*$' + return match(prevline, '\') + &shiftwidth + endif + + let line = getline(v:lnum) + + if (line =~ '^\s*}\s*' && prevline !~ '^\s*;') + return match(prevline, '\S') - &shiftwidth + endif + + return match(prevline, '\S') +endfunction + +" vim:et:sw=2:sts=2 diff --git a/usr/share/vim/vim91/indent/racket.vim b/usr/share/vim/vim91/indent/racket.vim index d301cd64f9f..2bab3f3bed3 100644 --- a/usr/share/vim/vim91/indent/racket.vim +++ b/usr/share/vim/vim91/indent/racket.vim @@ -3,7 +3,7 @@ " Maintainer: D. Ben Knoble " Previous Maintainer: Will Langstroth " URL: https://github.com/benknoble/vim-racket -" Last Change: 2024 Jan 31 +" Last Change: 2024 Nov 12 if exists("b:did_indent") finish @@ -21,6 +21,7 @@ setlocal lispwords+=λ setlocal lispwords+=with-handlers setlocal lispwords+=define-values,opt-lambda,case-lambda,syntax-rules,with-syntax,syntax-case,syntax-parse setlocal lispwords+=define-for-syntax,define-syntax-parser,define-syntax-parse-rule,define-syntax-class,define-splicing-syntax-class +setlocal lispwords+=syntax/loc,quasisyntax/loc setlocal lispwords+=define-syntax-parameter,syntax-parameterize setlocal lispwords+=define-signature,unit,unit/sig,compund-unit/sig,define-values/invoke-unit/sig setlocal lispwords+=define-opt/c,define-syntax-rule @@ -30,6 +31,11 @@ setlocal lispwords+=with-input-from-file,with-output-to-file setlocal lispwords+=begin,begin0 setlocal lispwords+=place setlocal lispwords+=cond +" Racket style indents if like a function application: +" (if test +" then +" else) +setlocal lispwords-=if " Racket OOP " TODO missing a lot of define-like forms here (e.g., define/augment, etc.) @@ -50,6 +56,7 @@ setlocal lispwords+=for/set,for*/set setlocal lispwords+=for/first,for*/first setlocal lispwords+=for/last,for*/last setlocal lispwords+=for/stream,for*/stream +setlocal lispwords+=for/lists,for*/lists setlocal lispwords+=match,match*,match/values,define/match,match-lambda,match-lambda*,match-lambda** setlocal lispwords+=match-let,match-let*,match-let-values,match-let*-values @@ -66,4 +73,7 @@ setlocal lispwords+=if-view,case-view,cond-view,list-view,dyn-view setlocal lispwords+=case/dep setlocal lispwords+=define/obs +" rackunit +setlocal lispwords+=define-simple-check,define-binary-check,define-check,with-check-info + let b:undo_indent = "setlocal lisp< ai< si< lw<" .. (has('vim9script') ? ' indentexpr< lispoptions<' : '') diff --git a/usr/share/vim/vim91/indent/sh.vim b/usr/share/vim/vim91/indent/sh.vim index aa47c6d1bda..184e8298733 100644 --- a/usr/share/vim/vim91/indent/sh.vim +++ b/usr/share/vim/vim91/indent/sh.vim @@ -7,6 +7,8 @@ " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-sh-indent " Changelog: +" 20241411 - Detect dash character in function keyword for +" bash mode (issue #16049) " 20190726 - Correctly skip if keywords in syntax comments " (issue #17) " 20190603 - Do not indent in zsh filetypes with an `if` in comments @@ -195,7 +197,9 @@ endfunction function! s:is_function_definition(line) return a:line =~ '^\s*\<\k\+\>\s*()\s*{' || \ a:line =~ '^\s*{' || - \ a:line =~ '^\s*function\s*\k\+\s*\%(()\)\?\s*{' + \ a:line =~ '^\s*function\s*\k\+\s*\%(()\)\?\s*{' || + \ ((&ft is# 'zsh' || s:is_bash()) && + \ a:line =~ '^\s*function\s*\S\+\s*\%(()\)\?\s*{' ) endfunction function! s:is_array(line) diff --git a/usr/share/vim/vim91/optwin.vim b/usr/share/vim/vim91/optwin.vim index 99b1ecfd214..c8170da71d0 100644 --- a/usr/share/vim/vim91/optwin.vim +++ b/usr/share/vim/vim91/optwin.vim @@ -749,6 +749,8 @@ call AddOption("terse", gettext("add 's' flag in 'shortmess' (don't show se call BinOptionG("terse", &terse) call AddOption("shortmess", gettext("list of flags to make messages shorter")) call OptionG("shm", &shm) +call AddOption("msghistory", gettext("how many messages are remembered")) +call append("$", " \tset mhi=" . &mhi) call AddOption("showcmd", gettext("show (partial) command keys in location given by 'showcmdloc'")) let &sc = s:old_sc call BinOptionG("sc", &sc) diff --git a/usr/share/vim/vim91/pack/dist/opt/helptoc/autoload/helptoc.vim b/usr/share/vim/vim91/pack/dist/opt/helptoc/autoload/helptoc.vim new file mode 100644 index 00000000000..087da798e9f --- /dev/null +++ b/usr/share/vim/vim91/pack/dist/opt/helptoc/autoload/helptoc.vim @@ -0,0 +1,940 @@ +vim9script noclear + +# Config {{{1 + +const SHELL_PROMPT: string = g: + ->get('helptoc', {}) + ->get('shell_prompt', '^\w\+@\w\+:\f\+\$\s') + +# Init {{{1 + +const HELP_TEXT: list =<< trim END + normal commands in help window + ────────────────────────────── + ? hide this help window + scroll down one line + scroll up one line + + normal commands in TOC menu + ─────────────────────────── + j select next entry + k select previous entry + J same as j, and jump to corresponding line in main buffer + K same as k, and jump to corresponding line in main buffer + c select nearest entry from cursor position in main buffer + g select first entry + G select last entry + H collapse one level + L expand one level + p print selected entry on command-line + + P same as p but automatically, whenever selection changes + press multiple times to toggle feature on/off + + q quit menu + z redraw menu with selected entry at center + + increase width of popup menu + - decrease width of popup menu + / look for given text with fuzzy algorithm + ? show help window + + scroll down half a page + scroll up half a page + scroll down a whole page + scroll up a whole page + select first entry + select last entry + + title meaning + ───────────── + example: 12/34 (5/6) + broken down: + + 12 index of selected entry + 34 index of last entry + 5 index of deepest level currently visible + 6 index of maximum possible level + + tip + ─── + after inserting a pattern to look for with the / command, + if you press instead of , you can then get + more context for each remaining entry by pressing J or K +END + +const MATCH_ENTRY: dict> = { + help: {}, + + man: { + 1: (line: string, _): bool => line =~ '^\S', + 2: (line: string, _): bool => line =~ '^\%( \{3\}\)\=\S', + 3: (line: string, _): bool => line =~ '^\s\+\(\%(+\|-\)\S\+,\s\+\)*\%(+\|-\)\S\+', + }, + + markdown: { + 1: (line: string, nextline: string): bool => + (line =~ '^#[^#]' || nextline =~ '^=\+$') && line =~ '\w', + 2: (line: string, nextline: string): bool => + (line =~ '^##[^#]' || nextline =~ '^-\+$') && line =~ '\w', + 3: (line: string, _): bool => line =~ '^###[^#]', + 4: (line: string, _): bool => line =~ '^####[^#]', + 5: (line: string, _): bool => line =~ '^#####[^#]', + 6: (line: string, _): bool => line =~ '^######[^#]', + }, + + terminal: { + 1: (line: string, _): bool => line =~ SHELL_PROMPT, + } +} + +const HELP_RULERS: dict = { + '=': '^=\{40,}$', + '-': '^-\{40,}', +} +const HELP_RULER: string = HELP_RULERS->values()->join('\|') + +# the regex is copied from the help syntax plugin +const HELP_TAG: string = '\*[#-)!+-~]\+\*\%(\s\|$\)\@=' + +# Adapted from `$VIMRUNTIME/syntax/help.vim`.{{{ +# +# The original regex is: +# +# ^[-A-Z .][-A-Z0-9 .()_]*\ze\(\s\+\*\|$\) +# +# Allowing a space or a hyphen at the start can give false positives, and is +# useless, so we don't allow them. +#}}} +const HELP_HEADLINE: string = '^\C[A-Z.][-A-Z0-9 .()_]*\%(\s\+\*+\@!\|$\)' +# ^--^ +# To prevent some false positives under `:help feature-list`. + +var lvls: dict +def InitHelpLvls() + lvls = { + '*01.1*': 0, + '1.': 0, + '1.2': 0, + '1.2.3': 0, + 'header ~': 0, + HEADLINE: 0, + tag: 0, + } +enddef + +const AUGROUP: string = 'HelpToc' +var fuzzy_entries: list> +var help_winid: number +var print_entry: bool +var selected_entry_match: number + +# Interface {{{1 +export def Open() #{{{2 + var type: string = GetType() + if !MATCH_ENTRY->has_key(type) + return + endif + if type == 'terminal' && win_gettype() == 'popup' + # trying to deal with a popup menu on top of a popup terminal seems + # too tricky for now + echomsg 'does not work in a popup window; only in a regular window' + return + endif + + # invalidate the cache if the buffer's contents has changed + if exists('b:toc') && &filetype != 'man' + if b:toc.changedtick != b:changedtick + # in a terminal buffer, `b:changedtick` does not change + || type == 'terminal' && line('$') > b:toc.linecount + unlet! b:toc + endif + endif + + if !exists('b:toc') + SetToc() + endif + + var winpos: list = winnr()->win_screenpos() + var height: number = winheight(0) - 2 + var width: number = winwidth(0) + b:toc.width = b:toc.width ?? width / 3 + # the popup needs enough space to display the help message in its title + if b:toc.width < 30 + b:toc.width = 30 + endif + # Is `popup_menu()` OK with a list of dictionaries?{{{ + # + # Yes, see `:help popup_create-arguments`. + # Although, it expects dictionaries with the keys `text` and `props`. + # But we use dictionaries with the keys `text` and `lnum`. + # IOW, we abuse the feature which lets us use text properties in a popup. + #}}} + var winid: number = GetTocEntries() + ->popup_menu({ + line: winpos[0], + col: winpos[1] + width - 1, + pos: 'topright', + scrollbar: false, + highlight: type == 'terminal' ? 'Terminal' : 'Normal', + border: [], + borderchars: ['─', '│', '─', '│', '┌', '┐', '┘', '└'], + minheight: height, + maxheight: height, + minwidth: b:toc.width, + maxwidth: b:toc.width, + filter: Filter, + callback: Callback, + }) + Win_execute(winid, [$'ownsyntax {&filetype}', '&l:conceallevel = 3']) + # In a help file, we might reduce some noisy tags to a trailing asterisk. + # Hide those. + if type == 'help' + matchadd('Conceal', '\*$', 0, -1, {window: winid}) + endif + SelectNearestEntryFromCursor(winid) + + # can't set the title before jumping to the relevant line, otherwise the + # indicator in the title might be wrong + SetTitle(winid) +enddef +#}}}1 +# Core {{{1 +def SetToc() #{{{2 + var toc: dict = {entries: []} + var type: string = GetType() + toc.changedtick = b:changedtick + if !toc->has_key('width') + toc.width = 0 + endif + # We cache the toc in `b:toc` to get better performance.{{{ + # + # Without caching, when we press `H`, `L`, `H`, `L`, ... quickly for a few + # seconds, there is some lag if we then try to move with `j` and `k`. + # This can only be perceived in big man pages like with `:Man ffmpeg-all`. + #}}} + b:toc = toc + + if type == 'help' + SetTocHelp() + return + endif + + if type == 'terminal' + b:toc.linecount = line('$') + endif + + var curline: string = getline(1) + var nextline: string + var lvl_and_test: list> = MATCH_ENTRY + ->get(type, {}) + ->items() + ->sort((l: list, ll: list): number => l[0]->str2nr() - ll[0]->str2nr()) + + for lnum: number in range(1, line('$')) + nextline = getline(lnum + 1) + for [lvl: string, IsEntry: func: bool] in lvl_and_test + if IsEntry(curline, nextline) + b:toc.entries->add({ + lnum: lnum, + lvl: lvl->str2nr(), + text: curline, + }) + break + endif + endfor + curline = nextline + endfor + + InitMaxAndCurLvl() +enddef + +def SetTocHelp() #{{{2 + var main_ruler: string + for line: string in getline(1, '$') + if line =~ HELP_RULER + main_ruler = line =~ '=' ? HELP_RULERS['='] : HELP_RULERS['-'] + break + endif + endfor + + var prevline: string + var curline: string = getline(1) + var nextline: string + var in_list: bool + var last_numbered_entry: number + InitHelpLvls() + for lnum: number in range(1, line('$')) + nextline = getline(lnum + 1) + + if main_ruler != '' && curline =~ main_ruler + last_numbered_entry = 0 + # The information gathered in `lvls` might not be applicable to all + # the main sections of a help file. Let's reset it whenever we find + # a ruler. + InitHelpLvls() + endif + + # Do not assume that a list ends on an empty line. + # See the list at `:help gdb` for a counter-example. + if in_list + && curline !~ '^\d\+.\s' + && curline !~ '^\s*$' + && curline !~ '^[< \t]' + in_list = false + endif + + if prevline =~ '^\d\+\.\s' + && curline !~ '^\s*$' + && curline !~ $'^\s*{HELP_TAG}' + in_list = true + endif + + # 1. + if prevline =~ '^\d\+\.\s' + # let's assume that the start of a main entry is always followed by an + # empty line, or a line starting with a tag + && (curline =~ '^>\=\s*$' || curline =~ $'^\s*{HELP_TAG}') + # ignore a numbered line in a list + && !in_list + var current_numbered_entry: number = prevline + ->matchstr('^\d\+\ze\.\s') + ->str2nr() + if current_numbered_entry > last_numbered_entry + AddEntryInTocHelp('1.', lnum - 1, prevline) + last_numbered_entry = prevline + ->matchstr('^\d\+\ze\.\s') + ->str2nr() + endif + endif + + # 1.2 + if curline =~ '^\d\+\.\d\+\s' + if curline =~ $'\%({HELP_TAG}\s*\|\~\)$' + || (prevline =~ $'^\s*{HELP_TAG}' || nextline =~ $'^\s*{HELP_TAG}') + || (prevline =~ HELP_RULER || nextline =~ HELP_RULER) + || (prevline =~ '^\s*$' && nextline =~ '^\s*$') + AddEntryInTocHelp('1.2', lnum, curline) + endif + # 1.2.3 + elseif curline =~ '^\s\=\d\+\.\d\+\.\d\+\s' + AddEntryInTocHelp('1.2.3', lnum, curline) + endif + + # HEADLINE + if curline =~ HELP_HEADLINE + && curline !~ '^CTRL-' + && prevline->IsSpecialHelpLine() + && (nextline->IsSpecialHelpLine() || nextline =~ '^\s*(\|^\t\|^N[oO][tT][eE]:') + AddEntryInTocHelp('HEADLINE', lnum, curline) + endif + + # header ~ + if curline =~ '\~$' + && curline =~ '\w' + && curline !~ '^[ \t<]\|\t\|---+---\|^NOTE:' + && curline !~ '^\d\+\.\%(\d\+\%(\.\d\+\)\=\)\=\s' + && prevline !~ $'^\s*{HELP_TAG}' + && prevline !~ '\~$' + && nextline !~ '\~$' + AddEntryInTocHelp('header ~', lnum, curline) + endif + + # *some_tag* + if curline =~ HELP_TAG + AddEntryInTocHelp('tag', lnum, curline) + endif + + # In the Vim user manual, a main section is a special case.{{{ + # + # It's not a simple numbered section: + # + # 01.1 + # + # It's used as a tag: + # + # *01.1* Two manuals + # ^ ^ + #}}} + if prevline =~ main_ruler && curline =~ '^\*\d\+\.\d\+\*' + AddEntryInTocHelp('*01.1*', lnum, curline) + endif + + [prevline, curline] = [curline, nextline] + endfor + + # let's ignore the tag on the first line (not really interesting) + if b:toc.entries->get(0, {})->get('lnum') == 1 + b:toc.entries->remove(0) + endif + + # let's also ignore anything before the first `1.` line + var i: number = b:toc.entries + ->copy() + ->map((_, entry: dict) => entry.text) + ->match('^\s*1\.\s') + if i > 0 + b:toc.entries->remove(0, i - 1) + endif + + InitMaxAndCurLvl() + + # set level of tag entries to the deepest level + var has_tag: bool = b:toc.entries + ->copy() + ->map((_, entry: dict) => entry.text) + ->match(HELP_TAG) >= 0 + if has_tag + ++b:toc.maxlvl + endif + b:toc.entries + ->map((_, entry: dict) => entry.lvl == 0 + ? entry->extend({lvl: b:toc.maxlvl}) + : entry) + + # fix indentation + var min_lvl: number = b:toc.entries + ->copy() + ->map((_, entry: dict) => entry.lvl) + ->min() + for entry: dict in b:toc.entries + entry.text = entry.text + ->substitute('^\s*', () => repeat(' ', (entry.lvl - min_lvl) * 3), '') + endfor +enddef + +def AddEntryInTocHelp(type: string, lnum: number, line: string) #{{{2 + # don't add a duplicate entry + if lnum == b:toc.entries->get(-1, {})->get('lnum') + # For a numbered line containing a tag, *do* add an entry. + # But only for its numbered prefix, not for its tag. + # The former is the line's most meaningful representation. + if b:toc.entries->get(-1, {})->get('type') == 'tag' + b:toc.entries->remove(-1) + else + return + endif + endif + + var text: string = line + if type == 'tag' + var tags: list + text->substitute(HELP_TAG, () => !!tags->add(submatch(0)), 'g') + text = tags + # we ignore errors and warnings because those are meaningless in + # a TOC where no context is available + ->filter((_, tag: string) => tag !~ '\*[EW]\d\+\*') + ->join() + if text !~ HELP_TAG + return + endif + endif + + var maxlvl: number = lvls->values()->max() + if type == 'tag' + lvls[type] = 0 + elseif type == '1.2' + lvls[type] = lvls[type] ?? lvls->get('1.', maxlvl) + 1 + elseif type == '1.2.3' + lvls[type] = lvls[type] ?? lvls->get('1.2', maxlvl) + 1 + else + lvls[type] = lvls[type] ?? maxlvl + 1 + endif + + # Ignore noisy tags.{{{ + # + # 14. Linking groups *:hi-link* *:highlight-link* *E412* *E413* + # ^----------------------------------------^ + # ^\s*\d\+\.\%(\d\+\.\=\)*\s\+.\{-}\zs\*.* + # --- + # + # We don't use conceal because then, `matchfuzzypos()` could match concealed + # characters, which would be confusing. + #}}} + # MAKING YOUR OWN SYNTAX FILES *mysyntaxfile* + # ^------------^ + # ^\s*[A-Z].\{-}\*\zs.* + # + var after_HEADLINE: string = '^\s*[A-Z].\{-}\*\zs.*' + # 14. Linking groups *:hi-link* *:highlight-link* *E412* *E413* + # ^----------------------------------------^ + # ^\s*\d\+\.\%(\d\+\.\=\)*\s\+.\{-}\*\zs.* + var after_numbered: string = '^\s*\d\+\.\%(\d\+\.\=\)*\s\+.\{-}\*\zs.*' + # 01.3 Using the Vim tutor *tutor* *vimtutor* + # ^----------------^ + var after_numbered_tutor: string = '^\*\d\+\.\%(\d\+\.\=\)*.\{-}\t\*\zs.*' + var noisy_tags: string = $'{after_HEADLINE}\|{after_numbered}\|{after_numbered_tutor}' + text = text->substitute(noisy_tags, '', '') + # We don't remove the trailing asterisk, because the help syntax plugin + # might need it to highlight some headlines. + + b:toc.entries->add({ + lnum: lnum, + lvl: lvls[type], + text: text, + type: type, + }) +enddef + +def InitMaxAndCurLvl() #{{{2 + b:toc.maxlvl = b:toc.entries + ->copy() + ->map((_, entry: dict) => entry.lvl) + ->max() + b:toc.curlvl = b:toc.maxlvl +enddef + +def Popup_settext(winid: number, entries: list>) #{{{2 + var text: list + # When we fuzzy search the toc, the dictionaries in `entries` contain a + # `props` key, to highlight each matched character individually. + # We don't want to process those dictionaries further. + # The processing should already have been done by the caller. + if entries->get(0, {})->has_key('props') + text = entries + else + text = entries + ->copy() + ->map((_, entry: dict): string => entry.text) + endif + popup_settext(winid, text) + SetTitle(winid) + redraw +enddef + +def SetTitle(winid: number) #{{{2 + var curlnum: number + var lastlnum: number = line('$', winid) + var is_empty: bool = lastlnum == 1 + && winid->winbufnr()->getbufoneline(1) == '' + if is_empty + [curlnum, lastlnum] = [0, 0] + else + curlnum = line('.', winid) + endif + var newtitle: string = printf(' %*d/%d (%d/%d)', + len(lastlnum), curlnum, + lastlnum, + b:toc.curlvl, + b:toc.maxlvl, + ) + + var width: number = winid->popup_getoptions().minwidth + newtitle = printf('%s%*s', + newtitle, + width - newtitle->strlen(), + 'press ? for help ') + + popup_setoptions(winid, {title: newtitle}) +enddef + +def SelectNearestEntryFromCursor(winid: number) #{{{2 + var lnum: number = line('.') + var firstline: number = b:toc.entries + ->copy() + ->filter((_, line: dict): bool => line.lvl <= b:toc.curlvl && line.lnum <= lnum) + ->len() + if firstline == 0 + return + endif + Win_execute(winid, $'normal! {firstline}Gzz') +enddef + +def Filter(winid: number, key: string): bool #{{{2 + # support various normal commands for moving/scrolling + if [ + 'j', 'J', 'k', 'K', "\", "\", "\", "\", + "\", "\", + "\", "\", + 'g', 'G', "\", "\", + 'z' + ]->index(key) >= 0 + var scroll_cmd: string = { + J: 'j', + K: 'k', + g: '1G', + "\": '1G', + "\": 'G', + z: 'zz' + }->get(key, key) + + var old_lnum: number = line('.', winid) + Win_execute(winid, $'normal! {scroll_cmd}') + var new_lnum: number = line('.', winid) + + if print_entry + PrintEntry(winid) + endif + + # wrap around the edges + if new_lnum == old_lnum + scroll_cmd = { + j: '1G', + J: '1G', + k: 'G', + K: 'G', + "\": '1G', + "\": 'G', + "\": '1G', + "\": 'G', + }->get(key, '') + if !scroll_cmd->empty() + Win_execute(winid, $'normal! {scroll_cmd}') + endif + endif + + # move the cursor to the corresponding line in the main buffer + if key == 'J' || key == 'K' + var lnum: number = GetBufLnum(winid) + execute $'normal! 0{lnum}zt' + # install a match in the regular buffer to highlight the position of + # the entry in the latter + MatchDelete() + selected_entry_match = matchaddpos('IncSearch', [lnum], 0, -1) + endif + SetTitle(winid) + + return true + + elseif key == 'c' + SelectNearestEntryFromCursor(winid) + return true + + # when we press `p`, print the selected line (useful when it's truncated) + elseif key == 'p' + PrintEntry(winid) + return true + + # same thing, but automatically + elseif key == 'P' + print_entry = !print_entry + if print_entry + PrintEntry(winid) + else + echo '' + endif + return true + + elseif key == 'q' + popup_close(winid, -1) + return true + + elseif key == '?' + ToggleHelp(winid) + return true + + # scroll help window + elseif key == "\" || key == "\" + var scroll_cmd: string = {"\": 'j', "\": 'k'}->get(key, key) + if scroll_cmd == 'j' && line('.', help_winid) == line('$', help_winid) + scroll_cmd = '1G' + elseif scroll_cmd == 'k' && line('.', help_winid) == 1 + scroll_cmd = 'G' + endif + Win_execute(help_winid, $'normal! {scroll_cmd}') + return true + + # increase/decrease the popup's width + elseif key == '+' || key == '-' + var width: number = winid->popup_getoptions().minwidth + if key == '-' && width == 1 + || key == '+' && winid->popup_getpos().col == 1 + return true + endif + width = width + (key == '+' ? 1 : -1) + # remember the last width if we close and re-open the TOC later + b:toc.width = width + popup_setoptions(winid, {minwidth: width, maxwidth: width}) + return true + + elseif key == 'H' && b:toc.curlvl > 1 + || key == 'L' && b:toc.curlvl < b:toc.maxlvl + CollapseOrExpand(winid, key) + return true + + elseif key == '/' + # This is probably what the user expect if they've started a first fuzzy + # search, press Escape, then start a new one. + DisplayNonFuzzyToc(winid) + + [{ + group: AUGROUP, + event: 'CmdlineChanged', + pattern: '@', + cmd: $'FuzzySearch({winid})', + replace: true, + }, { + group: AUGROUP, + event: 'CmdlineLeave', + pattern: '@', + cmd: 'TearDown()', + replace: true, + }]->autocmd_add() + + # Need to evaluate `winid` right now with an `eval`'ed and `execute()`'ed heredoc because:{{{ + # + # - the mappings can only access the script-local namespace + # - `winid` is in the function namespace; not in the script-local one + #}}} + var input_mappings: list =<< trim eval END + cnoremap Filter({winid}, 'j') + cnoremap Filter({winid}, 'k') + cnoremap Filter({winid}, 'j') + cnoremap Filter({winid}, 'k') + END + input_mappings->execute() + + var look_for: string + try + popup_setoptions(winid, {mapping: true}) + look_for = input('look for: ', '', $'custom,{Complete->string()}') | redraw | echo '' + catch /Vim:Interrupt/ + TearDown() + finally + popup_setoptions(winid, {mapping: false}) + endtry + return look_for == '' ? true : popup_filter_menu(winid, "\") + endif + + return popup_filter_menu(winid, key) +enddef + +def FuzzySearch(winid: number) #{{{2 + var look_for: string = getcmdline() + if look_for == '' + DisplayNonFuzzyToc(winid) + return + endif + + # We match against *all* entries; not just the currently visible ones. + # Rationale: If we use a (fuzzy) search, we're probably lost. We don't know + # where the info is. + var matches: list> = b:toc.entries + ->copy() + ->matchfuzzypos(look_for, {key: 'text'}) + + fuzzy_entries = matches->get(0, [])->copy() + var pos: list> = matches->get(1, []) + + var text: list> + if !has('textprop') + text = matches->get(0, []) + else + var buf: number = winid->winbufnr() + if prop_type_get('help-fuzzy-toc', {bufnr: buf}) == {} + prop_type_add('help-fuzzy-toc', { + bufnr: buf, + combine: false, + highlight: 'IncSearch', + }) + endif + text = matches + ->get(0, []) + ->map((i: number, match: dict) => ({ + text: match.text, + props: pos[i]->copy()->map((_, col: number) => ({ + col: col + 1, + length: 1, + type: 'help-fuzzy-toc', + }))})) + endif + Win_execute(winid, 'normal! 1Gzt') + Popup_settext(winid, text) +enddef + +def DisplayNonFuzzyToc(winid: number) #{{{2 + fuzzy_entries = null_list + Popup_settext(winid, GetTocEntries()) +enddef + +def PrintEntry(winid: number) #{{{2 + echo GetTocEntries()[line('.', winid) - 1]['text'] +enddef + +def CollapseOrExpand(winid: number, key: string) #{{{2 + # Must be saved before we reset the popup contents, so we can + # automatically select the least unexpected entry in the updated popup. + var buf_lnum: number = GetBufLnum(winid) + + # find the nearest lower level for which the contents of the TOC changes + if key == 'H' + while b:toc.curlvl > 1 + var old: list> = GetTocEntries() + --b:toc.curlvl + var new: list> = GetTocEntries() + # In `:help`, there are only entries in levels 3. + # We don't want to collapse to level 2, nor 1. + # It would clear the TOC which is confusing. + if new->empty() + ++b:toc.curlvl + break + endif + var did_change: bool = new != old + if did_change || b:toc.curlvl == 1 + break + endif + endwhile + # find the nearest upper level for which the contents of the TOC changes + else + while b:toc.curlvl < b:toc.maxlvl + var old: list> = GetTocEntries() + ++b:toc.curlvl + var did_change: bool = GetTocEntries() != old + if did_change || b:toc.curlvl == b:toc.maxlvl + break + endif + endwhile + endif + + # update the popup contents + var toc_entries: list> = GetTocEntries() + Popup_settext(winid, toc_entries) + + # Try to select the same entry; if it's no longer visible, select its + # direct parent. + var toc_lnum: number = 0 + for entry: dict in toc_entries + if entry.lnum > buf_lnum + break + endif + ++toc_lnum + endfor + Win_execute(winid, $'normal! {toc_lnum ?? 1}Gzz') +enddef + +def MatchDelete() #{{{2 + if selected_entry_match == 0 + return + endif + + selected_entry_match->matchdelete() + selected_entry_match = 0 +enddef + +def Callback(winid: number, choice: number) #{{{2 + MatchDelete() + + if help_winid != 0 + help_winid->popup_close() + help_winid = 0 + endif + + if choice == -1 + fuzzy_entries = null_list + return + endif + + var lnum: number = GetTocEntries() + ->get(choice - 1, {}) + ->get('lnum') + + fuzzy_entries = null_list + + if lnum == 0 + return + endif + + cursor(lnum, 1) + normal! zvzt +enddef + +def ToggleHelp(menu_winid: number) #{{{2 + if help_winid == 0 + var height: number = [HELP_TEXT->len(), winheight(0) * 2 / 3]->min() + var longest_line: number = HELP_TEXT + ->copy() + ->map((_, line: string) => line->strcharlen()) + ->max() + var width: number = [longest_line, winwidth(0) * 2 / 3]->min() + var pos: dict = popup_getpos(menu_winid) + var [line: number, col: number] = [pos.line, pos.col] + --col + var zindex: number = popup_getoptions(menu_winid).zindex + ++zindex + help_winid = HELP_TEXT->popup_create({ + line: line, + col: col, + pos: 'topright', + minheight: height, + maxheight: height, + minwidth: width, + maxwidth: width, + border: [], + borderchars: ['─', '│', '─', '│', '┌', '┐', '┘', '└'], + highlight: &buftype == 'terminal' ? 'Terminal' : 'Normal', + scrollbar: false, + zindex: zindex, + }) + + setwinvar(help_winid, '&cursorline', true) + setwinvar(help_winid, '&linebreak', true) + matchadd('Special', '^<\S\+\|^\S\{,2} \@=', 0, -1, {window: help_winid}) + matchadd('Number', '\d\+', 0, -1, {window: help_winid}) + for lnum: number in HELP_TEXT->len()->range() + if HELP_TEXT[lnum] =~ '^─\+$' + matchaddpos('Title', [lnum], 0, -1, {window: help_winid}) + endif + endfor + + else + if IsVisible(help_winid) + popup_hide(help_winid) + else + popup_show(help_winid) + endif + endif +enddef + +def Win_execute(winid: number, cmd: any) #{{{2 +# wrapper around `win_execute()` to enforce a redraw, which might be necessary +# whenever we change the cursor position + win_execute(winid, cmd) + redraw +enddef + +def TearDown() #{{{2 + autocmd_delete([{group: AUGROUP}]) + cunmap + cunmap + cunmap + cunmap +enddef +#}}}1 +# Util {{{1 +def GetType(): string #{{{2 + return &buftype == 'terminal' ? 'terminal' : &filetype +enddef + +def GetTocEntries(): list> #{{{2 + return fuzzy_entries ?? b:toc.entries + ->copy() + ->filter((_, entry: dict): bool => entry.lvl <= b:toc.curlvl) +enddef + +def GetBufLnum(winid: number): number #{{{2 + var toc_lnum: number = line('.', winid) + return GetTocEntries() + ->get(toc_lnum - 1, {}) + ->get('lnum') +enddef + +def IsVisible(win: number): bool #{{{2 + return win->popup_getpos()->get('visible') +enddef + +def IsSpecialHelpLine(line: string): bool #{{{2 + return line =~ '^[<>]\=\s*$' + || line =~ '^\s*\*' + || line =~ HELP_RULER + || line =~ HELP_HEADLINE +enddef + +def Complete(..._): string #{{{2 + return b:toc.entries + ->copy() + ->map((_, entry: dict) => entry.text->trim(' ~')->substitute('*', '', 'g')) + ->filter((_, text: string): bool => text =~ '^[-a-zA-Z0-9_() ]\+$') + ->sort() + ->uniq() + ->join("\n") +enddef + diff --git a/usr/share/vim/vim91/pack/dist/opt/helptoc/plugin/helptoc.vim b/usr/share/vim/vim91/pack/dist/opt/helptoc/plugin/helptoc.vim new file mode 100644 index 00000000000..4fb3bc393dc --- /dev/null +++ b/usr/share/vim/vim91/pack/dist/opt/helptoc/plugin/helptoc.vim @@ -0,0 +1,5 @@ +vim9script noclear + +import autoload '../autoload/helptoc.vim' + +command -bar HelpToc helptoc.Open() diff --git a/usr/share/vim/vim91/pack/dist/opt/termdebug/plugin/termdebug.vim b/usr/share/vim/vim91/pack/dist/opt/termdebug/plugin/termdebug.vim index 377827e8573..6f1f4b5227a 100644 --- a/usr/share/vim/vim91/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/usr/share/vim/vim91/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -121,7 +121,9 @@ var breakpoint_locations: dict var BreakpointSigns: list var evalFromBalloonExpr: bool -var evalFromBalloonExprResult: string +var evalInPopup: bool +var evalPopupId: number +var evalExprResult: string var ignoreEvalError: bool var evalexpr: string # Remember the old value of 'signcolumn' for each buffer that it's set in, so @@ -202,7 +204,9 @@ def InitScriptVariables() BreakpointSigns = [] evalFromBalloonExpr = false - evalFromBalloonExprResult = '' + evalInPopup = false + evalPopupId = -1 + evalExprResult = '' ignoreEvalError = false evalexpr = '' # Remember the old value of 'signcolumn' for each buffer that it's set in, so @@ -1478,10 +1482,23 @@ def SendEval(expr: string) evalexpr = exprLHS enddef +# Returns whether to evaluate in a popup or not, defaults to false. +def EvaluateInPopup(): bool + if exists('g:termdebug_config') + return get(g:termdebug_config, 'evaluate_in_popup', false) + endif + return false +enddef + # :Evaluate - evaluate what is specified / under the cursor def Evaluate(range: number, arg: string) var expr = GetEvaluationExpression(range, arg) - echom $"expr: {expr}" + if EvaluateInPopup() + evalInPopup = true + evalExprResult = '' + else + echomsg $'expr: {expr}' + endif ignoreEvalError = false SendEval(expr) enddef @@ -1541,6 +1558,37 @@ def Balloon_show(expr: string) endif enddef +def Popup_format(expr: string): list + var lines = expr + ->substitute('{', '{\n', 'g') + ->substitute('}', '\n}', 'g') + ->substitute(',', ',\n', 'g') + ->split('\n') + var indentation = 0 + var formatted_lines = [] + for line in lines + var stripped = line->substitute('^\s\+', '', '') + if stripped =~ '^}' + indentation -= 2 + endif + formatted_lines->add(repeat(' ', indentation) .. stripped) + if stripped =~ '{$' + indentation += 2 + endif + endfor + return formatted_lines +enddef + +def Popup_show(expr: string) + var formatted = Popup_format(expr) + if evalPopupId != -1 + popup_close(evalPopupId) + endif + # Specifying the line is necessary, as the winbar seems to cause issues + # otherwise. I.e., the popup would be shown one line too high. + evalPopupId = popup_atcursor(formatted, {'line': 'cursor-1'}) +enddef + def HandleEvaluate(msg: string) var value = msg ->substitute('.*value="\(.*\)"', '\1', '') @@ -1555,13 +1603,12 @@ def HandleEvaluate(msg: string) #\ ->substitute('\\0x00', NullRep, 'g') #\ ->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g') ->substitute(NullRepl, '\\000', 'g') - if evalFromBalloonExpr - if empty(evalFromBalloonExprResult) - evalFromBalloonExprResult = $'{evalexpr}: {value}' + if evalFromBalloonExpr || evalInPopup + if empty(evalExprResult) + evalExprResult = $'{evalexpr}: {value}' else - evalFromBalloonExprResult ..= $' = {value}' + evalExprResult ..= $' = {value}' endif - Balloon_show(evalFromBalloonExprResult) else echomsg $'"{evalexpr}": {value}' endif @@ -1570,8 +1617,12 @@ def HandleEvaluate(msg: string) # Looks like a pointer, also display what it points to. ignoreEvalError = true SendEval($'*{evalexpr}') - else + elseif evalFromBalloonExpr + Balloon_show(evalExprResult) evalFromBalloonExpr = false + elseif evalInPopup + Popup_show(evalExprResult) + evalInPopup = false endif enddef @@ -1588,7 +1639,7 @@ def TermDebugBalloonExpr(): string return '' endif evalFromBalloonExpr = true - evalFromBalloonExprResult = '' + evalExprResult = '' ignoreEvalError = true var expr = CleanupExpr(v:beval_text) SendEval(expr) @@ -1861,6 +1912,11 @@ def CreateBreakpoint(id: number, subid: number, enabled: string) var label = '' if exists('g:termdebug_config') && has_key(g:termdebug_config, 'sign') label = g:termdebug_config['sign'] + elseif exists('g:termdebug_config') && has_key(g:termdebug_config, 'sign_decimal') + label = printf('%02d', id) + if id > 99 + label = '9+' + endif else label = printf('%02X', id) if id > 255 diff --git a/usr/share/vim/vim91/plugin/matchparen.vim b/usr/share/vim/vim91/plugin/matchparen.vim index 2899612dce5..661a34b578e 100644 --- a/usr/share/vim/vim91/plugin/matchparen.vim +++ b/usr/share/vim/vim91/plugin/matchparen.vim @@ -17,6 +17,9 @@ endif if !exists("g:matchparen_insert_timeout") let g:matchparen_insert_timeout = 60 endif +if !exists("g:matchparen_disable_cursor_hl") + let g:matchparen_disable_cursor_hl = 0 +endif let s:has_matchaddpos = exists('*matchaddpos') @@ -189,10 +192,18 @@ func s:Highlight_Matching_Pair() " If a match is found setup match highlighting. if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom if s:has_matchaddpos - call add(w:matchparen_ids, matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10)) + if !g:matchparen_disable_cursor_hl + call add(w:matchparen_ids, matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10)) + else + call add(w:matchparen_ids, matchaddpos('MatchParen', [[m_lnum, m_col]], 10)) + endif else - exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . - \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + if !g:matchparen_disable_cursor_hl + exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . + \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + else + exe '3match MatchParen /\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + endif call add(w:matchparen_ids, 3) endif let w:paren_hl_on = 1 diff --git a/usr/share/vim/vim91/plugin/netrwPlugin.vim b/usr/share/vim/vim91/plugin/netrwPlugin.vim index c70e6518fff..775b650e719 100644 --- a/usr/share/vim/vim91/plugin/netrwPlugin.vim +++ b/usr/share/vim/vim91/plugin/netrwPlugin.vim @@ -1,9 +1,12 @@ " netrwPlugin.vim: Handles file transfer and remote directory listing across a network " PLUGIN SECTION " Maintainer: This runtime file is looking for a new maintainer. -" Date: Feb 09, 2021 +" Date: Sep 09, 2021 " Last Change: " 2024 May 08 by Vim Project: cleanup legacy Win9X checks +" 2024 Oct 27 by Vim Project: cleanup gx mapping +" 2024 Oct 28 by Vim Project: further improvements +" 2024 Oct 31 by Vim Project: use autoloaded functions " Former Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim " Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{1 @@ -31,6 +34,10 @@ set cpo&vim " --------------------------------------------------------------------- " Public Interface: {{{1 +" Commands Launch/URL {{{2 +command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim()) +command -complete=file -nargs=1 Open call netrw#Open(trim()) +" " }}} " Local Browsing Autocmds: {{{2 augroup FileExplorer au! diff --git a/usr/share/vim/vim91/plugin/tutor.vim b/usr/share/vim/vim91/plugin/tutor.vim new file mode 100644 index 00000000000..1411b1ac633 --- /dev/null +++ b/usr/share/vim/vim91/plugin/tutor.vim @@ -0,0 +1,6 @@ +if exists('g:loaded_tutor_mode_plugin') || &compatible + finish +endif +let g:loaded_tutor_mode_plugin = 1 + +command! -nargs=? -complete=custom,tutor#TutorCmdComplete Tutor call tutor#TutorCmd() diff --git a/usr/share/vim/vim91/syntax/2html.vim b/usr/share/vim/vim91/syntax/2html.vim index f3ce8bed8d7..ca40810e805 100644 --- a/usr/share/vim/vim91/syntax/2html.vim +++ b/usr/share/vim/vim91/syntax/2html.vim @@ -1,6 +1,6 @@ " Vim syntax support file " Maintainer: Ben Fritz -" Last Change: 2023 Sep 05 +" Last Change: 2024 Nov 02 " " Additional contributors: " @@ -1843,6 +1843,10 @@ if s:settings.use_css && !s:settings.no_doc " default font size for different elements call append('.', '* { font-size: 1em; }') + + " use color scheme styles for links + " browser-default blue/purple colors for links don't look like the existing theme and are unreadable on dark backgrounds + call append('.', 'a { color: inherit; }') + + " if we use any input elements for unselectable content, make sure they look " like normal text if !empty(s:settings.prevent_copy) diff --git a/usr/share/vim/vim91/syntax/8th.vim b/usr/share/vim/vim91/syntax/8th.vim index a88a5a294a1..e53c185df1c 100644 --- a/usr/share/vim/vim91/syntax/8th.vim +++ b/usr/share/vim/vim91/syntax/8th.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: 8th -" Version: 23.09.01 -" Last Change: 2023 Dec 19 +" Version: 24.08 +" Last Change: 2024 Nov 07 " Maintainer: Ron Aaron " URL: https://8th-dev.com/ " Filetypes: *.8th @@ -36,16 +36,16 @@ com! -nargs=+ Builtin syn keyword eighthBuiltin Builtin gen-secret 2fa:gen-secret gen-url 2fa:gen-url validate-code 2fa:validate-code cb AWS:cb cli AWS:cli -Builtin cmd AWS:cmd cp AWS:cp rc AWS:rc call DBUS:call init DBUS:init + DOM:+ - DOM:- attr! DOM:attr! -Builtin attr@ DOM:attr@ attrs DOM:attrs children DOM:children css-parse DOM:css-parse each DOM:each -Builtin find DOM:find new DOM:new type DOM:type ! G:! !if G:!if #! G:#! ## G:## #if G:#if ' G:' ( G:( -Builtin (* G:(* (:) G:(:) (code) G:(code) (defer) G:(defer) (dump) G:(dump) (getc) G:(getc) (gets) G:(gets) +Builtin cmd AWS:cmd cp AWS:cp rc AWS:rc LIBS DBUS:LIBS call DBUS:call init DBUS:init + DOM:+ - DOM:- +Builtin attr! DOM:attr! attr@ DOM:attr@ attrs DOM:attrs children DOM:children css-parse DOM:css-parse +Builtin each DOM:each find DOM:find new DOM:new type DOM:type ! G:! !if G:!if #! G:#! ## G:## #if G:#if +Builtin ' G:' ( G:( (:) G:(:) (code) G:(code) (defer) G:(defer) (dump) G:(dump) (getc) G:(getc) (gets) G:(gets) Builtin (interp) G:(interp) (log) G:(log) (needs) G:(needs) (parseln) G:(parseln) (putc) G:(putc) (puts) G:(puts) -Builtin (stat) G:(stat) (with) G:(with) ) G:) +hook G:+hook +ref G:+ref ,# G:,# -- G:-- -----BEGIN G:-----BEGIN +Builtin (stat) G:(stat) (with) G:(with) ) G:) +hook G:+hook +ref G:+ref ,# G:,# -----BEGIN G:-----BEGIN Builtin -Inf G:-Inf -Inf? G:-Inf? -hook G:-hook -ref G:-ref -rot G:-rot . G:. .# G:.# .hook G:.hook Builtin .needs G:.needs .r G:.r .s G:.s .s-truncate G:.s-truncate .stats G:.stats .ver G:.ver .with G:.with Builtin 0; G:0; 2dip G:2dip 2drop G:2drop 2dup G:2dup 2nip G:2nip 2over G:2over 2swap G:2swap 2tuck G:2tuck -Builtin 3drop G:3drop 3drop G:3drop 3dup G:3dup 3rev G:3rev 4drop G:4drop 8thdt? G:8thdt? 8thsku G:8thsku +Builtin 3drop G:3drop 3drop G:3drop 3dup G:3dup 3rev G:3rev 4drop G:4drop 8thdt? G:8thdt? 8thsku? G:8thsku? Builtin 8thver? G:8thver? 8thvernum? G:8thvernum? : G:: ; G:; ;; G:;; ;;; G:;;; ;with G:;with >clip G:>clip Builtin >json G:>json >kind G:>kind >n G:>n >r G:>r >s G:>s ?: G:?: ?@ G:?@ @ G:@ BITMAP: G:BITMAP: Builtin ENUM: G:ENUM: FLAG: G:FLAG: I G:I Inf G:Inf Inf? G:Inf? J G:J K G:K NaN G:NaN NaN? G:NaN? SED-CHECK G:SED-CHECK @@ -59,16 +59,17 @@ Builtin counting-allocations G:counting-allocations cr G:cr critical: G:critica Builtin curlang G:curlang curry G:curry curry: G:curry: decimal G:decimal default: G:default: defer: G:defer: Builtin deferred: G:deferred: deg>rad G:deg>rad depth G:depth die G:die dip G:dip drop G:drop dstack G:dstack Builtin dump G:dump dup G:dup dup>r G:dup>r dup? G:dup? e# G:e# enum: G:enum: error? G:error? eval G:eval -Builtin eval! G:eval! eval0 G:eval0 expect G:expect extra! G:extra! extra@ G:extra@ false G:false fnv G:fnv -Builtin fourth G:fourth free G:free func: G:func: getc G:getc getcwd G:getcwd getenv G:getenv gets G:gets -Builtin handler G:handler header G:header help G:help hex G:hex i: G:i: i; G:i; isa? G:isa? items-used G:items-used -Builtin jcall G:jcall jclass G:jclass jmethod G:jmethod json! G:json! json-8th> G:json-8th> json-nesting G:json-nesting -Builtin json-pretty G:json-pretty json-throw G:json-throw json> G:json> json@ G:json@ k32 G:k32 keep G:keep -Builtin l: G:l: last G:last lib G:lib libbin G:libbin libc G:libc literal G:literal locals: G:locals: -Builtin lock G:lock lock-to G:lock-to locked? G:locked? log G:log log-syslog G:log-syslog log-task G:log-task -Builtin log-time G:log-time log-time-local G:log-time-local long-days G:long-days long-months G:long-months -Builtin longjmp G:longjmp lookup G:lookup loop G:loop loop- G:loop- map? G:map? mark G:mark mark? G:mark? -Builtin mobile? G:mobile? n# G:n# name>os G:name>os name>sem G:name>sem ndrop G:ndrop needs G:needs +Builtin eval! G:eval! eval0 G:eval0 exit G:exit expect G:expect extra! G:extra! extra@ G:extra@ false G:false +Builtin fnv G:fnv fourth G:fourth free G:free func: G:func: getc G:getc getcwd G:getcwd getenv G:getenv +Builtin gets G:gets goto G:goto handler G:handler header G:header help G:help help_db G:help_db here G:here +Builtin hex G:hex i: G:i: i; G:i; isa? G:isa? items-used G:items-used jcall G:jcall jclass G:jclass +Builtin jmethod G:jmethod json! G:json! json-8th> G:json-8th> json-nesting G:json-nesting json-pretty G:json-pretty +Builtin json-throw G:json-throw json> G:json> json@ G:json@ k32 G:k32 keep G:keep l: G:l: last G:last +Builtin lib G:lib libbin G:libbin libc G:libc libimg G:libimg literal G:literal locals: G:locals: lock G:lock +Builtin lock-to G:lock-to locked? G:locked? log G:log log-syslog G:log-syslog log-task G:log-task log-time G:log-time +Builtin log-time-local G:log-time-local long-days G:long-days long-months G:long-months longjmp G:longjmp +Builtin lookup G:lookup loop G:loop loop- G:loop- map? G:map? mark G:mark mark? G:mark? mobile? G:mobile? +Builtin n# G:n# name>os G:name>os name>sem G:name>sem ndrop G:ndrop needs G:needs needs-throws G:needs-throws Builtin new G:new next-arg G:next-arg nip G:nip noop G:noop not G:not nothrow G:nothrow ns G:ns ns: G:ns: Builtin ns>ls G:ns>ls ns>s G:ns>s ns? G:ns? null G:null null; G:null; null? G:null? nullvar G:nullvar Builtin number? G:number? of: G:of: off G:off on G:on onexit G:onexit only G:only op! G:op! or G:or @@ -76,128 +77,132 @@ Builtin os G:os os-names G:os-names os>long-name G:os>long-name os>name G:os>na Builtin pack G:pack parse G:parse parse-csv G:parse-csv parse-date G:parse-date parsech G:parsech parseln G:parseln Builtin parsews G:parsews pick G:pick poke G:poke pool-clear G:pool-clear pool-clear-all G:pool-clear-all Builtin prior G:prior private G:private process-args G:process-args process-args-fancy G:process-args-fancy -Builtin process-args-help G:process-args-help process-args-vars G:process-args-vars prompt G:prompt -Builtin public G:public putc G:putc puts G:puts quote G:quote r! G:r! r> G:r> r@ G:r@ rad>deg G:rad>deg -Builtin rand-jit G:rand-jit rand-jsf G:rand-jsf rand-native G:rand-native rand-normal G:rand-normal -Builtin rand-pcg G:rand-pcg rand-pcg-seed G:rand-pcg-seed rand-range G:rand-range rand-select G:rand-select -Builtin randbuf-pcg G:randbuf-pcg random G:random rdrop G:rdrop recurse G:recurse recurse-stack G:recurse-stack -Builtin ref@ G:ref@ reg! G:reg! reg@ G:reg@ regbin@ G:regbin@ remaining-args G:remaining-args repeat G:repeat -Builtin required? G:required? requires G:requires reset G:reset roll G:roll rop! G:rop! rot G:rot rpick G:rpick -Builtin rreset G:rreset rroll G:rroll rstack G:rstack rswap G:rswap rusage G:rusage s>ns G:s>ns same? G:same? -Builtin scriptdir G:scriptdir scriptfile G:scriptfile sem G:sem sem-post G:sem-post sem-rm G:sem-rm -Builtin sem-wait G:sem-wait sem-wait? G:sem-wait? sem>name G:sem>name semi-throw G:semi-throw set-wipe G:set-wipe -Builtin setenv G:setenv setjmp G:setjmp settings! G:settings! settings![] G:settings![] settings@ G:settings@ -Builtin settings@? G:settings@? settings@[] G:settings@[] sh G:sh sh$ G:sh$ short-days G:short-days -Builtin short-months G:short-months sleep G:sleep sleep-msec G:sleep-msec sleep-until G:sleep-until -Builtin slog G:slog space G:space stack-check G:stack-check stack-size G:stack-size step G:step sthrow G:sthrow -Builtin string? G:string? struct: G:struct: swap G:swap tab-hook G:tab-hook tell-conflict G:tell-conflict -Builtin tempdir G:tempdir tempfilename G:tempfilename third G:third throw G:throw thrownull G:thrownull -Builtin times G:times tlog G:tlog tri G:tri true G:true tuck G:tuck type-check G:type-check typeassert G:typeassert -Builtin uid G:uid uname G:uname unlock G:unlock unpack G:unpack until G:until until! G:until! while G:while -Builtin while! G:while! with: G:with: word? G:word? words G:words words-like G:words-like words/ G:words/ -Builtin xchg G:xchg xor G:xor >auth HTTP:>auth (curry) I:(curry) notimpl I:notimpl sh I:sh trace-word I:trace-word -Builtin call JSONRPC:call auth-string OAuth:auth-string gen-nonce OAuth:gen-nonce params OAuth:params -Builtin call SOAP:call ! a:! + a:+ - a:- / a:/ 2each a:2each 2map a:2map 2map+ a:2map+ 2map= a:2map= -Builtin <> a:<> = a:= @ a:@ @? a:@? _@ a:_@ all a:all any a:any bsearch a:bsearch centroid a:centroid -Builtin clear a:clear close a:close cmp a:cmp diff a:diff dot a:dot each a:each each! a:each! each-par a:each-par -Builtin each-slice a:each-slice exists? a:exists? filter a:filter filter-par a:filter-par generate a:generate -Builtin group a:group indexof a:indexof insert a:insert intersect a:intersect join a:join len a:len -Builtin map a:map map+ a:map+ map-par a:map-par map= a:map= maxlen a:maxlen mean a:mean mean&variance a:mean&variance -Builtin merge a:merge new a:new op! a:op! open a:open pigeon a:pigeon pivot a:pivot pop a:pop push a:push +Builtin process-args-help G:process-args-help prompt G:prompt public G:public putc G:putc puts G:puts +Builtin quote G:quote r! G:r! r> G:r> r@ G:r@ rad>deg G:rad>deg rand-jit G:rand-jit rand-jsf G:rand-jsf +Builtin rand-native G:rand-native rand-normal G:rand-normal rand-pcg G:rand-pcg rand-pcg-seed G:rand-pcg-seed +Builtin rand-range G:rand-range rand-select G:rand-select randbuf-pcg G:randbuf-pcg random G:random +Builtin rdrop G:rdrop recurse G:recurse recurse-stack G:recurse-stack ref@ G:ref@ reg! G:reg! reg@ G:reg@ +Builtin regbin@ G:regbin@ remaining-args G:remaining-args repeat G:repeat requires G:requires reset G:reset +Builtin roll G:roll rop! G:rop! rot G:rot rpick G:rpick rreset G:rreset rroll G:rroll rstack G:rstack +Builtin rswap G:rswap rusage G:rusage s>ns G:s>ns same? G:same? scriptdir G:scriptdir scriptfile G:scriptfile +Builtin sem G:sem sem-post G:sem-post sem-rm G:sem-rm sem-wait G:sem-wait sem-wait? G:sem-wait? sem>name G:sem>name +Builtin semi-throw G:semi-throw set-wipe G:set-wipe setenv G:setenv setjmp G:setjmp settings! G:settings! +Builtin settings![] G:settings![] settings@ G:settings@ settings@? G:settings@? settings@[] G:settings@[] +Builtin sh G:sh sh$ G:sh$ short-days G:short-days short-months G:short-months sleep G:sleep sleep-msec G:sleep-msec +Builtin sleep-until G:sleep-until slog G:slog space G:space stack-check G:stack-check stack-size G:stack-size +Builtin step G:step sthrow G:sthrow string? G:string? struct: G:struct: swap G:swap tab-hook G:tab-hook +Builtin tell-conflict G:tell-conflict tempdir G:tempdir tempfilename G:tempfilename third G:third throw G:throw +Builtin thrownull G:thrownull times G:times tlog G:tlog toggle G:toggle tri G:tri true G:true tuck G:tuck +Builtin type-check G:type-check typeassert G:typeassert uid G:uid uname G:uname unlock G:unlock unpack G:unpack +Builtin until G:until until! G:until! while G:while while! G:while! with: G:with: word? G:word? words G:words +Builtin words-like G:words-like words/ G:words/ xchg G:xchg xor G:xor >auth HTTP:>auth (curry) I:(curry) +Builtin appopts I:appopts notimpl I:notimpl sh I:sh trace-word I:trace-word call JSONRPC:call auth-string OAuth:auth-string +Builtin gen-nonce OAuth:gen-nonce params OAuth:params call SOAP:call ! a:! + a:+ - a:- / a:/ 2each a:2each +Builtin 2len a:2len 2map a:2map 2map+ a:2map+ 2map= a:2map= <> a:<> = a:= @ a:@ @? a:@? _@ a:_@ _len a:_len +Builtin all a:all any a:any bsearch a:bsearch centroid a:centroid clear a:clear close a:close cmp a:cmp +Builtin diff a:diff dot a:dot each a:each each! a:each! each-par a:each-par each-slice a:each-slice +Builtin exists? a:exists? filter a:filter filter-par a:filter-par generate a:generate group a:group +Builtin indexof a:indexof insert a:insert intersect a:intersect join a:join len a:len map a:map map+ a:map+ +Builtin map-par a:map-par map= a:map= maxlen a:maxlen mean a:mean mean&variance a:mean&variance merge a:merge +Builtin new a:new op! a:op! open a:open pigeon a:pigeon pivot a:pivot pop a:pop push a:push push' a:push' Builtin qsort a:qsort randeach a:randeach reduce a:reduce reduce+ a:reduce+ remove a:remove rev a:rev Builtin rindexof a:rindexof shift a:shift shuffle a:shuffle slice a:slice slice+ a:slice+ slide a:slide Builtin smear a:smear sort a:sort split a:split squash a:squash switch a:switch union a:union uniq a:uniq Builtin unzip a:unzip x a:x x-each a:x-each xchg a:xchg y a:y zip a:zip 8thdir app:8thdir asset app:asset Builtin atrun app:atrun atrun app:atrun atrun app:atrun basedir app:basedir basename app:basename config-file-name app:config-file-name Builtin current app:current datadir app:datadir display-moved app:display-moved exename app:exename -Builtin localechanged app:localechanged lowmem app:lowmem main app:main name app:name oncrash app:oncrash -Builtin opts! app:opts! opts@ app:opts@ orientation app:orientation orientation! app:orientation! pid app:pid -Builtin post-main app:post-main pre-main app:pre-main privdir app:privdir raise app:raise read-config app:read-config -Builtin read-config-map app:read-config-map read-config-var app:read-config-var request-perm app:request-perm -Builtin restart app:restart resumed app:resumed signal app:signal standalone app:standalone subdir app:subdir -Builtin suspended app:suspended sysquit app:sysquit terminated app:terminated timeout app:timeout trap app:trap -Builtin dawn astro:dawn do-dawn astro:do-dawn do-dusk astro:do-dusk do-rise astro:do-rise dusk astro:dusk -Builtin latitude astro:latitude location! astro:location! longitude astro:longitude sunrise astro:sunrise -Builtin genkeys auth:genkeys secret auth:secret session-id auth:session-id session-key auth:session-key +Builtin localechanged app:localechanged lowmem app:lowmem main app:main name app:name onback app:onback +Builtin oncrash app:oncrash opts! app:opts! opts@ app:opts@ orientation app:orientation orientation! app:orientation! +Builtin pid app:pid post-main app:post-main pre-main app:pre-main privdir app:privdir raise app:raise +Builtin read-config app:read-config read-config-map app:read-config-map read-config-var app:read-config-var +Builtin request-perm app:request-perm restart app:restart resumed app:resumed signal app:signal standalone app:standalone +Builtin standalone! app:standalone! subdir app:subdir suspended app:suspended sysquit app:sysquit terminated app:terminated +Builtin ticks app:ticks timeout app:timeout trap app:trap dawn astro:dawn do-dawn astro:do-dawn do-dusk astro:do-dusk +Builtin do-rise astro:do-rise dusk astro:dusk latitude astro:latitude location! astro:location! longitude astro:longitude +Builtin sunrise astro:sunrise genkeys auth:genkeys secret auth:secret session-id auth:session-id session-key auth:session-key Builtin validate auth:validate ! b:! + b:+ / b:/ 1+ b:1+ 1- b:1- <> b:<> = b:= >base16 b:>base16 >base32 b:>base32 -Builtin >base64 b:>base64 >base85 b:>base85 >hex b:>hex >mpack b:>mpack @ b:@ append b:append base16> b:base16> -Builtin base32> b:base32> base64> b:base64> base85> b:base85> bit! b:bit! bit@ b:bit@ clear b:clear -Builtin compress b:compress conv b:conv each b:each each! b:each! each-slice b:each-slice expand b:expand -Builtin fill b:fill getb b:getb hex> b:hex> len b:len mem> b:mem> move b:move mpack-compat b:mpack-compat +Builtin >base64 b:>base64 >base85 b:>base85 >hex b:>hex >mpack b:>mpack @ b:@ ICONVLIBS b:ICONVLIBS +Builtin append b:append base16> b:base16> base32> b:base32> base64> b:base64> base85> b:base85> bit! b:bit! +Builtin bit@ b:bit@ clear b:clear compress b:compress conv b:conv each b:each each! b:each! each-slice b:each-slice +Builtin expand b:expand fill b:fill getb b:getb hex> b:hex> len b:len mem> b:mem> move b:move mpack-compat b:mpack-compat Builtin mpack-date b:mpack-date mpack-ignore b:mpack-ignore mpack> b:mpack> n! b:n! n+ b:n+ n@ b:n@ Builtin new b:new op b:op op! b:op! pad b:pad rev b:rev search b:search shmem b:shmem slice b:slice Builtin splice b:splice ungetb b:ungetb unpad b:unpad writable b:writable xor b:xor +block bc:+block Builtin .blocks bc:.blocks add-block bc:add-block block-hash bc:block-hash block@ bc:block@ first-block bc:first-block Builtin hash bc:hash last-block bc:last-block load bc:load new bc:new save bc:save set-sql bc:set-sql Builtin validate bc:validate validate-block bc:validate-block add bloom:add filter bloom:filter in? bloom:in? -Builtin parse bson:parse accept bt:accept ch! bt:ch! ch@ bt:ch@ connect bt:connect disconnect bt:disconnect +Builtin parse bson:parse LIBS bt:LIBS accept bt:accept ch! bt:ch! ch@ bt:ch@ connect bt:connect disconnect bt:disconnect Builtin init bt:init leconnect bt:leconnect lescan bt:lescan listen bt:listen on? bt:on? read bt:read Builtin scan bt:scan service? bt:service? services? bt:services? write bt:write * c:* * c:* + c:+ + c:+ -Builtin = c:= = c:= >ri c:>ri >ri c:>ri abs c:abs abs c:abs arg c:arg arg c:arg conj c:conj conj c:conj -Builtin im c:im n> c:n> new c:new new c:new re c:re (.hebrew) cal:(.hebrew) (.islamic) cal:(.islamic) -Builtin .hebrew cal:.hebrew .islamic cal:.islamic >hebepoch cal:>hebepoch >jdn cal:>jdn Adar cal:Adar -Builtin Adar2 cal:Adar2 Adar2 cal:Adar2 Av cal:Av Elul cal:Elul Heshvan cal:Heshvan Iyar cal:Iyar Kislev cal:Kislev -Builtin Nissan cal:Nissan Shevat cal:Shevat Sivan cal:Sivan Tammuz cal:Tammuz Tevet cal:Tevet Tishrei cal:Tishrei -Builtin days-in-hebrew-year cal:days-in-hebrew-year displaying-hebrew cal:displaying-hebrew fixed>hebrew cal:fixed>hebrew -Builtin fixed>islamic cal:fixed>islamic gershayim cal:gershayim hanukkah cal:hanukkah hebrew-epoch cal:hebrew-epoch -Builtin hebrew>fixed cal:hebrew>fixed hebrewtoday cal:hebrewtoday hmonth-name cal:hmonth-name islamic.epoch cal:islamic.epoch -Builtin islamic>fixed cal:islamic>fixed islamictoday cal:islamictoday jdn> cal:jdn> last-day-of-hebrew-month cal:last-day-of-hebrew-month +Builtin = c:= = c:= >polar c:>polar >polar c:>polar >ri c:>ri >ri c:>ri ^ c:^ ^ c:^ abs c:abs abs c:abs +Builtin arg c:arg arg c:arg conj c:conj conj c:conj im c:im im c:im log c:log log c:log n> c:n> n> c:n> +Builtin new c:new new c:new polar> c:polar> polar> c:polar> re c:re re c:re (.hebrew) cal:(.hebrew) +Builtin (.islamic) cal:(.islamic) .hebrew cal:.hebrew .islamic cal:.islamic >hebepoch cal:>hebepoch +Builtin >jdn cal:>jdn Adar cal:Adar Adar2 cal:Adar2 Av cal:Av Elul cal:Elul Heshvan cal:Heshvan Iyar cal:Iyar +Builtin Kislev cal:Kislev Nissan cal:Nissan Shevat cal:Shevat Sivan cal:Sivan Tammuz cal:Tammuz Tevet cal:Tevet +Builtin Tishrei cal:Tishrei days-in-hebrew-year cal:days-in-hebrew-year displaying-hebrew cal:displaying-hebrew +Builtin fixed>hebrew cal:fixed>hebrew fixed>islamic cal:fixed>islamic gershayim cal:gershayim hanukkah cal:hanukkah +Builtin hebrew-epoch cal:hebrew-epoch hebrew-leap-year? cal:hebrew-leap-year? hebrew>fixed cal:hebrew>fixed +Builtin hebrewtoday cal:hebrewtoday hmonth-name cal:hmonth-name islamic.epoch cal:islamic.epoch islamic>fixed cal:islamic>fixed +Builtin islamictoday cal:islamictoday jdn> cal:jdn> last-day-of-hebrew-month cal:last-day-of-hebrew-month Builtin number>hebrew cal:number>hebrew omer cal:omer pesach cal:pesach purim cal:purim rosh-chodesh? cal:rosh-chodesh? Builtin rosh-hashanah cal:rosh-hashanah shavuot cal:shavuot taanit-esther cal:taanit-esther tisha-beav cal:tisha-beav -Builtin yom-haatsmaut cal:yom-haatsmaut yom-kippur cal:yom-kippur >redir con:>redir accept con:accept -Builtin accept-nl con:accept-nl accept-pwd con:accept-pwd alert con:alert ansi? con:ansi? black con:black -Builtin blue con:blue clreol con:clreol cls con:cls ctrld-empty con:ctrld-empty cyan con:cyan down con:down -Builtin file>history con:file>history free con:free getxy con:getxy gotoxy con:gotoxy green con:green -Builtin history-handler con:history-handler history>file con:history>file key con:key key? con:key? -Builtin left con:left load-history con:load-history magenta con:magenta max-history con:max-history -Builtin onBlack con:onBlack onBlue con:onBlue onCyan con:onCyan onGreen con:onGreen onMagenta con:onMagenta -Builtin onRed con:onRed onWhite con:onWhite onYellow con:onYellow print con:print red con:red redir> con:redir> -Builtin redir? con:redir? right con:right save-history con:save-history size? con:size? up con:up white con:white -Builtin yellow con:yellow >aes128gcm cr:>aes128gcm >aes256gcm cr:>aes256gcm >cp cr:>cp >cpe cr:>cpe -Builtin >decrypt cr:>decrypt >edbox cr:>edbox >encrypt cr:>encrypt >nbuf cr:>nbuf >rsabox cr:>rsabox -Builtin >uuid cr:>uuid aad? cr:aad? aes128box-sig cr:aes128box-sig aes128gcm> cr:aes128gcm> aes256box-sig cr:aes256box-sig -Builtin aes256gcm> cr:aes256gcm> aesgcm cr:aesgcm blakehash cr:blakehash chacha20box-sig cr:chacha20box-sig -Builtin chachapoly cr:chachapoly cipher! cr:cipher! cipher@ cr:cipher@ ciphers cr:ciphers cp> cr:cp> -Builtin cpe> cr:cpe> decrypt cr:decrypt decrypt+ cr:decrypt+ decrypt> cr:decrypt> ebox-sig cr:ebox-sig -Builtin ecc-curves cr:ecc-curves ecc-genkey cr:ecc-genkey ecc-secret cr:ecc-secret ecc-sign cr:ecc-sign -Builtin ecc-verify cr:ecc-verify ed25519 cr:ed25519 ed25519-secret cr:ed25519-secret ed25519-sign cr:ed25519-sign -Builtin ed25519-verify cr:ed25519-verify edbox-sig cr:edbox-sig edbox> cr:edbox> encrypt cr:encrypt -Builtin encrypt+ cr:encrypt+ encrypt> cr:encrypt> ensurekey cr:ensurekey genkey cr:genkey hash cr:hash -Builtin hash! cr:hash! hash+ cr:hash+ hash>b cr:hash>b hash>s cr:hash>s hash@ cr:hash@ hashes cr:hashes -Builtin hmac cr:hmac hotp cr:hotp iv? cr:iv? pem-read cr:pem-read pem-write cr:pem-write pwd-valid? cr:pwd-valid? -Builtin pwd/ cr:pwd/ pwd>hash cr:pwd>hash rand cr:rand randbuf cr:randbuf randkey cr:randkey restore cr:restore -Builtin root-certs cr:root-certs rsa_decrypt cr:rsa_decrypt rsa_encrypt cr:rsa_encrypt rsa_sign cr:rsa_sign -Builtin rsa_verify cr:rsa_verify rsabox-sig cr:rsabox-sig rsabox> cr:rsabox> rsagenkey cr:rsagenkey +Builtin yom-haatsmaut cal:yom-haatsmaut yom-kippur cal:yom-kippur >hsva clr:>hsva complement clr:complement +Builtin dist clr:dist gradient clr:gradient hsva> clr:hsva> invert clr:invert nearest-name clr:nearest-name +Builtin parse clr:parse >redir con:>redir accept con:accept accept-nl con:accept-nl accept-pwd con:accept-pwd +Builtin alert con:alert ansi? con:ansi? black con:black blue con:blue clreol con:clreol cls con:cls +Builtin ctrld-empty con:ctrld-empty cyan con:cyan down con:down file>history con:file>history free con:free +Builtin getxy con:getxy gotoxy con:gotoxy green con:green history-handler con:history-handler history>file con:history>file +Builtin init con:init key con:key key? con:key? left con:left load-history con:load-history magenta con:magenta +Builtin max-history con:max-history onBlack con:onBlack onBlue con:onBlue onCyan con:onCyan onGreen con:onGreen +Builtin onMagenta con:onMagenta onRed con:onRed onWhite con:onWhite onYellow con:onYellow print con:print +Builtin red con:red redir> con:redir> redir? con:redir? right con:right save-history con:save-history +Builtin size? con:size? up con:up white con:white yellow con:yellow >aes128gcm cr:>aes128gcm >aes256gcm cr:>aes256gcm +Builtin >cp cr:>cp >cpe cr:>cpe >decrypt cr:>decrypt >edbox cr:>edbox >encrypt cr:>encrypt >nbuf cr:>nbuf +Builtin >rsabox cr:>rsabox >uuid cr:>uuid aad? cr:aad? aes128box-sig cr:aes128box-sig aes128gcm> cr:aes128gcm> +Builtin aes256box-sig cr:aes256box-sig aes256gcm> cr:aes256gcm> aesgcm cr:aesgcm blakehash cr:blakehash +Builtin chacha20box-sig cr:chacha20box-sig chachapoly cr:chachapoly cipher! cr:cipher! cipher@ cr:cipher@ +Builtin ciphers cr:ciphers cp> cr:cp> cpe> cr:cpe> decrypt cr:decrypt decrypt+ cr:decrypt+ decrypt> cr:decrypt> +Builtin ebox-sig cr:ebox-sig ecc-curves cr:ecc-curves ecc-genkey cr:ecc-genkey ecc-secret cr:ecc-secret +Builtin ecc-sign cr:ecc-sign ecc-verify cr:ecc-verify ed25519 cr:ed25519 ed25519-secret cr:ed25519-secret +Builtin ed25519-sign cr:ed25519-sign ed25519-verify cr:ed25519-verify edbox-sig cr:edbox-sig edbox> cr:edbox> +Builtin encrypt cr:encrypt encrypt+ cr:encrypt+ encrypt> cr:encrypt> ensurekey cr:ensurekey genkey cr:genkey +Builtin hash cr:hash hash! cr:hash! hash+ cr:hash+ hash>b cr:hash>b hash>s cr:hash>s hash@ cr:hash@ +Builtin hashes cr:hashes hmac cr:hmac hotp cr:hotp iv? cr:iv? pem-read cr:pem-read pem-write cr:pem-write +Builtin pwd-valid? cr:pwd-valid? pwd/ cr:pwd/ pwd>hash cr:pwd>hash rand cr:rand randbuf cr:randbuf +Builtin randkey cr:randkey restore cr:restore root-certs cr:root-certs rsa_decrypt cr:rsa_decrypt rsa_encrypt cr:rsa_encrypt +Builtin rsa_sign cr:rsa_sign rsa_verify cr:rsa_verify rsabox-sig cr:rsabox-sig rsabox> cr:rsabox> rsagenkey cr:rsagenkey Builtin save cr:save sbox-sig cr:sbox-sig sha1-hmac cr:sha1-hmac shard cr:shard tag? cr:tag? totp cr:totp Builtin totp-epoch cr:totp-epoch totp-time-step cr:totp-time-step unshard cr:unshard uuid cr:uuid uuid> cr:uuid> -Builtin validate-pgp-sig cr:validate-pgp-sig validate-pwd cr:validate-pwd + d:+ +day d:+day +hour d:+hour -Builtin +min d:+min +msec d:+msec - d:- .time d:.time / d:/ = d:= >fixed d:>fixed >hmds d:>hmds >hmds: d:>hmds: -Builtin >msec d:>msec >unix d:>unix >ymd d:>ymd ?= d:?= Fri d:Fri Mon d:Mon Sat d:Sat Sun d:Sun Thu d:Thu -Builtin Tue d:Tue Wed d:Wed adjust-dst d:adjust-dst alarm d:alarm approx! d:approx! approx? d:approx? -Builtin approximates! d:approximates! between d:between cmp d:cmp d. d:d. default-now d:default-now +Builtin validate-pgp-sig cr:validate-pgp-sig validate-pwd cr:validate-pwd (.time) d:(.time) + d:+ +day d:+day +Builtin +hour d:+hour +min d:+min +msec d:+msec - d:- .time d:.time / d:/ = d:= >fixed d:>fixed >hmds d:>hmds +Builtin >hmds: d:>hmds: >msec d:>msec >unix d:>unix >ymd d:>ymd ?= d:?= Fri d:Fri Mon d:Mon Sat d:Sat +Builtin Sun d:Sun Thu d:Thu Tue d:Tue Wed d:Wed adjust-dst d:adjust-dst alarm d:alarm approx! d:approx! +Builtin approx? d:approx? approximates! d:approximates! between d:between cmp d:cmp d. d:d. default-now d:default-now Builtin doy d:doy dst-ofs d:dst-ofs dst? d:dst? dstinfo d:dstinfo dstquery d:dstquery dstzones? d:dstzones? Builtin elapsed-timer d:elapsed-timer elapsed-timer-hmds d:elapsed-timer-hmds elapsed-timer-msec d:elapsed-timer-msec Builtin elapsed-timer-seconds d:elapsed-timer-seconds first-dow d:first-dow fixed> d:fixed> fixed>dow d:fixed>dow Builtin format d:format join d:join last-dow d:last-dow last-month d:last-month last-week d:last-week -Builtin last-year d:last-year msec d:msec msec> d:msec> new d:new next-dow d:next-dow next-month d:next-month -Builtin next-week d:next-week next-year d:next-year parse d:parse parse-approx d:parse-approx parse-range d:parse-range -Builtin prev-dow d:prev-dow rfc5322 d:rfc5322 start-timer d:start-timer ticks d:ticks ticks/sec d:ticks/sec -Builtin timer d:timer timer-ctrl d:timer-ctrl tzadjust d:tzadjust unix> d:unix> unknown d:unknown unknown? d:unknown? -Builtin updatetz d:updatetz year@ d:year@ ymd d:ymd ymd> d:ymd> add-func db:add-func aes! db:aes! again? db:again? +Builtin last-year d:last-year leap? d:leap? mdays d:mdays msec d:msec msec> d:msec> new d:new next-dow d:next-dow +Builtin next-month d:next-month next-week d:next-week next-year d:next-year parse d:parse parse-approx d:parse-approx +Builtin parse-range d:parse-range prev-dow d:prev-dow rfc5322 d:rfc5322 start-timer d:start-timer ticks d:ticks +Builtin ticks/sec d:ticks/sec timer d:timer timer-ctrl d:timer-ctrl tzadjust d:tzadjust unix> d:unix> +Builtin unknown d:unknown unknown? d:unknown? updatetz d:updatetz year@ d:year@ ymd d:ymd ymd> d:ymd> +Builtin MYSQLLIB db:MYSQLLIB ODBCLIB db:ODBCLIB add-func db:add-func aes! db:aes! again? db:again? Builtin begin db:begin bind db:bind bind-exec db:bind-exec bind-exec{} db:bind-exec{} close db:close Builtin col db:col col{} db:col{} commit db:commit db db:db dbpush db:dbpush disuse db:disuse each db:each Builtin err-handler db:err-handler exec db:exec exec-cb db:exec-cb exec-name db:exec-name exec{} db:exec{} Builtin get db:get get-sub db:get-sub key db:key kind? db:kind? last-rowid db:last-rowid mysql? db:mysql? Builtin odbc? db:odbc? open db:open open? db:open? prep-name db:prep-name prepare db:prepare query db:query Builtin query-all db:query-all rekey db:rekey rollback db:rollback set db:set set-sub db:set-sub sql@ db:sql@ -Builtin sql[] db:sql[] sql[np] db:sql[np] sql{np} db:sql{np} sql{} db:sql{} use db:use zip db:zip bp dbg:bp -Builtin bt dbg:bt except-task@ dbg:except-task@ go dbg:go line-info dbg:line-info prompt dbg:prompt -Builtin stop dbg:stop trace dbg:trace trace-enter dbg:trace-enter trace-leave dbg:trace-leave / f:/ -Builtin >posix f:>posix abspath f:abspath absrel f:absrel append f:append associate f:associate atime f:atime -Builtin autodel f:autodel canwrite? f:canwrite? chmod f:chmod close f:close copy f:copy copydir f:copydir -Builtin create f:create ctime f:ctime dir? f:dir? dname f:dname eachbuf f:eachbuf eachline f:eachline -Builtin enssep f:enssep eof? f:eof? exec f:exec exists? f:exists? flush f:flush fname f:fname getb f:getb -Builtin getc f:getc getline f:getline getmod f:getmod glob f:glob glob-links f:glob-links glob-nocase f:glob-nocase +Builtin sql[] db:sql[] sql[np] db:sql[np] sql{np} db:sql{np} sql{} db:sql{} use db:use zip db:zip .state dbg:.state +Builtin bp dbg:bp bt dbg:bt except-task@ dbg:except-task@ go dbg:go prompt dbg:prompt see dbg:see stop dbg:stop +Builtin trace dbg:trace trace-enter dbg:trace-enter trace-leave dbg:trace-leave pso ds:pso / f:/ >posix f:>posix +Builtin abspath f:abspath absrel f:absrel append f:append associate f:associate atime f:atime autodel f:autodel +Builtin canwrite? f:canwrite? chmod f:chmod close f:close copy f:copy copydir f:copydir create f:create +Builtin ctime f:ctime dir? f:dir? dname f:dname eachbuf f:eachbuf eachline f:eachline enssep f:enssep +Builtin eof? f:eof? exec f:exec exists? f:exists? flush f:flush fname f:fname getb f:getb getc f:getc +Builtin getline f:getline getmod f:getmod glob f:glob glob-links f:glob-links glob-nocase f:glob-nocase Builtin gunz f:gunz homedir f:homedir homedir! f:homedir! include f:include ioctl f:ioctl join f:join Builtin launch f:launch link f:link link> f:link> link? f:link? lock f:lock mkdir f:mkdir mmap f:mmap Builtin mmap-range f:mmap-range mmap-range? f:mmap-range? mtime f:mtime mv f:mv name@ f:name@ open f:open @@ -209,9 +214,9 @@ Builtin ungetc f:ungetc unzip f:unzip unzip-entry f:unzip-entry watch f:watch w Builtin zip+ f:zip+ zip@ f:zip@ zipentry f:zipentry zipnew f:zipnew zipopen f:zipopen zipsave f:zipsave Builtin atlas! font:atlas! atlas@ font:atlas@ default-size font:default-size default-size@ font:default-size@ Builtin info font:info ls font:ls measure font:measure new font:new oversample font:oversample pixels font:pixels -Builtin pixels? font:pixels? system font:system system font:system distance geo:distance km/deg-lat geo:km/deg-lat -Builtin km/deg-lon geo:km/deg-lon nearest geo:nearest +edge gr:+edge +edge+w gr:+edge+w +node gr:+node -Builtin connect gr:connect edges gr:edges edges! gr:edges! m! gr:m! m@ gr:m@ neighbors gr:neighbors +Builtin pixels? font:pixels? system font:system system font:system media? g:media? distance geo:distance +Builtin km/deg-lat geo:km/deg-lat km/deg-lon geo:km/deg-lon nearest geo:nearest +edge gr:+edge +edge+w gr:+edge+w +Builtin +node gr:+node connect gr:connect edges gr:edges edges! gr:edges! m! gr:m! m@ gr:m@ neighbors gr:neighbors Builtin new gr:new node-edges gr:node-edges nodes gr:nodes traverse gr:traverse weight! gr:weight! Builtin + h:+ clear h:clear cmp! h:cmp! len h:len max! h:max! new h:new peek h:peek pop h:pop push h:push Builtin unique h:unique parse html:parse arm? hw:arm? camera hw:camera camera-img hw:camera-img camera-limits hw:camera-limits @@ -219,163 +224,171 @@ Builtin camera? hw:camera? cpu? hw:cpu? device? hw:device? displays? hw:display Builtin finger-match hw:finger-match finger-support hw:finger-support gpio hw:gpio gpio! hw:gpio! gpio-mmap hw:gpio-mmap Builtin gpio@ hw:gpio@ i2c hw:i2c i2c! hw:i2c! i2c!reg hw:i2c!reg i2c@ hw:i2c@ i2c@reg hw:i2c@reg isround? hw:isround? Builtin iswatch? hw:iswatch? mac? hw:mac? mem? hw:mem? model? hw:model? poll hw:poll sensor hw:sensor -Builtin start hw:start stop hw:stop uid? hw:uid? fetch-full imap:fetch-full fetch-uid-mail imap:fetch-uid-mail +Builtin start hw:start stop hw:stop touch? hw:touch? uid? hw:uid? fetch-full imap:fetch-full fetch-uid-mail imap:fetch-uid-mail Builtin login imap:login logout imap:logout new imap:new search imap:search select-inbox imap:select-inbox Builtin >file img:>file >fmt img:>fmt copy img:copy crop img:crop data img:data desat img:desat draw img:draw Builtin draw-sub img:draw-sub fill img:fill fillrect img:fillrect filter img:filter flip img:flip from-svg img:from-svg Builtin line img:line new img:new pikchr img:pikchr pix! img:pix! pix@ img:pix@ qr-gen img:qr-gen qr-parse img:qr-parse Builtin rect img:rect rotate img:rotate scale img:scale scroll img:scroll size img:size countries iso:countries -Builtin languages iso:languages utils/help library:utils/help find loc:find sort loc:sort ! m:! !? m:!? -Builtin + m:+ +? m:+? - m:- <> m:<> = m:= >arr m:>arr @ m:@ @? m:@? _! m:_! _@ m:_@ alias m:alias arr> m:arr> -Builtin bitmap m:bitmap clear m:clear data m:data each m:each exists? m:exists? filter m:filter ic m:ic -Builtin iter m:iter iter-all m:iter-all keys m:keys len m:len map m:map merge m:merge new m:new op! m:op! -Builtin open m:open slice m:slice vals m:vals xchg m:xchg zip m:zip ! mat:! * mat:* + mat:+ = mat:= -Builtin @ mat:@ affine mat:affine col mat:col data mat:data det mat:det dim? mat:dim? get-n mat:get-n -Builtin ident mat:ident inv mat:inv m. mat:m. minor mat:minor n* mat:n* new mat:new new-minor mat:new-minor -Builtin rotate mat:rotate row mat:row same-size? mat:same-size? scale mat:scale shear mat:shear trans mat:trans -Builtin translate mat:translate xform mat:xform 2console md:2console 2html md:2html 2nk md:2nk color meta:color -Builtin console meta:console gui meta:gui meta meta:meta ! n:! * n:* */ n:*/ + n:+ +! n:+! - n:- / n:/ -Builtin /mod n:/mod 1+ n:1+ 1- n:1- < n:< = n:= > n:> >bool n:>bool BIGE n:BIGE BIGPI n:BIGPI E n:E -Builtin PI n:PI ^ n:^ _mod n:_mod abs n:abs acos n:acos acos n:acos andor n:andor asin n:asin asin n:asin -Builtin atan n:atan atan n:atan atan2 n:atan2 band n:band between n:between bfloat n:bfloat bic n:bic +Builtin languages iso:languages utils/help library:utils/help bearing loc:bearing find loc:find sort loc:sort +Builtin ! m:! !? m:!? + m:+ +? m:+? - m:- <> m:<> = m:= >arr m:>arr @ m:@ @? m:@? _! m:_! _@ m:_@ _@? m:_@? +Builtin alias m:alias arr> m:arr> bitmap m:bitmap clear m:clear data m:data each m:each exists? m:exists? +Builtin filter m:filter ic m:ic iter m:iter iter-all m:iter-all keys m:keys len m:len map m:map merge m:merge +Builtin new m:new op! m:op! open m:open slice m:slice vals m:vals xchg m:xchg zip m:zip ! mat:! * mat:* +Builtin + mat:+ = mat:= @ mat:@ affine mat:affine col mat:col data mat:data det mat:det dim? mat:dim? +Builtin get-n mat:get-n ident mat:ident inv mat:inv m. mat:m. minor mat:minor n* mat:n* new mat:new +Builtin new-minor mat:new-minor rotate mat:rotate row mat:row same-size? mat:same-size? scale mat:scale +Builtin shear mat:shear trans mat:trans translate mat:translate xform mat:xform 2console md:2console +Builtin 2html md:2html 2nk md:2nk color meta:color console meta:console gui meta:gui meta meta:meta +Builtin ! n:! * n:* */ n:*/ + n:+ +! n:+! - n:- / n:/ /mod n:/mod 1+ n:1+ 1- n:1- < n:< = n:= > n:> +Builtin >bool n:>bool BIGE n:BIGE BIGPI n:BIGPI E n:E PI n:PI ^ n:^ _mod n:_mod abs n:abs acos n:acos +Builtin acosd n:acosd acosh n:acosh andor n:andor asin n:asin asind n:asind asinh n:asinh atan n:atan +Builtin atan2 n:atan2 atand n:atand atanh n:atanh band n:band between n:between bfloat n:bfloat bic n:bic Builtin bint n:bint binv n:binv bnot n:bnot bor n:bor bxor n:bxor cast n:cast ceil n:ceil clamp n:clamp -Builtin cmp n:cmp comb n:comb cos n:cos cosd n:cosd emod n:emod exp n:exp expm1 n:expm1 expmod n:expmod -Builtin float n:float floor n:floor fmod n:fmod frac n:frac gcd n:gcd int n:int invmod n:invmod kind? n:kind? -Builtin lcm n:lcm lerp n:lerp ln n:ln ln1p n:ln1p lnerp n:lnerp max n:max median n:median min n:min -Builtin mod n:mod neg n:neg odd? n:odd? perm n:perm prime? n:prime? quantize n:quantize quantize! n:quantize! -Builtin r+ n:r+ range n:range rot32l n:rot32l rot32r n:rot32r round n:round round2 n:round2 rounding n:rounding -Builtin running-variance n:running-variance running-variance-finalize n:running-variance-finalize sgn n:sgn -Builtin shl n:shl shr n:shr sin n:sin sind n:sind sqr n:sqr sqrt n:sqrt tan n:tan tand n:tand trunc n:trunc -Builtin ~= n:~= ! net:! !? net:!? - net:- >base64url net:>base64url >url net:>url @ net:@ @? net:@? -Builtin CGI net:CGI DGRAM net:DGRAM INET4 net:INET4 INET6 net:INET6 PROTO_TCP net:PROTO_TCP PROTO_UDP net:PROTO_UDP -Builtin REMOTE_IP net:REMOTE_IP STREAM net:STREAM accept net:accept active? net:active? addrinfo>o net:addrinfo>o -Builtin again? net:again? alloc-and-read net:alloc-and-read alloc-buf net:alloc-buf base64url> net:base64url> -Builtin bind net:bind cgi-get net:cgi-get cgi-http-header net:cgi-http-header cgi-init net:cgi-init -Builtin cgi-init-stunnel net:cgi-init-stunnel cgi-out net:cgi-out close net:close closed? net:closed? -Builtin connect net:connect curnet net:curnet debug? net:debug? delete net:delete get net:get getaddrinfo net:getaddrinfo -Builtin getpeername net:getpeername head net:head ifaces? net:ifaces? ipv6? net:ipv6? listen net:listen -Builtin map>url net:map>url mime-type net:mime-type net-socket net:net-socket opts net:opts port-is-ssl? net:port-is-ssl? +Builtin cmp n:cmp comb n:comb cos n:cos cosd n:cosd cosh n:cosh emod n:emod erf n:erf erfc n:erfc exp n:exp +Builtin expm1 n:expm1 expmod n:expmod float n:float floor n:floor fmod n:fmod frac n:frac gcd n:gcd +Builtin int n:int invmod n:invmod kind? n:kind? lcm n:lcm lerp n:lerp ln n:ln ln1p n:ln1p lnerp n:lnerp +Builtin logistic n:logistic max n:max median n:median min n:min mod n:mod neg n:neg odd? n:odd? perm n:perm +Builtin prime? n:prime? quantize n:quantize quantize! n:quantize! r+ n:r+ range n:range rot32l n:rot32l +Builtin rot32r n:rot32r round n:round round2 n:round2 rounding n:rounding running-variance n:running-variance +Builtin running-variance-finalize n:running-variance-finalize sgn n:sgn shl n:shl shr n:shr sin n:sin +Builtin sincos n:sincos sind n:sind sinh n:sinh sqr n:sqr sqrt n:sqrt tan n:tan tand n:tand tanh n:tanh +Builtin trunc n:trunc ~= n:~= ! net:! !? net:!? - net:- >base64url net:>base64url >url net:>url @ net:@ +Builtin @? net:@? CGI net:CGI DGRAM net:DGRAM INET4 net:INET4 INET6 net:INET6 PROTO_TCP net:PROTO_TCP +Builtin PROTO_UDP net:PROTO_UDP REMOTE_IP net:REMOTE_IP REMOTE_IP net:REMOTE_IP STREAM net:STREAM accept net:accept +Builtin active? net:active? addrinfo>o net:addrinfo>o again? net:again? alloc-and-read net:alloc-and-read +Builtin alloc-buf net:alloc-buf avail? net:avail? base64url> net:base64url> bind net:bind cgi-get net:cgi-get +Builtin cgi-http-header net:cgi-http-header cgi-init net:cgi-init cgi-init-stunnel net:cgi-init-stunnel +Builtin cgi-out net:cgi-out close net:close closed? net:closed? connect net:connect curnet net:curnet +Builtin debug? net:debug? delete net:delete dns net:dns get net:get getaddrinfo net:getaddrinfo getpeername net:getpeername +Builtin head net:head ifaces? net:ifaces? ipv6? net:ipv6? launch net:launch listen net:listen map>url net:map>url +Builtin mime-type net:mime-type net-socket net:net-socket opts net:opts port-is-ssl? net:port-is-ssl? Builtin post net:post proxy! net:proxy! put net:put read net:read read-all net:read-all read-buf net:read-buf Builtin recvfrom net:recvfrom s>url net:s>url sendto net:sendto server net:server setsockopt net:setsockopt Builtin socket net:socket tcp-connect net:tcp-connect tlserr net:tlserr tlshello net:tlshello udp-connect net:udp-connect -Builtin url> net:url> user-agent net:user-agent vpncheck net:vpncheck wait net:wait webserver net:webserver -Builtin write net:write (begin) nk:(begin) (chart-begin) nk:(chart-begin) (chart-begin-colored) nk:(chart-begin-colored) -Builtin (chart-end) nk:(chart-end) (end) nk:(end) (group-begin) nk:(group-begin) (group-end) nk:(group-end) -Builtin (property) nk:(property) >img nk:>img addfont nk:addfont anti-alias nk:anti-alias any-clicked? nk:any-clicked? -Builtin bounds nk:bounds bounds! nk:bounds! button nk:button button-color nk:button-color button-label nk:button-label -Builtin button-set-behavior nk:button-set-behavior button-symbol nk:button-symbol button-symbol-label nk:button-symbol-label -Builtin center-rect nk:center-rect chart-add-slot nk:chart-add-slot chart-add-slot-colored nk:chart-add-slot-colored -Builtin chart-push nk:chart-push chart-push-slot nk:chart-push-slot checkbox nk:checkbox circle nk:circle -Builtin clicked? nk:clicked? close-this! nk:close-this! close-this? nk:close-this? close? nk:close? -Builtin color-picker nk:color-picker combo nk:combo combo-begin-color nk:combo-begin-color combo-begin-label nk:combo-begin-label -Builtin combo-cb nk:combo-cb combo-end nk:combo-end contextual-begin nk:contextual-begin contextual-close nk:contextual-close +Builtin url> net:url> user-agent net:user-agent valid-email? net:valid-email? vpncheck net:vpncheck +Builtin wait net:wait webserver net:webserver write net:write (begin) nk:(begin) (chart-begin) nk:(chart-begin) +Builtin (chart-begin-colored) nk:(chart-begin-colored) (chart-end) nk:(chart-end) (end) nk:(end) (group-begin) nk:(group-begin) +Builtin (group-end) nk:(group-end) (property) nk:(property) >img nk:>img GLLIBS nk:GLLIBS GLXLIBS nk:GLXLIBS +Builtin addfont nk:addfont anti-alias nk:anti-alias any-clicked? nk:any-clicked? bounds nk:bounds bounds! nk:bounds! +Builtin button nk:button button-color nk:button-color button-label nk:button-label button-set-behavior nk:button-set-behavior +Builtin button-symbol nk:button-symbol button-symbol-label nk:button-symbol-label chart-add-slot nk:chart-add-slot +Builtin chart-add-slot-colored nk:chart-add-slot-colored chart-push nk:chart-push chart-push-slot nk:chart-push-slot +Builtin checkbox nk:checkbox circle nk:circle clicked? nk:clicked? close-this! nk:close-this! close-this? nk:close-this? +Builtin close? nk:close? color-chooser nk:color-chooser color-picker nk:color-picker combo nk:combo +Builtin combo-begin-color nk:combo-begin-color combo-begin-label nk:combo-begin-label combo-cb nk:combo-cb +Builtin combo-end nk:combo-end contextual-begin nk:contextual-begin contextual-close nk:contextual-close Builtin contextual-end nk:contextual-end contextual-item-image-text nk:contextual-item-image-text contextual-item-symbol-text nk:contextual-item-symbol-text Builtin contextual-item-text nk:contextual-item-text cp! nk:cp! cp@ nk:cp@ curpos nk:curpos cursor-load nk:cursor-load Builtin cursor-set nk:cursor-set cursor-show nk:cursor-show display-info nk:display-info display@ nk:display@ Builtin do nk:do down? nk:down? draw-image nk:draw-image draw-image-at nk:draw-image-at draw-image-centered nk:draw-image-centered Builtin draw-sub-image nk:draw-sub-image draw-text nk:draw-text draw-text-centered nk:draw-text-centered -Builtin draw-text-high nk:draw-text-high draw-text-wrap nk:draw-text-wrap drivers nk:drivers edit-focus nk:edit-focus -Builtin edit-string nk:edit-string event nk:event event-boost nk:event-boost event-msec nk:event-msec -Builtin event-wait nk:event-wait event? nk:event? fill-arc nk:fill-arc fill-circle nk:fill-circle fill-color nk:fill-color -Builtin fill-poly nk:fill-poly fill-rect nk:fill-rect fill-rect-color nk:fill-rect-color fill-triangle nk:fill-triangle -Builtin finger nk:finger flags! nk:flags! flags@ nk:flags@ flash nk:flash fullscreen nk:fullscreen -Builtin gesture nk:gesture get nk:get get-row-height nk:get-row-height getfont nk:getfont getmap nk:getmap -Builtin getmap! nk:getmap! gl? nk:gl? grid nk:grid grid-push nk:grid-push group-scroll-ofs nk:group-scroll-ofs -Builtin group-scroll-ofs! nk:group-scroll-ofs! hovered? nk:hovered? hrule nk:hrule image nk:image init nk:init -Builtin input-button nk:input-button input-key nk:input-key input-motion nk:input-motion input-scroll nk:input-scroll -Builtin input-string nk:input-string key-down? nk:key-down? key-pressed? nk:key-pressed? key-released? nk:key-released? -Builtin label nk:label label-colored nk:label-colored label-wrap nk:label-wrap label-wrap-colored nk:label-wrap-colored -Builtin layout-bounds nk:layout-bounds layout-grid-begin nk:layout-grid-begin layout-grid-end nk:layout-grid-end -Builtin layout-push-dynamic nk:layout-push-dynamic layout-push-static nk:layout-push-static layout-push-variable nk:layout-push-variable -Builtin layout-ratio-from-pixel nk:layout-ratio-from-pixel layout-reset-row-height nk:layout-reset-row-height -Builtin layout-row nk:layout-row layout-row-begin nk:layout-row-begin layout-row-dynamic nk:layout-row-dynamic -Builtin layout-row-end nk:layout-row-end layout-row-height nk:layout-row-height layout-row-push nk:layout-row-push -Builtin layout-row-static nk:layout-row-static layout-row-template-begin nk:layout-row-template-begin +Builtin draw-text-high nk:draw-text-high draw-text-wrap nk:draw-text-wrap driver nk:driver drivers nk:drivers +Builtin dropped nk:dropped dropping nk:dropping edit-focus nk:edit-focus edit-string nk:edit-string +Builtin event nk:event event-boost nk:event-boost event-msec nk:event-msec event-wait nk:event-wait +Builtin event? nk:event? fill-arc nk:fill-arc fill-circle nk:fill-circle fill-color nk:fill-color fill-poly nk:fill-poly +Builtin fill-rect nk:fill-rect fill-rect-color nk:fill-rect-color fill-triangle nk:fill-triangle finger nk:finger +Builtin flags! nk:flags! flags@ nk:flags@ flash nk:flash fullscreen nk:fullscreen gesture nk:gesture +Builtin get nk:get get-row-height nk:get-row-height getfont nk:getfont getmap nk:getmap getmap! nk:getmap! +Builtin gl? nk:gl? grid nk:grid grid-peek nk:grid-peek grid-push nk:grid-push group-scroll-ofs nk:group-scroll-ofs +Builtin group-scroll-ofs! nk:group-scroll-ofs! hints nk:hints hovered? nk:hovered? hrule nk:hrule image nk:image +Builtin init nk:init input-button nk:input-button input-key nk:input-key input-motion nk:input-motion +Builtin input-scroll nk:input-scroll input-string nk:input-string key-down? nk:key-down? key-pressed? nk:key-pressed? +Builtin key-released? nk:key-released? knob nk:knob label nk:label label-colored nk:label-colored label-wrap nk:label-wrap +Builtin label-wrap-colored nk:label-wrap-colored layout-bounds nk:layout-bounds layout-grid-begin nk:layout-grid-begin +Builtin layout-grid-end nk:layout-grid-end layout-push-dynamic nk:layout-push-dynamic layout-push-static nk:layout-push-static +Builtin layout-push-variable nk:layout-push-variable layout-ratio-from-pixel nk:layout-ratio-from-pixel +Builtin layout-reset-row-height nk:layout-reset-row-height layout-row nk:layout-row layout-row-begin nk:layout-row-begin +Builtin layout-row-dynamic nk:layout-row-dynamic layout-row-end nk:layout-row-end layout-row-height nk:layout-row-height +Builtin layout-row-push nk:layout-row-push layout-row-static nk:layout-row-static layout-row-template-begin nk:layout-row-template-begin Builtin layout-row-template-end nk:layout-row-template-end layout-space-begin nk:layout-space-begin Builtin layout-space-end nk:layout-space-end layout-space-push nk:layout-space-push layout-widget-bounds nk:layout-widget-bounds Builtin line-rel nk:line-rel line-to nk:line-to list-begin nk:list-begin list-end nk:list-end list-new nk:list-new -Builtin list-range nk:list-range m! nk:m! m@ nk:m@ make-style nk:make-style max-vertex-element nk:max-vertex-element +Builtin list-ofs nk:list-ofs list-range nk:list-range m! nk:m! m@ nk:m@ make-style nk:make-style max-vertex-element nk:max-vertex-element Builtin maximize nk:maximize measure nk:measure measure-font nk:measure-font menu-begin nk:menu-begin Builtin menu-close nk:menu-close menu-end nk:menu-end menu-item-image nk:menu-item-image menu-item-label nk:menu-item-label Builtin menu-item-symbol nk:menu-item-symbol menubar-begin nk:menubar-begin menubar-end nk:menubar-end Builtin minimize nk:minimize mouse-pos nk:mouse-pos move-back nk:move-back move-rel nk:move-rel move-to nk:move-to Builtin msg nk:msg msgdlg nk:msgdlg ontop nk:ontop option nk:option pen-color nk:pen-color pen-width nk:pen-width -Builtin plot nk:plot plot-fn nk:plot-fn pop-font nk:pop-font popup-begin nk:popup-begin popup-close nk:popup-close -Builtin popup-end nk:popup-end popup-scroll-ofs nk:popup-scroll-ofs popup-scroll-ofs! nk:popup-scroll-ofs! -Builtin progress nk:progress prop-int nk:prop-int pt-in? nk:pt-in? pt-open nk:pt-open pt>local nk:pt>local -Builtin pt>rect nk:pt>rect pt>screen nk:pt>screen pt>x nk:pt>x pts>rect nk:pts>rect push-font nk:push-font -Builtin raise nk:raise rect! nk:rect! rect-center nk:rect-center rect-intersect nk:rect-intersect rect-ofs nk:rect-ofs -Builtin rect-open nk:rect-open rect-pad nk:rect-pad rect-rel nk:rect-rel rect-shrink nk:rect-shrink -Builtin rect-to nk:rect-to rect-union nk:rect-union rect/high nk:rect/high rect/wide nk:rect/wide rect= nk:rect= -Builtin rect>local nk:rect>local rect>pos nk:rect>pos rect>pts nk:rect>pts rect>pts4 nk:rect>pts4 rect>screen nk:rect>screen -Builtin rect>size nk:rect>size rect>x nk:rect>x rect@ nk:rect@ released? nk:released? render nk:render -Builtin render-timed nk:render-timed restore nk:restore rotate nk:rotate rotate-rel nk:rotate-rel save nk:save -Builtin scale nk:scale scancode? nk:scancode? screen-saver nk:screen-saver screen-size nk:screen-size -Builtin screen-win-close nk:screen-win-close selectable nk:selectable set nk:set set-font nk:set-font -Builtin set-num-vertices nk:set-num-vertices set-radius nk:set-radius setpos nk:setpos setwin nk:setwin -Builtin show nk:show slider nk:slider slider-int nk:slider-int space nk:space spacing nk:spacing stroke-arc nk:stroke-arc -Builtin stroke-circle nk:stroke-circle stroke-curve nk:stroke-curve stroke-line nk:stroke-line stroke-polygon nk:stroke-polygon -Builtin stroke-polyline nk:stroke-polyline stroke-rect nk:stroke-rect stroke-tri nk:stroke-tri style-from-table nk:style-from-table -Builtin swipe nk:swipe swipe-dir-threshold nk:swipe-dir-threshold swipe-threshold nk:swipe-threshold -Builtin text nk:text text-align nk:text-align text-font nk:text-font text-pad nk:text-pad text? nk:text? -Builtin timer-delay nk:timer-delay timer? nk:timer? tooltip nk:tooltip translate nk:translate tree-pop nk:tree-pop -Builtin tree-state-push nk:tree-state-push use-style nk:use-style vsync nk:vsync widget nk:widget widget-bounds nk:widget-bounds +Builtin pix! nk:pix! plot nk:plot plot-fn nk:plot-fn polygon nk:polygon pop-font nk:pop-font popup-begin nk:popup-begin +Builtin popup-close nk:popup-close popup-end nk:popup-end popup-scroll-ofs nk:popup-scroll-ofs popup-scroll-ofs! nk:popup-scroll-ofs! +Builtin progress nk:progress prop-int nk:prop-int pt-in? nk:pt-in? pt>local nk:pt>local pt>screen nk:pt>screen +Builtin push-font nk:push-font raise nk:raise rect-rel nk:rect-rel rect-to nk:rect-to rect>local nk:rect>local +Builtin rect>screen nk:rect>screen released? nk:released? render nk:render render-timed nk:render-timed +Builtin rendering nk:rendering restore nk:restore rotate nk:rotate rotate-rel nk:rotate-rel rtl! nk:rtl! +Builtin rtl? nk:rtl? save nk:save scale nk:scale scancode? nk:scancode? screen-saver nk:screen-saver +Builtin screen-size nk:screen-size screen-win-close nk:screen-win-close selectable nk:selectable set nk:set +Builtin set-font nk:set-font set-num-vertices nk:set-num-vertices set-radius nk:set-radius setpos nk:setpos +Builtin setwin nk:setwin show nk:show slider nk:slider slider-int nk:slider-int space nk:space spacing nk:spacing +Builtin stroke-arc nk:stroke-arc stroke-circle nk:stroke-circle stroke-curve nk:stroke-curve stroke-line nk:stroke-line +Builtin stroke-polygon nk:stroke-polygon stroke-polyline nk:stroke-polyline stroke-rect nk:stroke-rect +Builtin stroke-tri nk:stroke-tri style-from-table nk:style-from-table swipe nk:swipe swipe-dir-threshold nk:swipe-dir-threshold +Builtin swipe-threshold nk:swipe-threshold text nk:text text-align nk:text-align text-font nk:text-font +Builtin text-pad nk:text-pad text? nk:text? timer-delay nk:timer-delay timer? nk:timer? toast nk:toast +Builtin tooltip nk:tooltip translate nk:translate tree-pop nk:tree-pop tree-state-push nk:tree-state-push +Builtin triangle nk:triangle use-style nk:use-style vsync nk:vsync widget nk:widget widget-bounds nk:widget-bounds Builtin widget-disable nk:widget-disable widget-fitting nk:widget-fitting widget-high nk:widget-high Builtin widget-hovered? nk:widget-hovered? widget-mouse-click-down? nk:widget-mouse-click-down? widget-mouse-clicked? nk:widget-mouse-clicked? -Builtin widget-pos nk:widget-pos widget-size nk:widget-size widget-size nk:widget-size widget-wide nk:widget-wide -Builtin win nk:win win-bounds nk:win-bounds win-bounds! nk:win-bounds! win-close nk:win-close win-closed? nk:win-closed? -Builtin win-collapse nk:win-collapse win-collapsed? nk:win-collapsed? win-content-bounds nk:win-content-bounds +Builtin widget-pos nk:widget-pos widget-size nk:widget-size widget-size-allot nk:widget-size-allot +Builtin widget-wide nk:widget-wide win nk:win win-bounds nk:win-bounds win-bounds! nk:win-bounds! win-close nk:win-close +Builtin win-closed? nk:win-closed? win-collapse nk:win-collapse win-collapsed? nk:win-collapsed? win-content-bounds nk:win-content-bounds Builtin win-focus nk:win-focus win-focused? nk:win-focused? win-hidden? nk:win-hidden? win-high nk:win-high -Builtin win-hovered? nk:win-hovered? win-pos nk:win-pos win-scroll-ofs nk:win-scroll-ofs win-scroll-ofs! nk:win-scroll-ofs! -Builtin win-show nk:win-show win-size nk:win-size win-wide nk:win-wide win? nk:win? x>pt nk:x>pt x>rect nk:x>rect -Builtin MAX ns:MAX ! o:! + o:+ +? o:+? ??? o:??? @ o:@ class o:class exec o:exec isa o:isa method o:method -Builtin mutate o:mutate new o:new super o:super chroot os:chroot devname os:devname docker? os:docker? -Builtin env os:env lang os:lang locales os:locales notify os:notify power-state os:power-state region os:region -Builtin waitpid os:waitpid bezier pdf:bezier bezierq pdf:bezierq circle pdf:circle color pdf:color -Builtin ellipse pdf:ellipse font pdf:font img pdf:img line pdf:line new pdf:new page pdf:page page-size pdf:page-size -Builtin rect pdf:rect save pdf:save size pdf:size text pdf:text text-rotate pdf:text-rotate text-size pdf:text-size -Builtin text-width pdf:text-width text-wrap pdf:text-wrap text-wrap-rotate pdf:text-wrap-rotate cast ptr:cast +Builtin win-hovered? nk:win-hovered? win-icon! nk:win-icon! win-pos nk:win-pos win-scroll-ofs nk:win-scroll-ofs +Builtin win-scroll-ofs! nk:win-scroll-ofs! win-show nk:win-show win-size nk:win-size win-title! nk:win-title! +Builtin win-wide nk:win-wide win? nk:win? MAX ns:MAX ! o:! + o:+ +? o:+? ??? o:??? @ o:@ class o:class +Builtin exec o:exec isa o:isa method o:method mutate o:mutate new o:new super o:super POSIX os:POSIX +Builtin chroot os:chroot devname os:devname docker? os:docker? env os:env lang os:lang locales os:locales +Builtin notify os:notify power-state os:power-state region os:region waitpid os:waitpid bezier pdf:bezier +Builtin bezierq pdf:bezierq circle pdf:circle color pdf:color ellipse pdf:ellipse font pdf:font img pdf:img +Builtin line pdf:line new pdf:new page pdf:page page-size pdf:page-size rect pdf:rect save pdf:save +Builtin size pdf:size text pdf:text text-rotate pdf:text-rotate text-size pdf:text-size text-width pdf:text-width +Builtin text-wrap pdf:text-wrap text-wrap-rotate pdf:text-wrap-rotate cast ptr:cast deref ptr:deref Builtin len ptr:len null? ptr:null? pack ptr:pack unpack ptr:unpack unpack_orig ptr:unpack_orig publish pubsub:publish Builtin qsize pubsub:qsize subscribe pubsub:subscribe + q:+ clear q:clear len q:len new q:new notify q:notify Builtin overwrite q:overwrite peek q:peek pick q:pick pop q:pop push q:push remove q:remove shift q:shift Builtin size q:size slide q:slide throwing q:throwing wait q:wait ++match r:++match +/ r:+/ +match r:+match -Builtin / r:/ @ r:@ len r:len match r:match new r:new rx r:rx str r:str * rat:* + rat:+ - rat:- / rat:/ -Builtin >n rat:>n >s rat:>s new rat:new proper rat:proper ! s:! * s:* + s:+ - s:- / s:/ /scripts s:/scripts -Builtin <+ s:<+ <> s:<> = s:= =ic s:=ic >base64 s:>base64 >ucs2 s:>ucs2 @ s:@ append s:append base64> s:base64> -Builtin clear s:clear cmp s:cmp cmpi s:cmpi compress s:compress count-match s:count-match days! s:days! -Builtin dist s:dist each s:each each! s:each! eachline s:eachline escape s:escape expand s:expand fill s:fill -Builtin fold s:fold globmatch s:globmatch hexupr s:hexupr insert s:insert intl s:intl intl! s:intl! -Builtin lang s:lang lc s:lc lc? s:lc? len s:len lsub s:lsub ltrim s:ltrim map s:map months! s:months! -Builtin n> s:n> new s:new norm s:norm reduce s:reduce repinsert s:repinsert replace s:replace replace! s:replace! -Builtin rev s:rev rsearch s:rsearch rsub s:rsub rtrim s:rtrim scan-match s:scan-match script? s:script? -Builtin search s:search size s:size slice s:slice soundex s:soundex strfmap s:strfmap strfmt s:strfmt -Builtin term s:term text-wrap s:text-wrap tr s:tr translate s:translate trim s:trim tsub s:tsub uc s:uc -Builtin uc? s:uc? ucs2> s:ucs2> utf8? s:utf8? zt s:zt close sio:close enum sio:enum open sio:open opts! sio:opts! -Builtin opts@ sio:opts@ read sio:read write sio:write @ slv:@ auto slv:auto build slv:build constraint slv:constraint -Builtin dump slv:dump edit slv:edit named-variable slv:named-variable new slv:new relation slv:relation -Builtin reset slv:reset suggest slv:suggest term slv:term update slv:update v[] slv:v[] variable slv:variable -Builtin v{} slv:v{} new smtp:new send smtp:send apply-filter snd:apply-filter devices? snd:devices? -Builtin end-record snd:end-record filter snd:filter freq snd:freq gain snd:gain gain? snd:gain? init snd:init -Builtin len snd:len loop snd:loop loop? snd:loop? mix snd:mix new snd:new pause snd:pause play snd:play -Builtin played snd:played rate snd:rate ready? snd:ready? record snd:record resume snd:resume seek snd:seek -Builtin stop snd:stop stopall snd:stopall volume snd:volume volume? snd:volume? + st:+ . st:. clear st:clear -Builtin len st:len ndrop st:ndrop new st:new op! st:op! peek st:peek pick st:pick pop st:pop push st:push -Builtin roll st:roll shift st:shift size st:size slide st:slide swap st:swap throwing st:throwing >buf struct:>buf -Builtin arr> struct:arr> buf struct:buf buf> struct:buf> byte struct:byte double struct:double field! struct:field! +Builtin / r:/ @ r:@ len r:len match r:match match[] r:match[] matchall[] r:matchall[] new r:new rx r:rx +Builtin str r:str * rat:* + rat:+ - rat:- / rat:/ >n rat:>n >s rat:>s new rat:new proper rat:proper +Builtin ! rect:! /high rect:/high /wide rect:/wide = rect:= >a rect:>a >pts rect:>pts >pts4 rect:>pts4 +Builtin @ rect:@ center rect:center center-pt rect:center-pt intersect rect:intersect new rect:new +Builtin new-pt rect:new-pt ofs rect:ofs open rect:open pad rect:pad pos rect:pos pt-open rect:pt-open +Builtin pt>a rect:pt>a pt>rect rect:pt>rect pts> rect:pts> restrict rect:restrict shrink rect:shrink +Builtin size rect:size union rect:union ! s:! * s:* + s:+ - s:- / s:/ /scripts s:/scripts /ws s:/ws +Builtin 2len s:2len <+ s:<+ <> s:<> = s:= =ic s:=ic >base64 s:>base64 >ucs2 s:>ucs2 @ s:@ _len s:_len +Builtin append s:append base64> s:base64> clear s:clear cmp s:cmp cmpi s:cmpi compress s:compress count-match s:count-match +Builtin days! s:days! dist s:dist each s:each each! s:each! eachline s:eachline escape s:escape expand s:expand +Builtin fill s:fill fold s:fold gen-uid s:gen-uid globmatch s:globmatch hexupr s:hexupr insert s:insert +Builtin intl s:intl intl! s:intl! lang s:lang lc s:lc lc? s:lc? len s:len lsub s:lsub ltrim s:ltrim +Builtin map s:map months! s:months! n> s:n> new s:new norm s:norm reduce s:reduce repinsert s:repinsert +Builtin replace s:replace replace! s:replace! rev s:rev rsearch s:rsearch rsub s:rsub rtl s:rtl rtrim s:rtrim +Builtin scan-match s:scan-match script? s:script? search s:search size s:size slice s:slice soundex s:soundex +Builtin strfmap s:strfmap strfmt s:strfmt term s:term text-wrap s:text-wrap tr s:tr translate s:translate +Builtin trim s:trim tsub s:tsub uc s:uc uc? s:uc? ucs2> s:ucs2> utf8? s:utf8? zt s:zt close sio:close +Builtin enum sio:enum open sio:open opts! sio:opts! opts@ sio:opts@ read sio:read write sio:write @ slv:@ +Builtin auto slv:auto build slv:build constraint slv:constraint dump slv:dump edit slv:edit named-variable slv:named-variable +Builtin new slv:new relation slv:relation reset slv:reset suggest slv:suggest term slv:term update slv:update +Builtin v[] slv:v[] variable slv:variable v{} slv:v{} new smtp:new send smtp:send apply-filter snd:apply-filter +Builtin devices? snd:devices? end-record snd:end-record filter snd:filter freq snd:freq gain snd:gain +Builtin gain? snd:gain? init snd:init len snd:len loop snd:loop loop? snd:loop? mix snd:mix new snd:new +Builtin pause snd:pause play snd:play played snd:played rate snd:rate ready? snd:ready? record snd:record +Builtin resume snd:resume seek snd:seek stop snd:stop stopall snd:stopall volume snd:volume volume? snd:volume? +Builtin + st:+ . st:. clear st:clear dot-depth st:dot-depth len st:len list st:list ndrop st:ndrop +Builtin new st:new op! st:op! peek st:peek pick st:pick pop st:pop push st:push roll st:roll shift st:shift +Builtin size st:size slide st:slide swap st:swap throwing st:throwing >buf struct:>buf arr> struct:arr> +Builtin buf struct:buf buf> struct:buf> byte struct:byte double struct:double field! struct:field! Builtin field@ struct:field@ float struct:float ignore struct:ignore int struct:int long struct:long -Builtin struct; struct:struct; word struct:word ! t:! @ t:@ by-name t:by-name cor t:cor cor-drop t:cor-drop -Builtin curtask t:curtask def-queue t:def-queue def-stack t:def-stack done? t:done? dtor t:dtor err! t:err! -Builtin err? t:err? errno? t:errno? extra t:extra getq t:getq handler t:handler handler@ t:handler@ -Builtin kill t:kill list t:list main t:main max-exceptions t:max-exceptions name! t:name! name@ t:name@ -Builtin notify t:notify parent t:parent pop t:pop priority t:priority push t:push push! t:push! q-notify t:q-notify -Builtin q-wait t:q-wait qlen t:qlen result t:result set-affinity t:set-affinity setq t:setq start t:start -Builtin task t:task task-n t:task-n task-stop t:task-stop ticks t:ticks wait t:wait yield t:yield yield! t:yield! -Builtin add tree:add binary tree:binary bk tree:bk btree tree:btree cmp! tree:cmp! data tree:data del tree:del -Builtin find tree:find iter tree:iter next tree:next nodes tree:nodes parent tree:parent parse tree:parse -Builtin prev tree:prev root tree:root search tree:search trie tree:trie ! w:! (is) w:(is) @ w:@ alias: w:alias: -Builtin cb w:cb deprecate w:deprecate dlcall w:dlcall dlopen w:dlopen dlsym w:dlsym exec w:exec exec? w:exec? -Builtin ffifail w:ffifail find w:find forget w:forget is w:is name w:name undo w:undo close ws:close -Builtin decode ws:decode encode ws:encode encode-nomask ws:encode-nomask gen-accept-header ws:gen-accept-header +Builtin struct; struct:struct; word struct:word ! t:! @ t:@ by-name t:by-name curtask t:curtask def-queue t:def-queue +Builtin def-stack t:def-stack done? t:done? dtor t:dtor err! t:err! err? t:err? errno? t:errno? extra t:extra +Builtin getq t:getq handler t:handler handler@ t:handler@ kill t:kill list t:list main t:main max-exceptions t:max-exceptions +Builtin name! t:name! name@ t:name@ notify t:notify parent t:parent pop t:pop priority t:priority push t:push +Builtin push! t:push! q-notify t:q-notify q-wait t:q-wait qlen t:qlen result t:result set-affinity t:set-affinity +Builtin setq t:setq task t:task task-n t:task-n task-stop t:task-stop ticks t:ticks wait t:wait add tree:add +Builtin binary tree:binary bk tree:bk btree tree:btree cmp! tree:cmp! data tree:data del tree:del find tree:find +Builtin iter tree:iter next tree:next nodes tree:nodes parent tree:parent parse tree:parse prev tree:prev +Builtin root tree:root search tree:search trie tree:trie ! w:! (is) w:(is) @ w:@ alias: w:alias: cb w:cb +Builtin deprecate w:deprecate dlcall w:dlcall dlopen w:dlopen dlsym w:dlsym exec w:exec exec? w:exec? +Builtin ffifail w:ffifail find w:find forget w:forget is w:is name w:name undo w:undo xt w:xt xt> w:xt> +Builtin close ws:close decode ws:decode encode ws:encode encode-nomask ws:encode-nomask gen-accept-header ws:gen-accept-header Builtin gen-accept-key ws:gen-accept-key opcodes ws:opcodes open ws:open >s xml:>s >txt xml:>txt md-init xml:md-init Builtin md-parse xml:md-parse parse xml:parse parse-html xml:parse-html parse-stream xml:parse-stream Builtin getmsg[] zmq:getmsg[] sendmsg[] zmq:sendmsg[] @@ -413,8 +426,9 @@ syn match eighthBuiltin /db:bind-exec\[]/ syn match eighthBuiltin /db:exec\[]/ syn match eighthBuiltin /db:col\[]/ -" TODO -syn region eighthComment start="\zs\\" end="$" contains=eighthTodo +syn region eighthComment start="\zs\\" end="$" contains=eighthTodo,@Spell +syn region eighthComment start="\zs--\s" end="$" contains=eighthTodo,@Spell +syn region eighthComment start="\zs(\*\_[:space:]" end="\_[:space:]\*)\ze" contains=eightTodo,@Spell " The default methods for highlighting. Can be overriden later. hi def link eighthTodo Todo @@ -452,6 +466,7 @@ hi def link jsonArray Special hi def link jsonNull Function hi def link jsonBool Boolean +delcommand Builtin let b:current_syntax = "8th" let &cpo = s:cpo_save unlet s:cpo_save diff --git a/usr/share/vim/vim91/syntax/awk.vim b/usr/share/vim/vim91/syntax/awk.vim index 3082c1cb5cf..4e7c0d1e721 100644 --- a/usr/share/vim/vim91/syntax/awk.vim +++ b/usr/share/vim/vim91/syntax/awk.vim @@ -2,7 +2,7 @@ " Language: awk, nawk, gawk, mawk " Maintainer: Doug Kearns " Previous Maintainer: Antonio Colombo -" Last Change: 2020 Aug 18 +" Last Change: 2024 Oct 28 " AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger " The AWK Programming Language, Addison-Wesley, 1988 @@ -92,7 +92,7 @@ syn match awkSpecialCharacter display contained "\\x[0-9A-Fa-f]\+" syn match awkFieldVars "\$\d\+" " catch errors caused by wrong parenthesis -syn region awkParen transparent start="(" end=")" contains=ALLBUT,awkParenError,awkSpecialCharacter,awkArrayElement,awkArrayArray,awkTodo,awkRegExp,awkBrktRegExp,awkBrackets,awkCharClass,awkComment +syn region awkParen transparent start="(" end=")" contains=ALLBUT,awkParenError,awkSpecialCharacter,awkArrayElement,awkArrayArray,awkTodo,awkRegExp,awkBrktRegExp,awkBrackets,awkCharClass syn match awkParenError display ")" "syn match awkInParen display contained "[{}]" diff --git a/usr/share/vim/vim91/syntax/help.vim b/usr/share/vim/vim91/syntax/help.vim index ff214e2768c..ae7e3bc6a7c 100644 --- a/usr/share/vim/vim91/syntax/help.vim +++ b/usr/share/vim/vim91/syntax/help.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Vim help file " Maintainer: The Vim Project -" Last Change: 2024 Oct 08 +" Last Change: 2024 Oct 16 " Former Maintainer: Bram Moolenaar " Quit when a (custom) syntax file was already loaded @@ -47,7 +47,8 @@ syn match helpOption "'[a-z]\{2,\}'" syn match helpOption "'t_..'" syn match helpNormal "'ab'" syn match helpCommand "`[^` \t]\+`"hs=s+1,he=e-1 contains=helpBacktick -syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|$\)"hs=s+1,he=e-1 contains=helpBacktick +" doesn't allow a . directly after an ending backtick. See :helpgrep `[^`,]\+ [^`,]\+`\. +syn match helpCommand "\(^\|[^a-z"[]\)\zs`[^`]\+`\ze\([^a-z\t."']\|[.?!]\?$\)"hs=s+1,he=e-1 contains=helpBacktick syn match helpHeader "\s*\zs.\{-}\ze\s\=\~$" nextgroup=helpIgnore syn match helpGraphic ".* \ze`$" nextgroup=helpIgnore if has("conceal") @@ -56,6 +57,7 @@ else syn match helpIgnore "." contained endif syn keyword helpNote note Note NOTE note: Note: NOTE: Notes Notes: +syn match helpNote "\c(note\(:\|\>\)"ms=s+1 syn keyword helpWarning WARNING WARNING: Warning: syn keyword helpDeprecated DEPRECATED DEPRECATED: Deprecated: syn match helpSpecial "\" @@ -68,6 +70,10 @@ syn match helpSpecial "\[N]" syn match helpSpecial "N N"he=s+1 syn match helpSpecial "Nth"me=e-2 syn match helpSpecial "N-1"me=e-2 +" highlighting N for :resize in windows.txt +syn match helpSpecial "] -N\>"ms=s+3 +syn match helpSpecial "+N\>"ms=s+1 +syn match helpSpecial "\[+-]N\>"ms=s+4 " highlighting N of cinoptions-values in indent.txt syn match helpSpecial "^\t-\?\zsNs\?\s"me=s+1 " highlighting N of cinoptions-values in indent.txt @@ -144,7 +150,7 @@ syn match helpUnderlined "\t[* ]Underlined\t\+[a-z].*" syn match helpError "\t[* ]Error\t\+[a-z].*" syn match helpTodo "\t[* ]Todo\t\+[a-z].*" -syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-zA-Z0-9/]` +syn match helpURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^'" \t<>{}]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^'" \t<>{}]+)[a-zA-Z0-9/]` syn match helpDiffAdded "\t[* ]Added\t\+[a-z].*" syn match helpDiffChanged "\t[* ]Changed\t\+[a-z].*" @@ -156,17 +162,6 @@ if s:i > 0 exe "runtime syntax/help_" . strpart(expand("%"), s:i + 1, 2) . ".vim" endif -" Italian -if v:lang =~ '\' || v:lang =~ '_IT\>' || v:lang =~? "italian" - syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE: - syn match helpSpecial "Nma"me=e-2 - syn match helpSpecial "Nme"me=e-2 - syn match helpSpecial "Nmi"me=e-2 - syn match helpSpecial "Nmo"me=e-2 - syn match helpSpecial "\[interv.]" - syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump -endif - syn sync minlines=40 diff --git a/usr/share/vim/vim91/syntax/help_it.vim b/usr/share/vim/vim91/syntax/help_it.vim new file mode 100644 index 00000000000..e76851d4462 --- /dev/null +++ b/usr/share/vim/vim91/syntax/help_it.vim @@ -0,0 +1,17 @@ +" Vim syntax file +" Language: Italian Vim program help files *.itx +" Maintainer: The Vim Project +" Last Change: 2024 Oct 16 +" +" This script is sourced from syntax/help.vim. + +syn keyword helpNote nota Nota NOTA nota: Nota: NOTA: notare Notare NOTARE notare: Notare: NOTARE: +syn match helpNote "\c(nota\(:\|\>\)"ms=s+1 +syn match helpSpecial "Nma"me=e-2 +syn match helpSpecial "Nme"me=e-2 +syn match helpSpecial "Nmi"me=e-2 +syn match helpSpecial "Nmo"me=e-2 +syn match helpSpecial "\[interv.]" +syn region helpNotVi start="{non" start="{solo" start="{disponibile" end="}" contains=helpLeadBlank,helpHyperTextJump + +" vim: ts=8 sw=2 diff --git a/usr/share/vim/vim91/syntax/idris2.vim b/usr/share/vim/vim91/syntax/idris2.vim new file mode 100644 index 00000000000..e3e3d0dceed --- /dev/null +++ b/usr/share/vim/vim91/syntax/idris2.vim @@ -0,0 +1,86 @@ +" Vim syntax file +" Language: Idris 2 +" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma +" Last Change: 2024 Nov 05 +" Original Author: raichoo (raichoo@googlemail.com) +" License: Vim (see :h license) +" Repository: https://github.com/ShinKage/idris2-nvim +" + +if exists("b:current_syntax") + finish +endif + +syn match idris2TypeDecl "[a-zA-Z][a-zA-z0-9_']*\s\+:\s\+" contains=idris2Identifier,idris2Operators +syn region idris2Parens matchgroup=idris2Delimiter start="(" end=")" contains=TOP,idris2TypeDecl +syn region idris2Brackets matchgroup=idris2Delimiter start="\[" end="]" contains=TOP,idris2TypeDecl +syn region idris2Block matchgroup=idris2Delimiter start="{" end="}" contains=TOP,idris2TypeDecl +syn region idris2SnocBrackets matchgroup=idris2Delimiter start="\[<" end="]" contains=TOP +syn region idris2ListBrackets matchgroup=idris2Delimiter start="\[>" end="]" contains=TOP +syn keyword idris2Module module namespace +syn keyword idris2Import import +syn keyword idris2Structure data record interface implementation +syn keyword idris2Where where +syn keyword idris2Visibility public abstract private export +syn keyword idris2Block parameters mutual using +syn keyword idris2Totality total partial covering +syn keyword idris2Annotation auto impossible default constructor +syn keyword idris2Statement do case of rewrite with proof +syn keyword idris2Let let in +syn keyword idris2Forall forall +syn keyword idris2DataOpt noHints uniqueSearch search external noNewtype containedin=idris2Brackets +syn keyword idris2Conditional if then else +syn match idris2Number "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>" +syn match idris2Float "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>" +syn match idris2Delimiter "[,;]" +syn keyword idris2Infix prefix infix infixl infixr +syn match idris2Operators "\([-!#$%&\*\+./<=>\?@\\^|~:]\|\<_\>\)" +syn match idris2Type "\<[A-Z][a-zA-Z0-9_']*\>" +syn keyword idris2Todo TODO FIXME XXX HACK contained +syn match idris2LineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=idris2Todo,@Spell +syn match idris2DocComment "|||\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=idris2Todo,@Spell +syn match idris2MetaVar "?[a-zA-Z_][A-Za-z0-9_']*" +syn match idris2Pragma "%\(hide\|logging\|auto_lazy\|unbound_implicits\|prefix_record_projections\|ambiguity_depth\|nf_metavar_threshold\|search_timeout\|pair\|rewrite\|integerLit\|stringLit\|charLit\|doubleLit\|name\|start\|allow_overloads\|language\|default\|transform\|hint\|globalhint\|defaulthint\|inline\|noinline\|extern\|macro\|spec\|foreign\|nomangle\|builtin\|MkWorld\|World\|search\|runElab\|tcinline\|auto_implicit_depth\)" +syn match idris2Char "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" +syn match idris2Backtick "`[A-Za-z][A-Za-z0-9_']*`" +syn region idris2String start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell +syn region idris2BlockComment start="{-" end="-}" contains=idris2BlockComment,idris2Todo,@Spell +syn match idris2Identifier "[a-zA-Z][a-zA-z0-9_']*" contained + +" Default Highlighting {{{1 + +highlight def link idris2Deprecated Error +highlight def link idris2Identifier Identifier +highlight def link idris2Import Structure +highlight def link idris2Module Structure +highlight def link idris2Structure Structure +highlight def link idris2Statement Statement +highlight def link idris2Forall Structure +highlight def link idris2DataOpt Statement +highlight def link idris2DSL Statement +highlight def link idris2Block Statement +highlight def link idris2Annotation Statement +highlight def link idris2Where Structure +highlight def link idris2Let Structure +highlight def link idris2Totality Statement +highlight def link idris2Visibility Statement +highlight def link idris2Conditional Conditional +highlight def link idris2Pragma Statement +highlight def link idris2Number Number +highlight def link idris2Float Float +highlight def link idris2Delimiter Delimiter +highlight def link idris2Infix PreProc +highlight def link idris2Operators Operator +highlight def link idris2Type Include +highlight def link idris2DocComment Comment +highlight def link idris2LineComment Comment +highlight def link idris2BlockComment Comment +highlight def link idris2Todo Todo +highlight def link idris2MetaVar Macro +highlight def link idris2String String +highlight def link idris2Char String +highlight def link idris2Backtick Operator + +let b:current_syntax = "idris2" + +" vim: nowrap sw=2 sts=2 ts=8 noexpandtab ft=vim diff --git a/usr/share/vim/vim91/syntax/ipkg.vim b/usr/share/vim/vim91/syntax/ipkg.vim new file mode 100644 index 00000000000..218c2439838 --- /dev/null +++ b/usr/share/vim/vim91/syntax/ipkg.vim @@ -0,0 +1,66 @@ +" Vim syntax file +" Language: Ipkg +" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma +" Last Change: 2020 May 19 +" Version: 0.1 +" Author: ShinKage +" License: Vim (see :h license) +" Repository: https://github.com/ShinKage/idris2-nvim +" +" Syntax highlight for Idris 2 Package Descriptors (idris-lang.org) +" + +if exists("b:current_syntax") + finish +endif + +" we want to use line continuations (\) BEGINNING +let s:cpo_save = &cpo +set cpo&vim + +syn keyword ipkgKey + \ package + \ authors + \ maintainers + \ license + \ brief + \ readme + \ homepage + \ sourceloc + \ bugtracker + \ options + \ opts + \ sourcedir + \ builddir + \ outputdir + \ prebuild + \ postbuild + \ preinstall + \ postinstall + \ preclean + \ postclean + \ version + \ langversion + \ modules + \ main + \ executable + \ depends + +" we want to use line continuations (\) END +let &cpo = s:cpo_save +unlet s:cpo_save + +syn region ipkgString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell +syn match ipkgVersion "[0-9]*\([.][0-9]*\)*" +syn match ipkgName "[a-zA-Z][a-zA-z0-9_']*\([.][a-zA-Z][a-zA-z0-9_']*\)*" contained +syn match ipkgOperator "\(,\|&&\|<\|<=\|==\|>=\|>\)" +syn match ipkgComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell + +highlight def link ipkgKey Statement +highlight def link ipkgString String +highlight def link ipkgVersion Number +highlight def link ipkgName Identifier +highlight def link ipkgOperator Operator +highlight def link ipkgComment Comment + +let b:current_syntax = "ipkg" diff --git a/usr/share/vim/vim91/syntax/jinja.vim b/usr/share/vim/vim91/syntax/jinja.vim index 6000855ff7a..fa32c05f178 100644 --- a/usr/share/vim/vim91/syntax/jinja.vim +++ b/usr/share/vim/vim91/syntax/jinja.vim @@ -2,8 +2,9 @@ " Language: Jinja " Maintainer: Gregory Anders " Upstream: https://gitlab.com/HiPhish/jinja.vim +" Last Change: 2024 Oct 16 -if exists('b:current_syntax') +if exists('b:current_syntax') && b:current_syntax =~? 'jinja' finish endif diff --git a/usr/share/vim/vim91/syntax/lidris2.vim b/usr/share/vim/vim91/syntax/lidris2.vim new file mode 100644 index 00000000000..328ffdf6855 --- /dev/null +++ b/usr/share/vim/vim91/syntax/lidris2.vim @@ -0,0 +1,25 @@ +" Vim syntax file +" Language: Literate Idris 2 +" Maintainer: Idris Hackers (https://github.com/edwinb/idris2-vim), Serhii Khoma +" Last Change: 2020 May 19 +" Version: 0.1 +" License: Vim (see :h license) +" Repository: https://github.com/ShinKage/idris2-nvim +" +" This is just a minimal adaption of the Literate Haskell syntax file. + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" Read Idris highlighting. +syntax include @idris2Top syntax/idris2.vim + +" Recognize blocks of Bird tracks, highlight as Idris. +syntax region lidris2BirdTrackBlock start="^>" end="\%(^[^>]\)\@=" contains=@idris2Top,lidris2BirdTrack +syntax match lidris2BirdTrack "^>" contained + +hi def link lidris2BirdTrack Comment + +let b:current_syntax = "lidris2" diff --git a/usr/share/vim/vim91/syntax/org.vim b/usr/share/vim/vim91/syntax/org.vim new file mode 100644 index 00000000000..89c8de31b40 --- /dev/null +++ b/usr/share/vim/vim91/syntax/org.vim @@ -0,0 +1,71 @@ +" Vim syntax file +" Language: Org +" Maintainer: Luca Saccarola +" Last Change: 2024 Nov 14 +" +" Reference Specification: Org mode manual +" GNU Info: `$ info Org` +" Web: + +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif +let b:current_syntax = 'org' + +syn case ignore + +" Bold +syn region orgBold matchgroup=orgBoldDelimiter start="\(^\|[- '"({\]]\)\@<=\*\ze[^ ]" end="^\@!\*\([^\k\*]\|$\)\@=" keepend +hi def link orgBold markdownBold +hi def link orgBoldDelimiter orgBold + +" Italic +syn region orgItalic matchgroup=orgItalicDelimiter start="\(^\|[- '"({\]]\)\@<=\/\ze[^ ]" end="^\@!\/\([^\k\/]\|$\)\@=" keepend +hi def link orgItalic markdownItalic +hi def link orgItalicDelimiter orgItalic + +" Strikethrogh +syn region orgStrikethrough matchgroup=orgStrikethroughDelimiter start="\(^\|[ '"({\]]\)\@<=+\ze[^ ]" end="^\@!+\([^\k+]\|$\)\@=" keepend +hi def link orgStrikethrough markdownStrike +hi def link orgStrikethroughDelimiter orgStrikethrough + +" Underline +syn region orgUnderline matchgroup=orgUnderlineDelimiter start="\(^\|[- '"({\]]\)\@<=_\ze[^ ]" end="^\@!_\([^\k_]\|$\)\@=" keepend + +" Headlines +syn match orgHeadline "^\*\+\s\+.*$" keepend +hi def link orgHeadline Title + +" Line Comment +syn match orgLineComment /^\s*#\s\+.*$/ keepend +hi def link orgLineComment Comment + +" Block Comment +syn region orgBlockComment matchgroup=orgBlockCommentDelimiter start="\c^\s*#+BEGIN_COMMENT" end="\c^\s*#+END_COMMENT" keepend +hi def link orgBlockComment Comment +hi def link orgBlockCommentDelimiter Comment + +" Lists +syn match orgUnorderedListMarker "^\s*[-+]\s\+" keepend +hi def link orgUnorderedListMarker markdownOrderedListMarker +syn match orgOrderedListMarker "^\s*\(\d\|\a\)\+[.)]\s\+" keepend +hi def link orgOrderedListMarker markdownOrderedListMarker +" +" Verbatim +syn region orgVerbatimInline matchgroup=orgVerbatimInlineDelimiter start="\(^\|[- '"({\]]\)\@<==\ze[^ ]" end="^\@!=\([^\k=]\|$\)\@=" keepend +hi def link orgVerbatimInline markdownCodeBlock +hi def link orgVerbatimInlineDelimiter orgVerbatimInline +syn region orgVerbatimBlock matchgroup=orgVerbatimBlockDelimiter start="\c^\s*#+BEGIN_.*" end="\c^\s*#+END_.*" keepend +hi def link orgVerbatimBlock orgCode +hi def link orgVerbatimBlockDelimiter orgVerbatimBlock + +" Code +syn region orgCodeInline matchgroup=orgCodeInlineDelimiter start="\(^\|[- '"({\]]\)\@<=\~\ze[^ ]" end="^\@!\~\([^\k\~]\|$\)\@=" keepend +highlight def link orgCodeInline markdownCodeBlock +highlight def link orgCodeInlineDelimiter orgCodeInline +syn region orgCodeBlock matchgroup=orgCodeBlockDelimiter start="\c^\s*#+BEGIN_SRC.*" end="\c^\s*#+END_SRC" keepend +highlight def link orgCodeBlock markdownCodeBlock +highlight def link orgCodeBlockDelimiter orgCodeBlock + +" vim: ts=8 sts=2 sw=2 et diff --git a/usr/share/vim/vim91/syntax/racket.vim b/usr/share/vim/vim91/syntax/racket.vim index fcd64a7c9be..7dcca6082cd 100644 --- a/usr/share/vim/vim91/syntax/racket.vim +++ b/usr/share/vim/vim91/syntax/racket.vim @@ -4,7 +4,7 @@ " Previous Maintainer: Will Langstroth " URL: https://github.com/benknoble/vim-racket " Description: Contains all of the keywords in #lang racket -" Last Change: 2023 Sep 22 +" Last Change: 2024 Apr 14 " Initializing: if exists("b:current_syntax") @@ -30,7 +30,7 @@ endif " http://docs.racket-lang.org/reference/index.html " syntax keyword racketSyntax module module* module+ require provide quote -syntax keyword racketSyntax #%datum #%expression #%top #%variable-reference #%app +syntax keyword racketSyntax #%module-begin #%datum #%expression #%top #%variable-reference #%app syntax keyword racketSyntax lambda case-lambda let let* letrec syntax keyword racketSyntax let-values let*-values let-syntax letrec-syntax syntax keyword racketSyntax let-syntaxes letrec-syntaxes letrec-syntaxes+values diff --git a/usr/share/vim/vim91/syntax/shared/debversions.vim b/usr/share/vim/vim91/syntax/shared/debversions.vim index 56f18b969a6..404a0a49e3b 100644 --- a/usr/share/vim/vim91/syntax/shared/debversions.vim +++ b/usr/share/vim/vim91/syntax/shared/debversions.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Debian version information " Maintainer: Debian Vim Maintainers -" Last Change: 2024 May 25 +" Last Change: 2024 Nov 04 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/shared/debversions.vim let s:cpo = &cpo @@ -11,7 +11,7 @@ let g:debSharedSupportedVersions = [ \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy', \ 'bullseye', 'bookworm', 'trixie', 'forky', \ - \ 'focal', 'jammy', 'mantic', 'noble', 'oracular', + \ 'focal', 'jammy', 'noble', 'oracular', 'plucky', \ 'devel' \ ] let g:debSharedUnsupportedVersions = [ @@ -23,8 +23,8 @@ let g:debSharedUnsupportedVersions = [ \ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid', \ 'maverick', 'natty', 'oneiric', 'precise', 'quantal', 'raring', 'saucy', \ 'trusty', 'utopic', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', - \ 'artful', 'bionic', 'cosmic', 'disco', 'eoan', 'hirsute', - \ 'impish', 'kinetic', 'lunar', 'groovy' + \ 'artful', 'bionic', 'cosmic', 'disco', 'eoan', 'groovy', + \ 'hirsute', 'impish', 'kinetic', 'lunar', 'mantic', \ ] let &cpo=s:cpo diff --git a/usr/share/vim/vim91/syntax/structurizr.vim b/usr/share/vim/vim91/syntax/structurizr.vim index 363ee70438d..c10f1a4569e 100644 --- a/usr/share/vim/vim91/syntax/structurizr.vim +++ b/usr/share/vim/vim91/syntax/structurizr.vim @@ -1,10 +1,9 @@ " Vim syntax file " Language: Structurizr DSL " Maintainer: Bastian Venthur -" Last Change: 2022-05-22 +" Last Change: 2024-11-06 " Remark: For a language reference, see -" https://github.com/structurizr/dsl - +" https://docs.structurizr.com/dsl/language if exists("b:current_syntax") finish @@ -20,7 +19,11 @@ syn region scomment start="/\*" end="\*/" " keywords syn keyword skeyword animation syn keyword skeyword autoLayout +syn keyword skeyword background +syn keyword skeyword border syn keyword skeyword branding +syn keyword skeyword color +syn keyword skeyword colour syn keyword skeyword component syn keyword skeyword configuration syn keyword skeyword container @@ -37,48 +40,74 @@ syn keyword skeyword element syn keyword skeyword enterprise syn keyword skeyword exclude syn keyword skeyword filtered +syn keyword skeyword font +syn keyword skeyword fontsize syn keyword skeyword group syn keyword skeyword healthcheck +syn keyword skeyword height +syn keyword skeyword icon +syn keyword skeyword image syn keyword skeyword include syn keyword skeyword infrastructurenode syn keyword skeyword instances +syn keyword skeyword logo +syn keyword skeyword metadata syn keyword skeyword model +syn keyword skeyword opacity syn keyword skeyword person syn keyword skeyword perspectives syn keyword skeyword properties syn keyword skeyword relationship +syn keyword skeyword routing +syn keyword skeyword scope +syn keyword skeyword shape syn keyword skeyword softwaresystem syn keyword skeyword softwaresysteminstance +syn keyword skeyword stroke +syn keyword skeyword strokewidth syn keyword skeyword styles syn keyword skeyword systemcontext syn keyword skeyword systemlandscape +syn keyword skeyword tag syn keyword skeyword tags syn keyword skeyword technology syn keyword skeyword terminology syn keyword skeyword theme syn keyword skeyword themes +syn keyword skeyword thickness +syn keyword skeyword this syn keyword skeyword title syn keyword skeyword url syn keyword skeyword users syn keyword skeyword views +syn keyword skeyword visibility +syn keyword skeyword width syn keyword skeyword workspace syn match skeyword "\!adrs\s\+" -syn match skeyword "\!constant\s\+" +syn match skeyword "\!components\s\+" syn match skeyword "\!docs\s\+" +syn match skeyword "\!element\s\+" +syn match skeyword "\!elements\s\+" +syn match skeyword "\!extend\s\+" syn match skeyword "\!identifiers\s\+" syn match skeyword "\!impliedrelationships\s\+" syn match skeyword "\!include\s\+" syn match skeyword "\!plugin\s\+" syn match skeyword "\!ref\s\+" +syn match skeyword "\!relationship\s\+" +syn match skeyword "\!relationships\s\+" syn match skeyword "\!script\s\+" syn region sstring oneline start='"' end='"' syn region sblock start='{' end='}' fold transparent +syn match soperator "\->\s+" + hi def link sstring string hi def link scomment comment hi def link skeyword keyword +hi def link soperator operator let b:current_syntax = "structurizr" diff --git a/usr/share/vim/vim91/syntax/swayconfig.vim b/usr/share/vim/vim91/syntax/swayconfig.vim index d09d476a5ab..94b9a913fcf 100644 --- a/usr/share/vim/vim91/syntax/swayconfig.vim +++ b/usr/share/vim/vim91/syntax/swayconfig.vim @@ -3,7 +3,7 @@ " Original Author: Josef Litos (JosefLitos/i3config.vim) " Maintainer: James Eapen " Version: 1.2.4 -" Last Change: 2024-05-24 +" Last Change: 2024 Oct 17 " References: " http://i3wm.org/docs/userguide.html#configuring @@ -29,7 +29,7 @@ syn keyword i3ConfigConditionProp app_id pid shell contained syn keyword i3ConfigWorkspaceDir prev_on_output next_on_output contained -syn match i3ConfigBindArgument /--\(locked\|to-code\|no-repeat\|input-device=[^ '"]*\|no-warn\) / contained contains=i3ConfigShOper,@i3ConfigStrVar nextgroup=i3ConfigBindArgument,i3ConfigBindCombo +syn match i3ConfigBindArgument /--\(locked\|to-code\|no-repeat\|input-device=[^ '"]*\|no-warn\|inhibited\) / contained contains=i3ConfigShOper,@i3ConfigStrVar nextgroup=i3ConfigBindArgument,i3ConfigBindCombo syn region i3ConfigBindArgument start=/--input-device=['"]/ end=/\s/ contained contains=@i3ConfigIdent,i3ConfigShOper,i3ConfigString nextgroup=i3ConfigBindArgument,i3ConfigBindCombo syn region i3ConfigBindCombo matchgroup=i3ConfigParen start=/{$/ end=/^\s*}$/ contained contains=i3ConfigBindArgument,i3ConfigBindCombo,i3ConfigComment fold keepend extend diff --git a/usr/share/vim/vim91/syntax/tex.vim b/usr/share/vim/vim91/syntax/tex.vim index d782bd48457..77a40e11d34 100644 --- a/usr/share/vim/vim91/syntax/tex.vim +++ b/usr/share/vim/vim91/syntax/tex.vim @@ -109,9 +109,9 @@ if s:tex_fold_enabled && &fdm == "manual" setl fdm=syntax endif if s:tex_fold_enabled && has("folding") - com! -nargs=* TexFold fold + com! -nargs=* TexFold fold else - com! -nargs=* TexFold + com! -nargs=* TexFold endif " (La)TeX keywords: uses the characters 0-9,a-z,A-Z,192-255 only... {{{1 @@ -424,7 +424,7 @@ if s:tex_fast =~# 'b' syn region texEmphStyle matchgroup=texTypeStyle start="\\texts[cfl]\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell syn region texEmphStyle matchgroup=texTypeStyle start="\\textup\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell syn region texEmphStyle matchgroup=texTypeStyle start="\\texttt\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell - else + else syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup diff --git a/usr/share/vim/vim91/syntax/tutor.vim b/usr/share/vim/vim91/syntax/tutor.vim new file mode 100644 index 00000000000..83ca547fddb --- /dev/null +++ b/usr/share/vim/vim91/syntax/tutor.vim @@ -0,0 +1,77 @@ +if exists("b:current_syntax") + finish +endif + +syn include @VIM syntax/vim.vim +unlet b:current_syntax +syn include @TUTORSHELL syntax/sh.vim +unlet b:current_syntax +syn include @VIMNORMAL syntax/vimnormal.vim + +syn match tutorLink /\[.\{-}\](.\{-})/ contains=tutorInlineNormal +syn match tutorLinkBands /\[\|\]\|(\|)/ contained containedin=tutorLink,tutorLinkAnchor conceal +syn match tutorLinkAnchor /(.\{-})/ contained containedin=tutorLink conceal +syn match tutorURL /\(https\?\|file\):\/\/[[:graph:]]\+\>\/\?/ +syn match tutorEmail /\<[[:graph:]]\+@[[:graph:]]\+\>/ +syn match tutorInternalAnchor /\*[[:alnum:]-]\+\*/ contained conceal containedin=tutorSection + +syn match tutorSection /^#\{1,6}\s.\+$/ fold contains=tutorInlineNormal +syn match tutorSectionBullet /#/ contained containedin=tutorSection + +syn match tutorTOC /\ctable of contents:/ + +syn match tutorConcealedEscapes /\\[`*!\[\]():$-]\@=/ conceal + +syn region tutorEmphasis matchgroup=Delimiter start=/[\*]\@ -" Last Change: 2024-07-14 +" Last Change: 2024 Nov 02 " Based on: https://github.com/kaarmu/typst.vim if exists('b:current_syntax') @@ -18,8 +18,8 @@ syntax cluster typstCommon " Common > Comment {{{2 syntax cluster typstComment \ contains=typstCommentBlock,typstCommentLine -syntax match typstCommentBlock - \ #/\*\%(\_.\{-}\)\*/# +syntax region typstCommentBlock + \ start="/\*" end="\*/" keepend \ contains=typstCommentTodo,@Spell syntax match typstCommentLine \ #//.*# diff --git a/usr/share/vim/vim91/syntax/vim.vim b/usr/share/vim/vim91/syntax/vim.vim index 28fdda5215c..eea6e82a89f 100644 --- a/usr/share/vim/vim91/syntax/vim.vim +++ b/usr/share/vim/vim91/syntax/vim.vim @@ -240,7 +240,7 @@ syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSub syn case match " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNorm,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList syn cluster vim9CmdList contains=vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand @@ -252,6 +252,7 @@ syn match vimVar "\s\zs&t_\S[a-zA-Z0-9]\>" syn match vimVar "\s\zs&t_k;" syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn keyword vimCommand contained in +syn match vimBang contained "!" syn cluster vimExprList contains=vimEnvvar,vimFunc,vimNumber,vimOper,vimOperParen,vimLetRegister,vimString,vimVar,@vim9ExprList syn cluster vim9ExprList contains=vim9Boolean,vim9Null @@ -857,10 +858,10 @@ syn keyword vimMatchNone contained none syn case match syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline -" Norm: {{{2 -" ==== -syn match vimNorm "\!\=" skipwhite nextgroup=vimNormalArg contains=vimBang +syn region vimNormalArg contained start="\S" skip=+\n\s*\\\|\n\s*["#]\\ + end="$" contains=@vimContinue " Sleep: {{{2 " ===== @@ -1417,7 +1418,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimMenutranslateComment vimComment hi def link vim9MethodName vimFuncName hi def link vimMtchComment vimComment - hi def link vimNorm vimCommand + hi def link vimNormal vimCommand hi def link vimNotation Special hi def link vimNotFunc vimCommand hi def link vimNotPatSep vimString diff --git a/usr/share/vim/vim91/syntax/vimnormal.vim b/usr/share/vim/vim91/syntax/vimnormal.vim new file mode 100644 index 00000000000..df672c52364 --- /dev/null +++ b/usr/share/vim/vim91/syntax/vimnormal.vim @@ -0,0 +1,16 @@ +syn match normalOp /[dcrypoaxv!"#%&.-\/:<>=?@ABCDGHIJKLMNOPQRSUVWXYZgmqstz~iu]/ nextgroup=normalMod +syn match normalMod /m\@BW\[\]`bstweE{}ftFT;,$]/ +syn match normalCount /[0-9]/ +syn region normalSearch start=/[/?]\@<=./ end=/.\@=/ contains=normalKey keepend +syn region normalChange start=/\([cr][wWbBeE()\[\]{}pst]\)\@<=./ end=/.\@=/ contains=normalKey keepend +syn match normalCharSearch /\c[ftr]\@<=\w/ +syn match normalMark /\(f\@'\@!/ + +hi! link normalOp Operator +hi! link normalMod PreProc +hi! link normalObject Structure +hi! link normalCount Number +hi! link normalMark Identifier +hi! link normalKey Special diff --git a/usr/share/vim/vim91/tutor/en/vim-01-beginner.tutor b/usr/share/vim/vim91/tutor/en/vim-01-beginner.tutor new file mode 100644 index 00000000000..ebb946158c7 --- /dev/null +++ b/usr/share/vim/vim91/tutor/en/vim-01-beginner.tutor @@ -0,0 +1,980 @@ +# Welcome to the VIM Tutor + +Vim is a very powerful editor that has many commands, too many to explain in +a tutor such as this. This tutor is designed to describe enough of the +commands that you will be able to easily use Vim as an all-purpose editor. +It is IMPORTANT to remember that this tutor is set up to teach by use. That +means that you need to do the exercises to learn them properly. If you only +read the text, you will soon forget what is most important! + +For now, make sure that your Shift-Lock key is NOT depressed and press the +`j`{normal} key enough times to move the cursor so that Lesson 0 completely +fills the screen. + +# Lesson 0 + +NOTE: The commands in the lessons will modify the text, but those changes +won't be saved. Don't worry about messing things up; just remember that +pressing []() and then [u](u) will undo the latest change. + +This tutorial is interactive, and there are a few things you should know. +- Type []() on links [like this](holy-grail ) to open the linked help section. +- Or simply type [K](K) on any word to find its documentation! +- Sometimes you will be required to modify text like +this here +Once you have done the changes correctly, the ✗ sign at the left will change +to ✓. I imagine you can already see how neat Vim can be. ;) +Other times, you'll be prompted to run a command (I'll explain this later): +~~~ cmd + :help +~~~ +or press a sequence of keys +~~~ normal + 0fd3wP$P +~~~ + +Text within <'s and >'s (like ``{normal}) describes a key to press +instead of text to type. + +Now, move to the next lesson (use the `j`{normal} key to scroll down). + +## Lesson 1.1: MOVING THE CURSOR + +** To move the cursor, press the `h`, `j`, `k`, `l` keys as indicated. ** + + ↑ + k Hint: The `h`{normal} key is at the left and moves left. + ← h l → The `l`{normal} key is at the right and moves right. + j The `j`{normal} key looks like a down arrow. + ↓ + + 1. Move the cursor around the screen until you are comfortable. + + 2. Hold down the down key (`j`{normal}) until it repeats. + Now you know how to move to the next lesson. + + 3. Using the down key, move to Lesson 1.2. + +NOTE: If you are ever unsure about something you typed, press to place + you in Normal mode. Then retype the command you wanted. + +NOTE: The cursor keys should also work. But using hjkl you will be able to + move around much faster, once you get used to it. Really! + +# Lesson 1.2: EXITING VIM + +!! NOTE: Before executing any of the steps below, +read this entire lesson !! + + 1. Press the key (to make sure you are in Normal mode). + + 2. Type: + + `:q!`{vim} ``{normal}. + + This exits the editor, DISCARDING any changes you have made. + + 3. Open vim and get back here by executing the command that got you into + this tutor. That might be: + + :Tutor + + 4. If you have these steps memorized and are confident, execute steps + 1 through 3 to exit and re-enter the editor. + +NOTE: [:q!](:q) discards any changes you made. In a few lessons you + will learn how to save the changes to a file. + + 5. Move the cursor down to Lesson 1.3. + +## Lesson 1.3: TEXT EDITING - DELETION + +** Press `x`{normal} to delete the character under the cursor. ** + + 1. Move the cursor to the line below marked ✗. + + 2. To fix the errors, move the cursor until it is on top of the + character to be deleted. + + 3. Press [the x key](x) to delete the unwanted character. + + 4. Repeat steps 2 through 4 until the sentence is correct. + +The ccow jumpedd ovverr thhe mooon. + + 5. Now that the line is correct, go on to Lesson 1.4. + +NOTE: As you go through this tutor, do not try to memorize, learn by + usage. + +# Lesson 1.4: TEXT EDITING: INSERTION + +** Press `i`{normal} to insert text. ** + + 1. Move the cursor to the first line below marked ✗. + + 2. To make the first line the same as the second, move the cursor on top + of the first character AFTER where the text is to be inserted. + + 3. Press `i`{normal} and type in the necessary additions. + + 4. As each error is fixed press ``{normal} to return to Normal mode. + Repeat steps 2 through 4 to correct the sentence. + +There is text misng this . +There is some text missing from this line. + + 5. When you are comfortable inserting text move to Lesson 1.5. + +# Lesson 1.5: TEXT EDITING: APPENDING + +** Press `A`{normal} to append text. ** + + 1. Move the cursor to the first line below marked ✗. + It does not matter on what character the cursor is in that line. + + 2. Press [A](A) and type in the necessary additions. + + 3. As the text has been appended press ``{normal} to return to Normal + mode. + + 4. Move the cursor to the second line marked ✗ and repeat + steps 2 and 3 to correct this sentence. + +There is some text missing from th +There is some text missing from this line. +There is also some text miss +There is also some text missing here. + + 5. When you are comfortable appending text move to Lesson 1.6. + +# Lesson 1.6: EDITING A FILE + +** Use `:wq`{vim} to save a file and exit. ** + +!! NOTE: Before executing any of the steps below, read this entire lesson !! + + 1. Exit this tutor as you did in Lesson 1.2: `:q!`{vim} + Or, if you have access to another terminal, do the following there. + + 2. At the shell prompt type this command: +~~~ sh + $ vim tutor +~~~ + '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. + + 3. Insert and delete text as you learned in the previous lessons. + + 4. Save the file with changes and exit Vim with: +~~~ cmd + :wq +~~~ + + Note you'll need to press `` to execute the command. + + 5. If you have quit vimtutor in step 1 restart the vimtutor and move down + to the following summary. + + 6. After reading the above steps and understanding them: do it. + +# Lesson 1 SUMMARY + + 1. The cursor is moved using either the arrow keys or the hjkl keys. + h (left) j (down) k (up) l (right) + + 2. To start Vim from the shell prompt type: + +~~~ sh + $ vim FILENAME +~~~ + + 3. To exit Vim type: ``{normal} `:q!`{vim} ``{normal} to trash + all changes. + OR type: ``{normal} `:wq`{vim} ``{normal} to save + the changes. + + 4. To delete the character at the cursor type: `x`{normal} + + 5. To insert or append text type: + `i`{normal} insert text ``{normal} insert before the cursor. + `A`{normal} append text ``{normal} append after the line. + +NOTE: Pressing ``{normal} will place you in Normal mode or will cancel + an unwanted and partially completed command. + +Now continue with Lesson 2. + +# Lesson 2.1: DELETION COMMANDS + +** Type `dw`{normal} to delete a word. ** + + 1. Press ``{normal} to make sure you are in Normal mode. + + 2. Move the cursor to the line below marked ✗. + + 3. Move the cursor to the beginning of a word that needs to be deleted. + + 4. Type [d](d)[w](w) to make the word disappear. + +There are a some words fun that don't belong paper in this sentence. + + 5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2. + +# Lesson 2.2: MORE DELETION COMMANDS + +** Type `d$`{normal} to delete to the end of the line. ** + + 1. Press ``{normal} to make sure you are in Normal mode. + + 2. Move the cursor to the line below marked ✗. + + 3. Move the cursor to the end of the correct line (AFTER the first . ). + + 4. Type `d$`{normal} to delete to the end of the line. + +Somebody typed the end of this line twice. end of this line twice. + + 5. Move on to Lesson 2.3 to understand what is happening. + +# Lesson 2.3: ON OPERATORS AND MOTIONS + +Many commands that change text are made from an [operator](operator) and +a [motion](navigation). +The format for a delete command with the [d](d) delete operator is as follows: + + d motion + + Where: + d - is the delete operator. + motion - is what the operator will operate on (listed below). + + A short list of motions: + [w](w) - until the start of the next word, EXCLUDING its first character. + [e](e) - to the end of the current word, INCLUDING the last character. + [$]($) - to the end of the line, INCLUDING the last character. + + Thus typing `de`{normal} will delete from the cursor to the end of the word. + +NOTE: Pressing just the motion while in Normal mode without an operator + will move the cursor as specified. + +# Lesson 2.4: USING A COUNT FOR A MOTION + +** Typing a number before a motion repeats it that many times. ** + + 1. Move the cursor to the start of the line marked ✓ below. + + 2. Type `2w`{normal} to move the cursor two words forward. + + 3. Type `3e`{normal} to move the cursor to the end of the third word forward. + + 4. Type `0`{normal} ([zero](0)) to move to the start of the line. + + 5. Repeat steps 2 and 3 with different numbers. + +This is just a line with words you can move around in. + + 6. Move on to Lesson 2.5. + +# Lesson 2.5: USING A COUNT TO DELETE MORE + +** Typing a number with an operator repeats it that many times. ** + +In the combination of the delete operator and a motion mentioned above you +insert a count before the motion to delete more: + d number motion + + 1. Move the cursor to the first UPPER CASE word in the line marked ✗. + + 2. Type `d2w`{normal} to delete the two UPPER CASE words + + 3. Repeat steps 1 and 2 with a different count to delete the consecutive + UPPER CASE words with one command + +This ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. + +# Lesson 2.6: OPERATING ON LINES + +** Type `dd`{normal} to delete a whole line. ** + +Due to the frequency of whole line deletion, the designers of Vi decided +it would be easier to simply type two d's to delete a line. + + 1. Move the cursor to the second line in the phrase below. + 2. Type [dd](dd) to delete the line. + 3. Now move to the fourth line. + 4. Type `2dd`{normal} to delete two lines. + +1) Roses are red, +2) Mud is fun, +3) Violets are blue, +4) I have a car, +5) Clocks tell time, +6) Sugar is sweet +7) And so are you. + +# Lesson 2.7: THE UNDO COMMAND + +** Press `u`{normal} to undo the last commands, `U`{normal} to fix a whole line. ** + + 1. Move the cursor to the line below marked ✗ and place it on the + first error. + 2. Type `x`{normal} to delete the first unwanted character. + 3. Now type `u`{normal} to undo the last command executed. + 4. This time fix all the errors on the line using the `x`{normal} command. + 5. Now type a capital `U`{normal} to return the line to its original state. + 6. Now type `u`{normal} a few times to undo the `U`{normal} and preceding + commands. + 7. Now type ``{normal} (Control + R) a few times to redo the commands + (undo the undos). + +Fiix the errors oon thhis line and reeplace them witth undo. + + 8. These are very useful commands. Now move on to the Lesson 2 Summary. + +# Lesson 2 SUMMARY + + 1. To delete from the cursor up to the next word type: `dw`{normal} + 2. To delete from the cursor to the end of a line type: `d$`{normal} + 3. To delete a whole line type: `dd`{normal} + 4. To repeat a motion prepend it with a number: `2w`{normal} + + 5. The format for a change command is: + operator [number] motion + where: + operator - is what to do, such as [d](d) for delete + [number] - is an optional count to repeat the motion + motion - moves over the text to operate on, such as: + [w](w) (word), + [$]($) (to the end of line), etc. + + 6. To move to the start of the line use a zero: [0](0) + + 7. To undo previous actions, type: `u`{normal} (lowercase u) + To undo all the changes on a line, type: `U`{normal} (capital U) + To undo the undo's, type: ``{normal} + +# Lesson 3.1: THE PUT COMMAND + +** Type `p`{normal} to put previously deleted text after the cursor. ** + + 1. Move the cursor to the first ✓ line below. + + 2. Type `dd`{normal} to delete the line and store it in a Vim register. + + 3. Move the cursor to the c) line, ABOVE where the deleted line should go. + + 4. Type `p`{normal} to put the line below the cursor. + + 5. Repeat steps 2 through 4 to put all the lines in correct order. + +d) Can you learn too? +b) Violets are blue, +c) Intelligence is learned, +a) Roses are red, + +# Lesson 3.2: THE REPLACE COMMAND + +** Type `rx`{normal} to replace the character at the cursor with x. ** + + 1. Move the cursor to the first line below marked ✗. + + 2. Move the cursor so that it is on top of the first error. + + 3. Type `r`{normal} and then the character which should be there. + + 4. Repeat steps 2 and 3 until the first line is equal to the second one. + +Whan this lime was tuoed in, someone presswd some wrojg keys! +When this line was typed in, someone pressed some wrong keys! + + 5. Now move on to Lesson 3.3. + +NOTE: Remember that you should be learning by doing, not memorization. + +# Lesson 3.3: THE CHANGE OPERATOR + +** To change until the end of a word, type `ce`{normal}. ** + + 1. Move the cursor to the first line below marked ✗. + + 2. Place the cursor on the "u" in "lubw". + + 3. Type `ce`{normal} and the correct word (in this case, type "ine" ). + + 4. Press ``{normal} and move to the next character that needs to be + changed. + + 5. Repeat steps 3 and 4 until the first sentence is the same as the second. + +This lubw has a few wptfd that mrrf changing usf the change operator. +This line has a few words that need changing using the change operator. + +Notice that [c](c)e deletes the word and places you in Insert mode. + +# Lesson 3.4: MORE CHANGES USING `c`{normal} + +** The change operator is used with the same motions as delete. ** + + 1. The change operator works in the same way as delete. The format is: + + c [number] motion + + 2. The motions are the same, such as `w`{normal} (word) and `$`{normal} (end of line). + + 3. Move to the first line below marked ✗. + + 4. Move the cursor to the first error. + + 5. Type `c$`{normal} and type the rest of the line like the second and press ``{normal}. + +The end of this line needs some help to make it like the second. +The end of this line needs to be corrected using the `c$`{normal} command. + +NOTE: You can use the Backspace key to correct mistakes while typing. + +# Lesson 3 SUMMARY + + 1. To put back text that has just been deleted, type [p](p). This puts the + deleted text AFTER the cursor (if a line was deleted it will go on the + line below the cursor). + + 2. To replace the character under the cursor, type [r](r) and then the + character you want to have there. + + 3. The [change operator](c) allows you to change from the cursor to where + the motion takes you. Type `ce`{normal} to change from the cursor to the + end of the word, `c$`{normal} to change to the end of a line. + + 4. The format for change is: + + c [number] motion + +Now go on to the next lesson. + +# Lesson 4.1: CURSOR LOCATION AND FILE STATUS + +** Type ``{normal} to show your location in a file and the file status. + Type `G`{normal} to move to a line in the file. ** + +NOTE: Read this entire lesson before executing any of the steps!! + + 1. Hold down the ``{normal} key and press `g`{normal}. We call this + ``{normal}. A message will appear at the bottom of the page with the + filename and the position in the file. Remember the line number for + Step 3. + +NOTE: You may see the cursor position in the lower right corner of the + screen. This happens when the ['ruler']('ruler') option is set. + 2. Press [G](G) to move you to the bottom of the file. + Type [gg](gg) to move you to the start of the file. + + 3. Type the number of the line you were on and then `G`{normal}. This will + return you to the line you were on when you first pressed ``{normal}. + + 4. If you feel confident to do this, execute steps 1 through 3. + +# Lesson 4.2: THE SEARCH COMMAND + +** Type `/`{normal} followed by a phrase to search for the phrase. ** + + 1. In Normal mode type the `/`{normal} character. Notice that it and the + cursor appear at the bottom of the screen as with the `:`{normal} command. + + 2. Now type 'errroor' ``{normal}. This is the word you want to search + for. + + 3. To search for the same phrase again, simply type [n](n). + To search for the same phrase in the opposite direction, type [N](N). + + 4. To search for a phrase in the backward direction, use [?](?) instead + of `/`{normal}. + + 5. To go back to where you came from press ``{normal} (keep ``{normal} pressed down while pressing the letter `o`{normal}). Repeat to go back + further. ``{normal} goes forward. + +"errroor" is not the way to spell error; errroor is an error. + +NOTE: When the search reaches the end of the file it will continue at the + start, unless the ['wrapscan']('wrapscan') option has been reset. + +# Lesson 4.3: MATCHING PARENTHESES SEARCH + +** Type `%`{normal} to find a matching ),], or }. ** + + 1. Place the cursor on any (, [, or { in the line below marked ✓. + + 2. Now type the [%](%) character. + + 3. The cursor will move to the matching parenthesis or bracket. + + 4. Type `%`{normal} to move the cursor to the other matching bracket. + + 5. Move the cursor to another (,),[,],{ or } and see what `%`{normal} does. + +This ( is a test line with ('s, ['s ] and {'s } in it. )) + +NOTE: This is very useful in debugging a program with unmatched parentheses! + +# Lesson 4.4: THE SUBSTITUTE COMMAND + +** Type `:s/old/new/g` to substitute "new" for "old". ** + + 1. Move the cursor to the line below marked ✗. + + 2. Type +~~~ cmd + :s/thee/the/ +~~~ + + NOTE that the [:s](:s) command only changed the first occurrence of "thee" in the line. + + 3. Now type +~~~ cmd + :s/thee/the/g +~~~ + + Adding the g [flag](:s_flags) means to substitute globally in the line, + change all occurrences of "thee" in the line. + +Usually thee best time to see thee flowers is in thee spring. + + 4. To change every occurrence of a character string between two lines, type +~~~ cmd + :#,#s/old/new/g +~~~ + where #,# are the line numbers of the range of lines where the + substitution is to be done. + + Type +~~~ cmd + :%s/old/new/g +~~~ + to change every occurrence in the whole file. + + Type +~~~ cmd + :%s/old/new/gc +~~~ + to find every occurrence in the whole file, with a prompt whether to + substitute or not. + +# Lesson 4 SUMMARY + + 1. ``{normal} displays your location and the file status. + `G`{normal} moves to the end of the file. + number `G`{normal} moves to that line number. + `gg`{normal} moves to the first line. + + 2. Typing `/`{normal} followed by a phrase searches FORWARD for the phrase. + Typing `?`{normal} followed by a phrase searches BACKWARD for the phrase. + After a search type `n`{normal} to find the next occurrence in the same + direction or `N`{normal} to search in the opposite direction. + ``{normal} takes you back to older positions, ``{normal} to + newer positions. + + 3. Typing `%`{normal} while the cursor is on a (,),[,],{, or } goes to its + match. + + 4. To substitute new for the first old in a line type +~~~ cmd + :s/old/new +~~~ + To substitute new for all 'old's on a line type +~~~ cmd + :s/old/new/g +~~~ + To substitute phrases between two line #'s type +~~~ cmd + :#,#s/old/new/g +~~~ + To substitute all occurrences in the file type +~~~ cmd + :%s/old/new/g +~~~ + To ask for confirmation each time add 'c' +~~~ cmd + :%s/old/new/gc +~~~ + +# Lesson 5.1: HOW TO EXECUTE AN EXTERNAL COMMAND + +** Type `:!`{vim} followed by an external command to execute that command. ** + + 1. Type the familiar command `:`{normal} to set the cursor at the bottom of + the screen. This allows you to enter a command-line command. + + 2. Now type the [!](!cmd) (exclamation point) character. This allows you to + execute any external shell command. + + 3. As an example type "ls" following the "!" and then hit ``{normal}. + This will show you a listing of your directory, just as if you were + at the shell prompt. + +NOTE: It is possible to execute any external command this way, also with + arguments. + +NOTE: All `:`{vim} commands must be finished by hitting ``{normal}. + From here on we will not always mention it. + +# Lesson 5.2: MORE ON WRITING FILES + +** To save the changes made to the text, type `:w`{vim} FILENAME. ** + + 1. Type `:!ls`{vim} to get a listing of your directory. + You already know you must hit ``{normal} after this. + + 2. Choose a filename that does not exist yet, such as TEST. + + 3. Now type: +~~~ cmd + :w TEST +~~~ + (where TEST is the filename you chose.) + + 4. This saves the whole file (the Vim Tutor) under the name TEST. + To verify this, type `:!ls`{vim} again to see your directory. + +NOTE: If you were to exit Vim and start it again with `vim TEST`, the file + would be an exact copy of the tutor when you saved it. + + 5. Now remove the file by typing: +~~~ cmd + :!rm TEST +~~~ + +# Lesson 5.3: SELECTING TEXT TO WRITE + +** To save part of the file, type `v`{normal} motion `:w FILENAME`{vim}. ** + + 1. Move the cursor to this line. + + 2. Press [v](v) and move the cursor to the fifth item below. Notice that the + text is highlighted. + + 3. Press the `:`{normal} character. At the bottom of the screen + + :'<,'> + + will appear. + + 4. Type + + `:w TEST`{vim} + + where TEST is a filename that does not exist yet. Verify that you see + + `:'<,'>w TEST`{vim} + + before you press ``{normal}. + + 5. Vim will write the selected lines to the file TEST. Use `:!ls`{vim} to see it. Do not remove it yet! We will use it in the next lesson. + +NOTE: Pressing [v](v) starts [Visual selection](visual-mode). You can move + the cursor around to make the selection bigger or smaller. Then you can + use an operator to do something with the text. For example, `d`{normal} + deletes the text. + +# Lesson 5.4: RETRIEVING AND MERGING FILES + +** To insert the contents of a file, type `:r FILENAME`{vim}. ** + + 1. Place the cursor just above this line. + +NOTE: After executing Step 2 you will see text from Lesson 5.3. Then move + DOWN to see this lesson again. + + 2. Now retrieve your TEST file using the command + + `:r TEST`{vim} + + where TEST is the name of the file you used. + The file you retrieve is placed below the cursor line. + + 3. To verify that a file was retrieved, cursor back and notice that there + are now two copies of Lesson 5.3, the original and the file version. + +NOTE: You can also read the output of an external command. For example, + + `:r !ls`{vim} + + reads the output of the `ls` command and puts it below the cursor. + +# Lesson 5 SUMMARY + + 1. [:!command](:!cmd) executes an external command. + + Some useful examples are: + `:!ls`{vim} - shows a directory listing + `:!rm FILENAME`{vim} - removes file FILENAME + + 2. [:w](:w) FILENAME writes the current Vim file to disk with + name FILENAME. + + 3. [v](v) motion :w FILENAME saves the Visually selected lines in file + FILENAME. + + 4. [:r](:r) FILENAME retrieves disk file FILENAME and puts it + below the cursor position. + + 5. [:r !dir](:r!) reads the output of the dir command and + puts it below the cursor position. + +# Lesson 6.1: THE OPEN COMMAND + +** Type `o`{normal} to open a line below the cursor and place you in Insert mode. ** + + 1. Move the cursor to the line below marked ✓. + + 2. Type the lowercase letter `o`{normal} to [open](o) up a line BELOW the + cursor and place you in Insert mode. + + 3. Now type some text and press ``{normal} to exit Insert mode. + +After typing `o`{normal} the cursor is placed on the open line in Insert mode. + + 4. To open up a line ABOVE the cursor, simply type a [capital O](O), rather + than a lowercase `o`{normal}. Try this on the line below. + +Open up a line above this by typing O while the cursor is on this line. + +# Lesson 6.2: THE APPEND COMMAND + +** Type `a`{normal} to insert text AFTER the cursor. ** + + 1. Move the cursor to the start of the line below marked ✗. + + 2. Press `e`{normal} until the cursor is on the end of "li". + + 3. Type the lowercase letter `a`{normal} to [append](a) text AFTER the + cursor. + + 4. Complete the word like the line below it. Press ``{normal} to exit + Insert mode. + + 5. Use `e`{normal} to move to the next incomplete word and repeat steps 3 + and 4. + +This li will allow you to pract appendi text to a line. +This line will allow you to practice appending text to a line. + +NOTE: [a](a), [i](i) and [A](A) all go to the same Insert mode, the only + difference is where the characters are inserted. + +# Lesson 6.3: ANOTHER WAY TO REPLACE + +** Type a capital `R`{normal} to replace more than one character. ** + + 1. Move the cursor to the first line below marked ✗. Move the cursor to + the beginning of the first "xxx". + + 2. Now press `R`{normal} ([capital R](R)) and type the number below it in the + second line, so that it replaces the "xxx". + + 3. Press ``{normal} to leave [Replace mode](mode-replace). Notice that + the rest of the line remains unmodified. + + 4. Repeat the steps to replace the remaining "xxx". + +Adding 123 to xxx gives you xxx. +Adding 123 to 456 gives you 579. + +NOTE: Replace mode is like Insert mode, but every typed character deletes an + existing character. + +# Lesson 6.4: COPY AND PASTE TEXT + +** Use the `y`{normal} operator to copy text and `p`{normal} to paste it. ** + + 1. Go to the line marked with ✓ below and place the cursor after "a)". + + 2. Start Visual mode with `v`{normal} and move the cursor to just before + "first". + + 3. Type `y`{normal} to [yank](yank) (copy) the highlighted text. + + 4. Move the cursor to the end of the next line: `j$`{normal} + + 5. Type `p`{normal} to [put](put) (paste) the text. + + 6. Press `a`{normal} and then type "second". Press ``{normal} to leave + Insert mode. + + 7. Use Visual mode to select "item.", yank it with `y`{normal}, move to the + end of the next line with `j$`{normal} and put the text there with `p`{normal} + +a) This is the first item. +b) + +NOTE: you can use `y`{normal} as an operator: `yw`{normal} yanks one word. + +# Lesson 6.5: SET OPTION + +** Set an option so a search or substitute ignores case. ** + + 1. Search for 'ignore' by entering: `/ignore` + Repeat several times by pressing `n`{normal}. + + 2. Set the 'ic' (Ignore case) option by entering: +~~~ cmd + :set ic +~~~ + 3. Now search for 'ignore' again by pressing `n`{normal}. + Notice that Ignore and IGNORE are now also found. + + 4. Set the 'hlsearch' and 'incsearch' options: +~~~ cmd + :set hls is +~~~ + 5. Now type the search command again and see what happens: /ignore + + 6. To disable ignoring case enter: +~~~ cmd + :set noic +~~~ + 7. To toggle the value of a setting, prepend it with "inv": +~~~ cmd + :set invic +~~~ +NOTE: To remove the highlighting of matches enter: +~~~ cmd + :nohlsearch +~~~ +NOTE: If you want to ignore case for just one search command, use [\c](/\c) + in the phrase: /ignore\c + +# Lesson 6 SUMMARY + + 1. Type `o`{normal} to open a line BELOW the cursor and start Insert mode. + Type `O`{normal} to open a line ABOVE the cursor. + + 2. Type `a`{normal} to insert text AFTER the cursor. + Type `A`{normal} to insert text after the end of the line. + + 3. The `e`{normal} command moves to the end of a word. + + 4. The `y`{normal} operator copies text, `p`{normal} pastes it. + + 5. Typing a capital `R`{normal} enters Replace mode until ``{normal} is + pressed. + + 6. Typing "[:set](:set) xxx" sets the option "xxx". Some options are: + + 'ic' 'ignorecase' ignore upper/lower case when searching + 'is' 'incsearch' show partial matches for a search phrase + 'hls' 'hlsearch' highlight all matching phrases + + You can either use the long or the short option name. + + 7. Prepend "no" to switch an option off: +~~~ cmd + :set noic +~~~ + 8. Prepend "inv" to toggle an option: +~~~ cmd + :set invic +~~~ + +# Lesson 7.1: GETTING HELP + +** Use the on-line help system. ** + +Vim has a comprehensive on-line help system. To get started, try one of +these three: + - press the ``{normal} key (if you have one) + - press the ``{normal} key (if you have one) + - type + `:help`{vim} + +Read the text in the help window to find out how the help works. +Type ``{normal} to jump from one window to another. +Type `:q`{vim} to close the help window. + +You can find help on just about any subject, by giving an argument to the +":help" command. Try these (don't forget pressing ): +~~~ cmd + :help w + :help c_CTRL-D + :help insert-index + :help user-manual +~~~ +# Lesson 7.2: CREATE A STARTUP SCRIPT + +** Enable Vim features. ** + +Vim has many more features than Vi, but most of them are disabled by +default. To start using more features you have to create a "vimrc" file. + + 1. Start editing the "vimrc" file. + `:call mkdir(stdpath('config'),'p')`{vim} + `:exe 'edit' stdpath('config').'/init.vim'`{vim} + + 2. Write the file with: + `:w`{vim} + + You can add all your preferred settings to this "vimrc" file. + For more information type `:help vimrc-intro`{vim}. + +# Lesson 7.3: COMPLETION + +** Command line completion with ``{normal} and ``{normal}. ** + + 1. Look what files exist in the directory: `:!ls`{vim} + + 2. Type the start of a command: `:e`{vim} + + 3. Press ``{normal} and Vim will show a list of commands that start + with "e". + + 4. Press ``{normal} and Vim will complete the command name to ":edit". + + 5. Now add a space and the start of an existing file name: `:edit FIL`{vim} + + 6. Press ``{normal}. Vim will complete the name (if it is unique). + +NOTE: Completion works for many commands. It is especially useful for + `:help`{vim}. + +# Lesson 7 SUMMARY + + 1. Type `:help`{vim} + or press ``{normal} or ``{normal} to open a help window. + + 2. Type `:help TOPIC`{vim} to find help on TOPIC. + + 3. Type ``{normal} to jump to another window + + 4. Type `:q`{vim} to close the help window + + 5. Create a vimrc startup script to keep your preferred settings. + + 6. While in command mode, press ``{normal} to see possible completions. + Press ``{normal} to use one completion. + +# CONCLUSION + +This was intended to give a brief overview of the Vim editor, just enough to +allow you to use the editor fairly easily. It is far from complete as Vim has +many many more commands. Consult the help often. + +There are many resources online to learn more about vim. Here's a bunch of +them: + +- *Learn Vim Progressively*: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/ +- *Learning Vim in 2014*: http://benmccormick.org/learning-vim-in-2014/ +- *Vimcasts*: http://vimcasts.org/ +- *Vim Video-Tutorials by Derek Wyatt*: http://derekwyatt.org/vim/tutorials/ +- *Learn Vimscript the Hard Way*: http://learnvimscriptthehardway.stevelosh.com/ +- *7 Habits of Effective Text Editing*: http://www.moolenaar.net/habits.html +- *vim-galore*: https://github.com/mhinz/vim-galore + +If you prefer a book, *Practical Vim* and the sequel *Modern Vim* by Drew Neil +are recommended often. + +This tutorial was written by Michael C. Pierce and Robert K. Ware, Colorado +School of Mines using ideas supplied by Charles Smith, Colorado State +University. E-mail: bware@mines.colorado.edu. + +Modified for Vim by Bram Moolenaar. +Modified for vim-tutor-mode by Felipe Morales. diff --git a/usr/share/vim/vim91/tutor/en/vim-01-beginner.tutor.json b/usr/share/vim/vim91/tutor/en/vim-01-beginner.tutor.json new file mode 100644 index 00000000000..af22cf2aca1 --- /dev/null +++ b/usr/share/vim/vim91/tutor/en/vim-01-beginner.tutor.json @@ -0,0 +1,45 @@ +{ + "expect": { + "24": -1, + "103": "The cow jumped over the moon.", + "124": "There is some text missing from this line.", + "125": "There is some text missing from this line.", + "144": "There is some text missing from this line.", + "145": "There is some text missing from this line.", + "146": "There is also some text missing here.", + "147": "There is also some text missing here.", + "220": "There are some words that don't belong in this sentence.", + "236": "Somebody typed the end of this line twice.", + "276": -1, + "295": "This line of words is cleaned up.", + "309": -1, + "310": -1, + "311": -1, + "312": -1, + "313": -1, + "314": -1, + "315": -1, + "332": "Fix the errors on this line and replace them with undo.", + "372": -1, + "373": -1, + "374": -1, + "375": -1, + "389": "When this line was typed in, someone pressed some wrong keys!", + "390": "When this line was typed in, someone pressed some wrong keys!", + "411": "This line has a few words that need changing using the change operator.", + "412": "This line has a few words that need changing using the change operator.", + "432": "The end of this line needs to be corrected using the `c$` command.", + "433": "The end of this line needs to be corrected using the `c$` command.", + "497": -1, + "516": -1, + "541": "Usually the best time to see the flowers is in the spring.", + "735": -1, + "740": -1, + "759": "This line will allow you to practice appending text to a line.", + "760": "This line will allow you to practice appending text to a line.", + "780": "Adding 123 to 456 gives you 579.", + "781": "Adding 123 to 456 gives you 579.", + "807": "a) This is the first item.", + "808": "b) This is the second item." + } +} diff --git a/usr/share/vim/vim91/tutor/tutor b/usr/share/vim/vim91/tutor/tutor index 3df15f1a1d1..3ddcda1614b 100644 --- a/usr/share/vim/vim91/tutor/tutor +++ b/usr/share/vim/vim91/tutor/tutor @@ -945,10 +945,13 @@ NOTE: Completion works for many commands. Just try pressing CTRL-D and ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - This concludes the Vim Tutor. It was intended to give a brief overview of - the Vim editor, just enough to allow you to use the editor fairly easily. - It is far from complete as Vim has many many more commands. Read the user - manual next: ":help user-manual". + This concludes Chapter 1 of the Vim Tutor. Consider continuing with Chapter 2. + + It was intended to give a brief overview of the Vim editor, just enough to + allow you to use the editor fairly easily. It is far from complete as Vim + has many many more commands. + + Read the user manual next: ":help user-manual". For further reading and studying, this book is recommended: Vim - Vi Improved - by Steve Oualline diff --git a/usr/share/vim/vim91/tutor/tutor.tutor b/usr/share/vim/vim91/tutor/tutor.tutor new file mode 100644 index 00000000000..b46fcc48361 --- /dev/null +++ b/usr/share/vim/vim91/tutor/tutor.tutor @@ -0,0 +1,247 @@ +# CREATING A VIM TUTORIAL WITH VIM-TUTOR-MODE + +This tutorial will guide you through the steps required to create a tutorial +file for vim-tutor-mode. It is also meant as a demo of vim-tutor-mode +capabilities. + +Table of contents: + +- [Setting up](*setting-up*) +- [vim-tutor-mode's markup](*markup*) + - [emphasis](*emphasis*) + - [headers](*headers*) + - [links](*links*) + - [codeblocks](*codeblocks*) +- [Interactive elements](*interactive*) + - [expect](*expect*) + +## SETTING UP *setting-up* + +First, you'll need to enable "debug" mode +~~~ cmd + :let g:tutor_debug = 1 +~~~ +This will allow saving changes to the tutor files and will disable conceals, so +you can more easily check your changes. + +After this, create a new .tutor file (we will be practicing on this very file, so you +don't need to do this now): +~~~ cmd + :e new-tutorial.tutor +~~~ + +## VIM-TUTOR-MODE's MARKDOWN *markup* + +vim-tutor-mode uses a subset of markdown's syntax to format the tutorials. The +subset supported should be enough for most tutorials and the maintainers will +try to keep it as small as possible (if regular markdown allows for several +ways to do the same thing, tutor markdown will only provide the one the +maintainers think is easier to handle). + +### Emphasis *emphasis* + +For emphasized text (italics), as in normal markdown, you use \*. E.g.: + + \*text\* + +is displayed like + + *text* + +Note: The underscores variant is not supported. + +For strong emphasis (bold), you use \*\*. E.g.: + + \*\*this\*\* + +is displayed like + + **this** + +1. Format the line below so it becomes a lesson description: + +This is text with important information +This is text with **important information** + +Note: Some words (e.g., NOTE, IMPORTANT, tip, ATTENTION, etc.) will also be +highlighted. You don't need to mark them specially. + +2. Turn the line below into a TODO item: + +Document '&variable' +TODO: Document '&variable' + +### Headers *headers* + +3. Practice fixing the lines below: + +This is a level 1 header +# This is a level 1 header +This is a level 3 header +### This is a level 3 header +This is a header with a label +# This is a header with a label {*label*} + +4. Now, create a 4th level section here, and add a label like in the previous +exercise: + + + + ATTENTION We will use this label later, so remember it. + +### Links *links* + +It is good practice to include links in your tutorials to reference materials, +like vim's own help or external documents. You can also link to other parts of +the document. + +Links have the syntax + + \[label\]\(target\) + +#### Help links + +If the target of a link matches a help topic, opening it will open it. + +5. Fix the following line: + +A link to help for the 'breakindent' option +A link to help for the ['breakindent']('breakindent') option + +#### Anchor links + +A link can also lead to a place in the file itself. Anchors are written + + \*anchor\* + +and are hidden by default. Links to them look like + + \[label\]\(\*anchor\*\) + +6. Add the appropriate link: + +A link to the Links section +A link to the [Links](*links*) section + +7. Now, create a link to the section you created on exercise 4 + above. + + + +# Tutorial links + +You can also have links to other tutorials. For this, you'll write the anchor in the format + + @tutor:TUTORIAL + +7. Create a link to this tutorial: + +A link to the vim-tutor-mode tutorial +A link to [the vim-tutor-mode tutorial](@tutor:tutor) + +### Codeblocks *codeblocks* + +vim-tutor-mode tutorials can include viml sections + + ~~~ cmd + echom "hello" + ~~~ + +is displayed as +~~~ cmd +echom "hello" +~~~ + +8. Copy the viml section below + + + + + +~~~ viml +echom 'the value of &number is'.string(&number) +~~~ + +You can inline viml code using "\`" and "\`{vim}": + + \`call myFunction()\`{vim} + +is displayed as + + `call myFunction()`{vim} + +[normal](Normal-mode) commands can also be embedded in tutorials. + + ~~~ normal + ftdaW + ~~~ + +is displayed as +~~~ normal +ftdaW +~~~ + +Note: you can also write `norm` or `normal`. + +9. Copy the normal section below + + + + + +~~~ normal +d2w +~~~ + +You can also inline normal commands by using "\`" and "\`{normal}": + + \`gq\`{normal} is very useful. + +is displayed: + + `gq`{normal} is very useful. + +10. Complete the line as shown + +d +`d2w`{normal} + +Commands to run in the system shell can be highlighted by indenting a line +starting with "$". + +~~~ sh + $ vim --version +~~~ + +## INTERACTIVE ELEMENTS *interactive* + +As visible in this very document, vim-tutor-mode includes some interactive +elements to provide feedback to the user about his progress. If the text in +these elements satisfies some set condition, a ✓ sign will appear in the gutter +to the left. Otherwise, a ✗ sign is displayed. + +### expect *expect* + +"expect" lines check that the contents of the line are identical to some preset text +(like in the exercises above). + +These elements are specified in separate JSON files like this + +~~~ json +{ + "expect": { + "1": "This is how this line should look.", + "2": "This is how this line should look.", + "3": -1 + } +} +~~~ + +These files contain an "expect" dictionary, for which the keys are line numbers and +the values are the expected text. A value of -1 means that the condition for the line +will always be satisfied, no matter what (this is useful for letting the user play a bit). + +This is an "expect" line that is always satisfied. Try changing it. + +These files conventionally have the same name as the tutorial document with the `.json` +extension appended (for a full example, see the file that corresponds to this tutorial). diff --git a/usr/share/vim/vim91/tutor/tutor.tutor.json b/usr/share/vim/vim91/tutor/tutor.tutor.json new file mode 100644 index 00000000000..bf3eae85869 --- /dev/null +++ b/usr/share/vim/vim91/tutor/tutor.tutor.json @@ -0,0 +1,35 @@ +{ + "expect": { + "63": "This is text with **important information**", + "64": "This is text with **important information**", + "71": "Document '&variable'", + "72": "Document '&variable'", + "78": "# This is a level 1 header", + "79": "# This is a level 1 header", + "80": "### This is a level 3 header", + "81": "### This is a level 3 header", + "82": "# This is a header with a label {*label*}", + "83": "# This is a header with a label {*label*}", + "108": "A link to help for the ['breakindent']('breakindent') option", + "109": "A link to help for the ['breakindent']('breakindent') option", + "123": "A link to the [Links](*links*) section", + "124": "A link to the [Links](*links*) section", + "139": "A link to [the vim-tutor-mode tutorial](@tutor:tutor)", + "140": "A link to [the vim-tutor-mode tutorial](@tutor:tutor)", + "157": "~~~ viml", + "158": "echom 'the value of &number is'.string(&number)", + "159": "~~~", + "161": "~~~ viml", + "162": "echom 'the value of &number is'.string(&number)", + "163": "~~~", + "188": "~~~ normal", + "189": "d2w", + "190": "~~~", + "192": "~~~ normal", + "193": "d2w", + "194": "~~~", + "206": "`d2w`{normal}", + "207": "`d2w`{normal}", + "244": -1 + } +} diff --git a/usr/share/vim/vim91/tutor/tutor.vim b/usr/share/vim/vim91/tutor/tutor.vim index 809fd1d1267..551231ab425 100644 --- a/usr/share/vim/vim91/tutor/tutor.vim +++ b/usr/share/vim/vim91/tutor/tutor.vim @@ -180,8 +180,13 @@ if &enc == 'utf-8' && s:ext !~ '\.utf-8' let s:ext .= '.utf-8' endif -" 2. Build the name of the file: -let s:tutorfile = "/tutor/tutor" +" 2. Build the name of the file and chapter +let s:chapter = exists("$CHAPTER") ? $CHAPTER : '' +if s:chapter == "1" + let s:chapter = '' +endif + +let s:tutorfile = "/tutor/tutor" . s:chapter let s:tutorxx = $VIMRUNTIME . s:tutorfile . s:ext " 3. Finding the file: diff --git a/usr/share/vim/vim91/tutor/tutor2 b/usr/share/vim/vim91/tutor/tutor2 new file mode 100644 index 00000000000..eaeef400354 --- /dev/null +++ b/usr/share/vim/vim91/tutor/tutor2 @@ -0,0 +1,199 @@ +=============================================================================== += W e l c o m e t o t h e V I M T u t o r - Version 1.7 = +=============================================================================== += = += C h a p t e r - T w o = += = +=============================================================================== + + Hic Sunt Dracones: if this is your first exposure to vim and you + intended to avail yourself of the introductory chapter, kindly type + :q and try again. + + The approximate time required to complete this chapter is 8-10 minutes, + depending upon how much time is spent with experimentation. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lesson 2.1.1: THE NAMED REGISTERS + + + ** Store two yanked words concurrently and then paste them ** + + 1. Move the cursor to the line below marked ---> + + 2. Navigate to any point on the word 'Edward' and type "ayiw + +MNEMONIC: into register(") named (a) (y)ank (i)nner (w)ord + + 3. Navigate forward to the word 'cookie' (fk or 2fc or $2b or /co) + and type "byiw + + 4. Navigate to any point on the word 'Vince' and type ciwa + +MNEMONIC: (c)hange (i)nner (w)ord with named (a) + + 5. Navigate to any point on the word 'cake' and type ciwb + +---> a) Edward will henceforth be in charge of the cookie rations + b) In this capacity, Vince will have sole cake discretionary powers + +NOTE: Delete also works into registers, i.e. "sdiw will delete the word under + the cursor into register s. + +REFERENCE: Registers :h registers + Named Registers :h quotea + Motion :h motion.txt /inner + CTRL-R :h insert /CTRL-R + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.2: THE EXPRESSION REGISTER + + + ** Insert the results of calculations on the fly ** + + 1. Move the cursor to the line below marked ---> + + 2. Navigate to any point on the supplied number + + 3. Type ciw=60*60*24 + + 4. On the next line, enter insert mode and add today's date with + =system('date') + +NOTE: All calls to system are OS dependent, e.g. on Windows use + system('date /t') or :r!date /t + +---> I have forgotten the exact number of seconds in a day, is it 84600? + Today's date is: + +NOTE: the same can be achieved with :pu=system('date') + or, with fewer keystrokes :r!date + +REFERENCE: Expression Register :h quote= + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.3: THE NUMBERED REGISTERS + + + ** Press yy and dd to witness their effect on the registers ** + + 1. Move the cursor to the line below marked ---> + + 2. yank the zeroth line, then inspect registers with :reg + + 3. delete line 0. with "cdd, then inspect registers + (Where do you expect line 0 to be?) + + 4. continue deleting each successive line, inspecting :reg as you go + +NOTE: You should notice that old full-line deletions move down the list + as new full-line deletions are added + + 5. Now (p)aste the following registers in order; c, 7, 4, 8, 2. i.e. "7p + +---> 0. This + 9. wobble + 8. secret + 7. is + 6. on + 5. axis + 4. a + 3. war + 2. message + 1. tribute + +NOTE: Whole line deletions (dd) are much longer lived in the numbered registers + than whole line yanks, or deletions involving smaller movements + +REFERENCE: Numbered Registers :h quote0 + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.4: THE BEAUTY OF MARKS + + + ** Code monkey arithmetic avoidance ** + +NOTE: a common conundrum when coding is moving around large chunks of code. + The following technique helps avoid number line calculations associated + with operatins like "a147d or :945,1091d a or even worse using + i=1091-945 first + + 1. Move the cursor to the line below marked ---> + + 2. Go to the first line of the function and mark it with ma + +NOTE: exact position on line is NOT important! + + 3. Navigate to the end of the line and then the end of the code block + with $% + + 4. Delete the block into register a with "ad'a + +MNEMONIC: into register(") named (a) put the (d)eletion from the cursor to the + LINE containing mark(') (a) + + 5. Paste the block between BBB and CCC "ap + +NOTE: practice this operation multiple times to become fluent ma$%"ad'a + +---> AAA + function itGotRealBigRealFast() { + if ( somethingIsTrue ) { + doIt() + } + // the taxonomy of our function has changed and it + // no longer makes alphabetical sense in it's current position + + // imagine hundreds of lines of code + + // naively you could navigate to the start and end and record or + // remember each line number + } + BBB + CCC + +NOTE: marks and registers do not share a namespace, therefore register a is + completely independent of mark a. This is not true of registers and + macros. + +REFERENCE: Marks :h marks + Mark Motions :h mark-motions (difference between ' and `) + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1 SUMMARY + + + 1. To store (yank, delete) text into, and retrieve (paste) from, a total of + 26 registers (a-z) + 2. Yank a whole word from anywhere within a word: yiw + 3. Change a whole word from anywhere within a word: ciw + 4. Insert text directly from registers in insert mode: (C-r)a + + 5. Insert the results of simple arithmetic operations: (C-r)=60*60 + in insert mode + 6. Insert the results of system calls: (C-r)=system('ls -1') + in insert mode + + 7. Inspect registers with :reg + 8. Learn the final destination of whole line deletions: dd in the numbered + registers, i.e. descending from register 1 - 9. Appreciate that whole + line deletions are preserved in the numbered registers longer than any + other operation + 9. Learn the final destination of all yanks in the numbered registers and + how ephemeral they are + + 10. Place marks from command mode m[a-zA-Z0-9] + 11. Move line-wise to a mark with ' + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This concludes chapter two of the Vim Tutor. It is a work in progress. + + This chapter was written by Paul D. Parker. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/usr/share/vim/vim91/tutor/tutor2.utf-8 b/usr/share/vim/vim91/tutor/tutor2.utf-8 new file mode 100644 index 00000000000..eaeef400354 --- /dev/null +++ b/usr/share/vim/vim91/tutor/tutor2.utf-8 @@ -0,0 +1,199 @@ +=============================================================================== += W e l c o m e t o t h e V I M T u t o r - Version 1.7 = +=============================================================================== += = += C h a p t e r - T w o = += = +=============================================================================== + + Hic Sunt Dracones: if this is your first exposure to vim and you + intended to avail yourself of the introductory chapter, kindly type + :q and try again. + + The approximate time required to complete this chapter is 8-10 minutes, + depending upon how much time is spent with experimentation. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lesson 2.1.1: THE NAMED REGISTERS + + + ** Store two yanked words concurrently and then paste them ** + + 1. Move the cursor to the line below marked ---> + + 2. Navigate to any point on the word 'Edward' and type "ayiw + +MNEMONIC: into register(") named (a) (y)ank (i)nner (w)ord + + 3. Navigate forward to the word 'cookie' (fk or 2fc or $2b or /co) + and type "byiw + + 4. Navigate to any point on the word 'Vince' and type ciwa + +MNEMONIC: (c)hange (i)nner (w)ord with named (a) + + 5. Navigate to any point on the word 'cake' and type ciwb + +---> a) Edward will henceforth be in charge of the cookie rations + b) In this capacity, Vince will have sole cake discretionary powers + +NOTE: Delete also works into registers, i.e. "sdiw will delete the word under + the cursor into register s. + +REFERENCE: Registers :h registers + Named Registers :h quotea + Motion :h motion.txt /inner + CTRL-R :h insert /CTRL-R + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.2: THE EXPRESSION REGISTER + + + ** Insert the results of calculations on the fly ** + + 1. Move the cursor to the line below marked ---> + + 2. Navigate to any point on the supplied number + + 3. Type ciw=60*60*24 + + 4. On the next line, enter insert mode and add today's date with + =system('date') + +NOTE: All calls to system are OS dependent, e.g. on Windows use + system('date /t') or :r!date /t + +---> I have forgotten the exact number of seconds in a day, is it 84600? + Today's date is: + +NOTE: the same can be achieved with :pu=system('date') + or, with fewer keystrokes :r!date + +REFERENCE: Expression Register :h quote= + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.3: THE NUMBERED REGISTERS + + + ** Press yy and dd to witness their effect on the registers ** + + 1. Move the cursor to the line below marked ---> + + 2. yank the zeroth line, then inspect registers with :reg + + 3. delete line 0. with "cdd, then inspect registers + (Where do you expect line 0 to be?) + + 4. continue deleting each successive line, inspecting :reg as you go + +NOTE: You should notice that old full-line deletions move down the list + as new full-line deletions are added + + 5. Now (p)aste the following registers in order; c, 7, 4, 8, 2. i.e. "7p + +---> 0. This + 9. wobble + 8. secret + 7. is + 6. on + 5. axis + 4. a + 3. war + 2. message + 1. tribute + +NOTE: Whole line deletions (dd) are much longer lived in the numbered registers + than whole line yanks, or deletions involving smaller movements + +REFERENCE: Numbered Registers :h quote0 + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1.4: THE BEAUTY OF MARKS + + + ** Code monkey arithmetic avoidance ** + +NOTE: a common conundrum when coding is moving around large chunks of code. + The following technique helps avoid number line calculations associated + with operatins like "a147d or :945,1091d a or even worse using + i=1091-945 first + + 1. Move the cursor to the line below marked ---> + + 2. Go to the first line of the function and mark it with ma + +NOTE: exact position on line is NOT important! + + 3. Navigate to the end of the line and then the end of the code block + with $% + + 4. Delete the block into register a with "ad'a + +MNEMONIC: into register(") named (a) put the (d)eletion from the cursor to the + LINE containing mark(') (a) + + 5. Paste the block between BBB and CCC "ap + +NOTE: practice this operation multiple times to become fluent ma$%"ad'a + +---> AAA + function itGotRealBigRealFast() { + if ( somethingIsTrue ) { + doIt() + } + // the taxonomy of our function has changed and it + // no longer makes alphabetical sense in it's current position + + // imagine hundreds of lines of code + + // naively you could navigate to the start and end and record or + // remember each line number + } + BBB + CCC + +NOTE: marks and registers do not share a namespace, therefore register a is + completely independent of mark a. This is not true of registers and + macros. + +REFERENCE: Marks :h marks + Mark Motions :h mark-motions (difference between ' and `) + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Lesson 2.1 SUMMARY + + + 1. To store (yank, delete) text into, and retrieve (paste) from, a total of + 26 registers (a-z) + 2. Yank a whole word from anywhere within a word: yiw + 3. Change a whole word from anywhere within a word: ciw + 4. Insert text directly from registers in insert mode: (C-r)a + + 5. Insert the results of simple arithmetic operations: (C-r)=60*60 + in insert mode + 6. Insert the results of system calls: (C-r)=system('ls -1') + in insert mode + + 7. Inspect registers with :reg + 8. Learn the final destination of whole line deletions: dd in the numbered + registers, i.e. descending from register 1 - 9. Appreciate that whole + line deletions are preserved in the numbered registers longer than any + other operation + 9. Learn the final destination of all yanks in the numbered registers and + how ephemeral they are + + 10. Place marks from command mode m[a-zA-Z0-9] + 11. Move line-wise to a mark with ' + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + This concludes chapter two of the Vim Tutor. It is a work in progress. + + This chapter was written by Paul D. Parker. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/var/lib/pacman/local/diffstat-1.66-1/mtree b/var/lib/pacman/local/diffstat-1.66-1/mtree deleted file mode 100644 index b2b0d544a55..00000000000 Binary files a/var/lib/pacman/local/diffstat-1.66-1/mtree and /dev/null differ diff --git a/var/lib/pacman/local/diffstat-1.66-1/desc b/var/lib/pacman/local/diffstat-1.67-1/desc similarity index 75% rename from var/lib/pacman/local/diffstat-1.66-1/desc rename to var/lib/pacman/local/diffstat-1.67-1/desc index 3518b6cd21e..4df41dcddd1 100644 --- a/var/lib/pacman/local/diffstat-1.66-1/desc +++ b/var/lib/pacman/local/diffstat-1.67-1/desc @@ -2,7 +2,7 @@ diffstat %VERSION% -1.66-1 +1.67-1 %BASE% diffstat @@ -17,16 +17,16 @@ https://invisible-island.net/diffstat x86_64 %BUILDDATE% -1720677835 +1734118406 %INSTALLDATE% -1720840388 +1734234120 %PACKAGER% -CI (msys2/msys2-autobuild/00495cb2/9886293321) +CI (msys2/msys2-autobuild/0f71ee73/12321823139) %SIZE% -57436 +57388 %LICENSE% spdx:MIT diff --git a/var/lib/pacman/local/diffstat-1.66-1/files b/var/lib/pacman/local/diffstat-1.67-1/files similarity index 100% rename from var/lib/pacman/local/diffstat-1.66-1/files rename to var/lib/pacman/local/diffstat-1.67-1/files diff --git a/var/lib/pacman/local/diffstat-1.67-1/mtree b/var/lib/pacman/local/diffstat-1.67-1/mtree new file mode 100644 index 00000000000..676c1d3e5ca Binary files /dev/null and b/var/lib/pacman/local/diffstat-1.67-1/mtree differ diff --git a/var/lib/pacman/local/glib2-2.82.3-1/mtree b/var/lib/pacman/local/glib2-2.82.3-1/mtree deleted file mode 100644 index 1e4be6a8bb4..00000000000 Binary files a/var/lib/pacman/local/glib2-2.82.3-1/mtree and /dev/null differ diff --git a/var/lib/pacman/local/glib2-2.82.3-1/desc b/var/lib/pacman/local/glib2-2.82.4-1/desc similarity index 82% rename from var/lib/pacman/local/glib2-2.82.3-1/desc rename to var/lib/pacman/local/glib2-2.82.4-1/desc index e3e8458cd5b..68d10622f59 100644 --- a/var/lib/pacman/local/glib2-2.82.3-1/desc +++ b/var/lib/pacman/local/glib2-2.82.4-1/desc @@ -2,7 +2,7 @@ glib2 %VERSION% -2.82.3-1 +2.82.4-1 %BASE% glib2 @@ -17,13 +17,13 @@ https://gitlab.gnome.org/GNOME/glib x86_64 %BUILDDATE% -1733906571 +1734119564 %INSTALLDATE% -1733974715 +1734234120 %PACKAGER% -CI (msys2/msys2-autobuild/0f71ee73/12272630703) +CI (msys2/msys2-autobuild/0f71ee73/12321823139) %SIZE% 13658231 diff --git a/var/lib/pacman/local/glib2-2.82.3-1/files b/var/lib/pacman/local/glib2-2.82.4-1/files similarity index 100% rename from var/lib/pacman/local/glib2-2.82.3-1/files rename to var/lib/pacman/local/glib2-2.82.4-1/files diff --git a/var/lib/pacman/local/glib2-2.82.4-1/mtree b/var/lib/pacman/local/glib2-2.82.4-1/mtree new file mode 100644 index 00000000000..bdeca0c507f Binary files /dev/null and b/var/lib/pacman/local/glib2-2.82.4-1/mtree differ diff --git a/var/lib/pacman/local/mingw-w64-clang-aarch64-git-extra-1.1.641.031e03baf-1/desc b/var/lib/pacman/local/mingw-w64-clang-aarch64-git-extra-1.1.641.031e03baf-1/desc index d259eb17300..54e44a3da5d 100644 --- a/var/lib/pacman/local/mingw-w64-clang-aarch64-git-extra-1.1.641.031e03baf-1/desc +++ b/var/lib/pacman/local/mingw-w64-clang-aarch64-git-extra-1.1.641.031e03baf-1/desc @@ -20,7 +20,7 @@ any 1718204686 %INSTALLDATE% -1734147249 +1734234138 %PACKAGER% Johannes Schindelin diff --git a/var/lib/pacman/local/vim-9.1.0785-1/mtree b/var/lib/pacman/local/vim-9.1.0785-1/mtree deleted file mode 100644 index c73c70c905f..00000000000 Binary files a/var/lib/pacman/local/vim-9.1.0785-1/mtree and /dev/null differ diff --git a/var/lib/pacman/local/vim-9.1.0785-1/desc b/var/lib/pacman/local/vim-9.1.0866-1/desc similarity index 78% rename from var/lib/pacman/local/vim-9.1.0785-1/desc rename to var/lib/pacman/local/vim-9.1.0866-1/desc index f34b2180b55..8e53af3e41b 100644 --- a/var/lib/pacman/local/vim-9.1.0785-1/desc +++ b/var/lib/pacman/local/vim-9.1.0866-1/desc @@ -2,7 +2,7 @@ vim %VERSION% -9.1.0785-1 +9.1.0866-1 %BASE% vim @@ -17,16 +17,16 @@ https://www.vim.org x86_64 %BUILDDATE% -1729934758 +1734118513 %INSTALLDATE% -1730086312 +1734234131 %PACKAGER% -CI (msys2/msys2-autobuild/7c56a1d7/11530542523) +CI (msys2/msys2-autobuild/0f71ee73/12321823139) %SIZE% -60779765 +60884036 %GROUPS% editors diff --git a/var/lib/pacman/local/vim-9.1.0785-1/files b/var/lib/pacman/local/vim-9.1.0866-1/files similarity index 98% rename from var/lib/pacman/local/vim-9.1.0785-1/files rename to var/lib/pacman/local/vim-9.1.0866-1/files index 99958887bfc..4b3dbda431e 100644 --- a/var/lib/pacman/local/vim-9.1.0785-1/files +++ b/var/lib/pacman/local/vim-9.1.0866-1/files @@ -253,7 +253,6 @@ usr/share/vim/vim91/autoload/javascriptcomplete.vim usr/share/vim/vim91/autoload/modula2.vim usr/share/vim/vim91/autoload/netrw.vim usr/share/vim/vim91/autoload/netrw_gitignore.vim -usr/share/vim/vim91/autoload/netrwFileHandlers.vim usr/share/vim/vim91/autoload/netrwSettings.vim usr/share/vim/vim91/autoload/paste.vim usr/share/vim/vim91/autoload/phpcomplete.vim @@ -273,6 +272,7 @@ usr/share/vim/vim91/autoload/sqlcomplete.vim usr/share/vim/vim91/autoload/syntaxcomplete.vim usr/share/vim/vim91/autoload/tar.vim usr/share/vim/vim91/autoload/tohtml.vim +usr/share/vim/vim91/autoload/tutor.vim usr/share/vim/vim91/autoload/typeset.vim usr/share/vim/vim91/autoload/typst.vim usr/share/vim/vim91/autoload/vimball.vim @@ -385,6 +385,7 @@ usr/share/vim/vim91/compiler/jq.vim usr/share/vim/vim91/compiler/jshint.vim usr/share/vim/vim91/compiler/jsonlint.vim usr/share/vim/vim91/compiler/make.vim +usr/share/vim/vim91/compiler/maven.vim usr/share/vim/vim91/compiler/mcs.vim usr/share/vim/vim91/compiler/mips_c.vim usr/share/vim/vim91/compiler/mipspro_c89.vim @@ -392,6 +393,7 @@ usr/share/vim/vim91/compiler/mipspro_cpp.vim usr/share/vim/vim91/compiler/modelsim_vcom.vim usr/share/vim/vim91/compiler/msbuild.vim usr/share/vim/vim91/compiler/msvc.vim +usr/share/vim/vim91/compiler/mypy.vim usr/share/vim/vim91/compiler/neato.vim usr/share/vim/vim91/compiler/ocaml.vim usr/share/vim/vim91/compiler/onsgmls.vim @@ -418,6 +420,7 @@ usr/share/vim/vim91/compiler/rst.vim usr/share/vim/vim91/compiler/rubocop.vim usr/share/vim/vim91/compiler/ruby.vim usr/share/vim/vim91/compiler/rubyunit.vim +usr/share/vim/vim91/compiler/ruff.vim usr/share/vim/vim91/compiler/rustc.vim usr/share/vim/vim91/compiler/sass.vim usr/share/vim/vim91/compiler/scdoc.vim @@ -524,6 +527,7 @@ usr/share/vim/vim91/doc/pi_netrw.txt usr/share/vim/vim91/doc/pi_paren.txt usr/share/vim/vim91/doc/pi_spec.txt usr/share/vim/vim91/doc/pi_tar.txt +usr/share/vim/vim91/doc/pi_tutor.txt usr/share/vim/vim91/doc/pi_vimball.txt usr/share/vim/vim91/doc/pi_zip.txt usr/share/vim/vim91/doc/popup.txt @@ -660,6 +664,7 @@ usr/share/vim/vim91/ftplugin/conf.vim usr/share/vim/vim91/ftplugin/config.vim usr/share/vim/vim91/ftplugin/confini.vim usr/share/vim/vim91/ftplugin/context.vim +usr/share/vim/vim91/ftplugin/cook.vim usr/share/vim/vim91/ftplugin/corn.vim usr/share/vim/vim91/ftplugin/cpp.vim usr/share/vim/vim91/ftplugin/crm.vim @@ -754,8 +759,10 @@ usr/share/vim/vim91/ftplugin/hurl.vim usr/share/vim/vim91/ftplugin/hyprlang.vim usr/share/vim/vim91/ftplugin/i3config.vim usr/share/vim/vim91/ftplugin/icon.vim +usr/share/vim/vim91/ftplugin/idris2.vim usr/share/vim/vim91/ftplugin/indent.vim usr/share/vim/vim91/ftplugin/initex.vim +usr/share/vim/vim91/ftplugin/ipkg.vim usr/share/vim/vim91/ftplugin/ishd.vim usr/share/vim/vim91/ftplugin/j.vim usr/share/vim/vim91/ftplugin/java.vim @@ -779,6 +786,7 @@ usr/share/vim/vim91/ftplugin/kwt.vim usr/share/vim/vim91/ftplugin/lc.vim usr/share/vim/vim91/ftplugin/ld.vim usr/share/vim/vim91/ftplugin/ldapconf.vim +usr/share/vim/vim91/ftplugin/leo.vim usr/share/vim/vim91/ftplugin/less.vim usr/share/vim/vim91/ftplugin/lex.vim usr/share/vim/vim91/ftplugin/lftp.vim @@ -787,6 +795,7 @@ usr/share/vim/vim91/ftplugin/limits.vim usr/share/vim/vim91/ftplugin/liquid.vim usr/share/vim/vim91/ftplugin/lisp.vim usr/share/vim/vim91/ftplugin/livebook.vim +usr/share/vim/vim91/ftplugin/llvm.vim usr/share/vim/vim91/ftplugin/logcheck.vim usr/share/vim/vim91/ftplugin/loginaccess.vim usr/share/vim/vim91/ftplugin/logindefs.vim @@ -843,6 +852,7 @@ usr/share/vim/vim91/ftplugin/octave.vim usr/share/vim/vim91/ftplugin/odin.vim usr/share/vim/vim91/ftplugin/ondir.vim usr/share/vim/vim91/ftplugin/openvpn.vim +usr/share/vim/vim91/ftplugin/org.vim usr/share/vim/vim91/ftplugin/pamconf.vim usr/share/vim/vim91/ftplugin/pascal.vim usr/share/vim/vim91/ftplugin/passwd.vim @@ -925,6 +935,7 @@ usr/share/vim/vim91/ftplugin/stylus.vim usr/share/vim/vim91/ftplugin/sudoers.vim usr/share/vim/vim91/ftplugin/svelte.vim usr/share/vim/vim91/ftplugin/svg.vim +usr/share/vim/vim91/ftplugin/sway.vim usr/share/vim/vim91/ftplugin/swayconfig.vim usr/share/vim/vim91/ftplugin/swift.vim usr/share/vim/vim91/ftplugin/swiftgyb.vim @@ -946,6 +957,7 @@ usr/share/vim/vim91/ftplugin/tmux.vim usr/share/vim/vim91/ftplugin/toml.vim usr/share/vim/vim91/ftplugin/treetop.vim usr/share/vim/vim91/ftplugin/tt2html.vim +usr/share/vim/vim91/ftplugin/tutor.vim usr/share/vim/vim91/ftplugin/typescript.vim usr/share/vim/vim91/ftplugin/typescriptreact.vim usr/share/vim/vim91/ftplugin/typst.vim @@ -1057,6 +1069,7 @@ usr/share/vim/vim91/indent/hog.vim usr/share/vim/vim91/indent/html.vim usr/share/vim/vim91/indent/htmldjango.vim usr/share/vim/vim91/indent/idlang.vim +usr/share/vim/vim91/indent/idris2.vim usr/share/vim/vim91/indent/ishd.vim usr/share/vim/vim91/indent/j.vim usr/share/vim/vim91/indent/java.vim @@ -1610,6 +1623,11 @@ usr/share/vim/vim91/pack/dist/opt/editorconfig/mkzip.sh usr/share/vim/vim91/pack/dist/opt/editorconfig/plugin/ usr/share/vim/vim91/pack/dist/opt/editorconfig/plugin/editorconfig.vim usr/share/vim/vim91/pack/dist/opt/editorconfig/README.md +usr/share/vim/vim91/pack/dist/opt/helptoc/ +usr/share/vim/vim91/pack/dist/opt/helptoc/autoload/ +usr/share/vim/vim91/pack/dist/opt/helptoc/autoload/helptoc.vim +usr/share/vim/vim91/pack/dist/opt/helptoc/plugin/ +usr/share/vim/vim91/pack/dist/opt/helptoc/plugin/helptoc.vim usr/share/vim/vim91/pack/dist/opt/justify/ usr/share/vim/vim91/pack/dist/opt/justify/plugin/ usr/share/vim/vim91/pack/dist/opt/justify/plugin/justify.vim @@ -1645,6 +1663,7 @@ usr/share/vim/vim91/plugin/rrhelper.vim usr/share/vim/vim91/plugin/spellfile.vim usr/share/vim/vim91/plugin/tarPlugin.vim usr/share/vim/vim91/plugin/tohtml.vim +usr/share/vim/vim91/plugin/tutor.vim usr/share/vim/vim91/plugin/vimballPlugin.vim usr/share/vim/vim91/plugin/zipPlugin.vim usr/share/vim/vim91/print/ @@ -1946,6 +1965,7 @@ usr/share/vim/vim91/syntax/hastepreproc.vim usr/share/vim/vim91/syntax/hb.vim usr/share/vim/vim91/syntax/hcl.vim usr/share/vim/vim91/syntax/help.vim +usr/share/vim/vim91/syntax/help_it.vim usr/share/vim/vim91/syntax/help_ru.vim usr/share/vim/vim91/syntax/hercules.vim usr/share/vim/vim91/syntax/hex.vim @@ -1969,12 +1989,14 @@ usr/share/vim/vim91/syntax/icemenu.vim usr/share/vim/vim91/syntax/icon.vim usr/share/vim/vim91/syntax/idl.vim usr/share/vim/vim91/syntax/idlang.vim +usr/share/vim/vim91/syntax/idris2.vim usr/share/vim/vim91/syntax/indent.vim usr/share/vim/vim91/syntax/inform.vim usr/share/vim/vim91/syntax/initex.vim usr/share/vim/vim91/syntax/initng.vim usr/share/vim/vim91/syntax/inittab.vim usr/share/vim/vim91/syntax/ipfilter.vim +usr/share/vim/vim91/syntax/ipkg.vim usr/share/vim/vim91/syntax/ishd.vim usr/share/vim/vim91/syntax/iss.vim usr/share/vim/vim91/syntax/ist.vim @@ -2018,6 +2040,7 @@ usr/share/vim/vim91/syntax/lf.vim usr/share/vim/vim91/syntax/lftp.vim usr/share/vim/vim91/syntax/lhaskell.vim usr/share/vim/vim91/syntax/libao.vim +usr/share/vim/vim91/syntax/lidris2.vim usr/share/vim/vim91/syntax/lifelines.vim usr/share/vim/vim91/syntax/lilo.vim usr/share/vim/vim91/syntax/limits.vim @@ -2128,6 +2151,7 @@ usr/share/vim/vim91/syntax/openscad.vim usr/share/vim/vim91/syntax/openvpn.vim usr/share/vim/vim91/syntax/opl.vim usr/share/vim/vim91/syntax/ora.vim +usr/share/vim/vim91/syntax/org.vim usr/share/vim/vim91/syntax/pacmanlog.vim usr/share/vim/vim91/syntax/pamconf.vim usr/share/vim/vim91/syntax/pamenv.vim @@ -2364,6 +2388,7 @@ usr/share/vim/vim91/syntax/tsv.vim usr/share/vim/vim91/syntax/tt2.vim usr/share/vim/vim91/syntax/tt2html.vim usr/share/vim/vim91/syntax/tt2js.vim +usr/share/vim/vim91/syntax/tutor.vim usr/share/vim/vim91/syntax/typescript.vim usr/share/vim/vim91/syntax/typescriptreact.vim usr/share/vim/vim91/syntax/typst.vim @@ -2393,6 +2418,7 @@ usr/share/vim/vim91/syntax/vgrindefs.vim usr/share/vim/vim91/syntax/vhdl.vim usr/share/vim/vim91/syntax/vim.vim usr/share/vim/vim91/syntax/viminfo.vim +usr/share/vim/vim91/syntax/vimnormal.vim usr/share/vim/vim91/syntax/virata.vim usr/share/vim/vim91/syntax/vmasm.vim usr/share/vim/vim91/syntax/voscm.vim @@ -2464,6 +2490,9 @@ usr/share/vim/vim91/tools/vimspell.sh usr/share/vim/vim91/tools/vimspell.txt usr/share/vim/vim91/tools/xcmdsrv_client.c usr/share/vim/vim91/tutor/ +usr/share/vim/vim91/tutor/en/ +usr/share/vim/vim91/tutor/en/vim-01-beginner.tutor +usr/share/vim/vim91/tutor/en/vim-01-beginner.tutor.json usr/share/vim/vim91/tutor/README.el.cp737.txt usr/share/vim/vim91/tutor/README.el.txt usr/share/vim/vim91/tutor/README.ru.utf-8.txt @@ -2529,6 +2558,8 @@ usr/share/vim/vim91/tutor/tutor.sv usr/share/vim/vim91/tutor/tutor.sv.utf-8 usr/share/vim/vim91/tutor/tutor.tr.iso9 usr/share/vim/vim91/tutor/tutor.tr.utf-8 +usr/share/vim/vim91/tutor/tutor.tutor +usr/share/vim/vim91/tutor/tutor.tutor.json usr/share/vim/vim91/tutor/tutor.uk.utf-8 usr/share/vim/vim91/tutor/tutor.utf-8 usr/share/vim/vim91/tutor/tutor.vi.utf-8 @@ -2538,5 +2569,7 @@ usr/share/vim/vim91/tutor/tutor.zh.euc usr/share/vim/vim91/tutor/tutor.zh.utf-8 usr/share/vim/vim91/tutor/tutor.zh_cn.utf-8 usr/share/vim/vim91/tutor/tutor.zh_tw.utf-8 +usr/share/vim/vim91/tutor/tutor2 +usr/share/vim/vim91/tutor/tutor2.utf-8 usr/share/vim/vim91/vimrc_example.vim diff --git a/var/lib/pacman/local/vim-9.1.0866-1/mtree b/var/lib/pacman/local/vim-9.1.0866-1/mtree new file mode 100644 index 00000000000..1126347194f Binary files /dev/null and b/var/lib/pacman/local/vim-9.1.0866-1/mtree differ diff --git a/var/lib/pacman/sync/clang64.db b/var/lib/pacman/sync/clang64.db index 1452ff76d53..b55d18285fa 100644 Binary files a/var/lib/pacman/sync/clang64.db and b/var/lib/pacman/sync/clang64.db differ diff --git a/var/lib/pacman/sync/clang64.db.sig b/var/lib/pacman/sync/clang64.db.sig index 9c953c8744f..fd322c81d17 100644 Binary files a/var/lib/pacman/sync/clang64.db.sig and b/var/lib/pacman/sync/clang64.db.sig differ diff --git a/var/lib/pacman/sync/clangarm64.db b/var/lib/pacman/sync/clangarm64.db index 574573c8ed4..d73070d8c38 100644 Binary files a/var/lib/pacman/sync/clangarm64.db and b/var/lib/pacman/sync/clangarm64.db differ diff --git a/var/lib/pacman/sync/clangarm64.db.sig b/var/lib/pacman/sync/clangarm64.db.sig index 1f48ece1972..5235c3883cc 100644 Binary files a/var/lib/pacman/sync/clangarm64.db.sig and b/var/lib/pacman/sync/clangarm64.db.sig differ diff --git a/var/lib/pacman/sync/mingw64.db b/var/lib/pacman/sync/mingw64.db index f60d31db72d..2ef265d7e61 100644 Binary files a/var/lib/pacman/sync/mingw64.db and b/var/lib/pacman/sync/mingw64.db differ diff --git a/var/lib/pacman/sync/mingw64.db.sig b/var/lib/pacman/sync/mingw64.db.sig index 4a21d6dc4fc..2522dfee2e0 100644 Binary files a/var/lib/pacman/sync/mingw64.db.sig and b/var/lib/pacman/sync/mingw64.db.sig differ diff --git a/var/lib/pacman/sync/msys.db b/var/lib/pacman/sync/msys.db index f5e53b42a35..84e4f3670a6 100644 Binary files a/var/lib/pacman/sync/msys.db and b/var/lib/pacman/sync/msys.db differ diff --git a/var/lib/pacman/sync/msys.db.sig b/var/lib/pacman/sync/msys.db.sig index 51314696dcf..f5c3bfa7f4a 100644 Binary files a/var/lib/pacman/sync/msys.db.sig and b/var/lib/pacman/sync/msys.db.sig differ diff --git a/var/lib/pacman/sync/ucrt64.db b/var/lib/pacman/sync/ucrt64.db index 5e71d7bd68f..912aa52689d 100644 Binary files a/var/lib/pacman/sync/ucrt64.db and b/var/lib/pacman/sync/ucrt64.db differ diff --git a/var/lib/pacman/sync/ucrt64.db.sig b/var/lib/pacman/sync/ucrt64.db.sig index ea92d107151..5a529211677 100644 Binary files a/var/lib/pacman/sync/ucrt64.db.sig and b/var/lib/pacman/sync/ucrt64.db.sig differ