runtime(tutor): Make all tutor files utf-8 only
In this commit, all legacy encodings for tutor files are removed.
* All the tutor files `tutor1.xx` and `tutor2.xx` are now `utf-8`
* All `README.xx.txt` files are now `utf-8`
* All makefiles are removed, as they are no longer needed
* The `tutor.vim` script is simplified
* The `README` indicates `utf-8` as a requirement
* update vimtutor.bat file
In 2025, there is no realistic scenario where a beginner starts the Vim
9.1 tutor on a machine that lacks UTF-8 support.
This change will ease the maintenance of the tutor files. Cf #17562 for
an example.
closes: #17582
closes: #17586
Co-authored-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/vimtutor.bat b/vimtutor.bat
index cd73384..822bf3f 100644
--- a/vimtutor.bat
+++ b/vimtutor.bat
@@ -37,11 +37,11 @@
:GetChptLngs
for %%G in (tutor1;tutor2) do (
- if exist "%~dp0tutor\%%G" (set "lngs_%%G=en;") else (
- if exist "%~dp0tutor\%%G.utf-8" set "lngs_%%G=en;")
- for /F "tokens=2 delims=._" %%H in (
- '2^> nul dir /B /A:-D "%~dp0tutor\%%G.???.utf-8"') do (
- call set "lngs_%%G=%%lngs_%%G%%%%H;")
+ if exist "%~dp0tutor\%%G" (set "lngs_%%G=en;")
+ for /F "tokens=2 delims=." %%H in (
+ '2^> nul dir /B /A:-D "%~dp0tutor\%%G.???" "%~dp0tutor\%%G.??_??"') do (
+ call set "lngs_%%G=%%lngs_%%G%%%%H;"
+ )
)
:EndGetChptLngs
@@ -88,7 +88,7 @@
call "%~dp0vim.exe" -u NONE -c "so $VIMRUNTIME/tutor/tutor.vim"
if ERRORLEVEL 1 goto NoExecutable
-:: Start vim without any .vimrc, set 'nocompatible and 'showcmd''
+:: Start vim without any .vimrc, set 'nocompatible' and 'showcmd'
call "%~dp0vim.exe" -u NONE -c "set nocp sc" %TUTORCOPY%
goto End
@@ -190,8 +190,8 @@
powershell.exe -NoLogo -NoProfile -Command ^
[system.globalization.cultureinfo]::GetCultures('AllCultures') ^| ^
-Where Name -NotLike "*-*" ^| Where DisplayName -NotLike "Invariant*" ^| ^
-%%{$_.Name + \"`t\" + $_.DisplayName + \"`t\" + $_.NativeName} ^| ^
+Where DisplayName -NotLike "Invariant*" ^| %%{$_.Name.Replace('-','_') + ^
+\"`t\" + $_.DisplayName + \"`t\" + $_.NativeName} ^| ^
Sort-Object ^| Out-File -FilePath "%pscult_fl%" -Encoding utf8
if defined lngs_tutor1 (set "lngs=%lngs_tutor1%")
@@ -203,7 +203,7 @@
if defined lngs (
for %%G in (%lngs%) do (
for /F "tokens=2,* delims= " %%H in (
- '2^> nul findstr /BR "\<%%G\>" "%pscult_fl%"'
+ '2^> nul findstr /IBR "\<%%G\>" "%pscult_fl%"'
) do (set "%%G_name=%%H %%I")
)
set "bar_name=Bavarian Boarisch"
@@ -233,12 +233,12 @@
goto End
:DelTmpCopy
-:: remove the copy of the tutor
+:: deleted the copy of the tutor
if exist %TUTORCOPY% del /F /Q %TUTORCOPY%
goto :EOF
:End
-:: remove the copy of the tutor and ISO639 file
+:: deleted the copy of the tutor and the pscult.tmp file
if exist %TUTORCOPY% del /F /Q %TUTORCOPY%
if exist %pscult_fl% del /F /Q %pscult_fl%
chcp %_sav_chcp% 1> nul