Commit: runtime(doc): Correct shell command to get $VIMRUNTIME into shell

6 views
Skip to first unread message

Christian Brabandt

unread,
Jul 8, 2024, 3:15:10 PM7/8/24
to vim...@googlegroups.com
runtime(doc): Correct shell command to get $VIMRUNTIME into shell

Commit: https://github.com/vim/vim/commit/b3c232215d1d3733c6b7fa9748c0c8d79fd87b5c
Author: Shane Harper <sh...@shaneharper.net>
Date: Mon Jul 8 20:59:33 2024 +0200

runtime(doc): Correct shell command to get $VIMRUNTIME into shell

The original shell command could set the VIMRUNTIME variable to an
invalid path.
- since v9.0.0592 trailing spaces were typically added making the
path invalid. (I observed that spaces were added if the length of
the path wasn't equal to one less than an integer multiple of the
number of display columns.)
- newline character/s would be added, making the path invalid, if
the path was longer than the number of display columns.

The new command is shorter than the original command.

closes: #15184

Signed-off-by: Shane Harper <sh...@shaneharper.net>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index c0da5e3df..ebd60febc 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1,4 +1,4 @@
-*starting.txt* For Vim version 9.1. Last change: 2024 Jul 04
+*starting.txt* For Vim version 9.1. Last change: 2024 Jul 08


VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1257,7 +1257,7 @@ To change it later, use a ":let" command like this: >
In case you need the value of $VIMRUNTIME in a shell (e.g., for a script that
greps in the help files) you might be able to use this: >

- VIMRUNTIME=`vim -e -T dumb --cmd 'exe "set t_cm=\<C-M>"|echo $VIMRUNTIME|quit' | tr -d '
' `
+ VIMRUNTIME=$(vim -es '+put=$VIMRUNTIME|print|quit!')

Don't set $VIMRUNTIME to an empty value, some things may stop working.

Reply all
Reply to author
Forward
0 new messages