Q&A: MSDOS SET command gave me some of my mapped commands

42 views
Skip to first unread message

markem

unread,
Nov 29, 2025, 1:27:50 AMNov 29
to vim_use
I am writing a PHP script to allow me to modify everything in my environment variables. All I have gotten to so far was to do the Microsoft DOS command SET to get the list of environment variables. To my surprise I got the following:

    [51] => map_h=:map h :w<CR>:!cls<CR>:!C:\xampp\php/php %<CR>
    [52] => map_i=:map i :w<CR>:!cls<CR>:!C:\xampp\php/php -l %<CR>
    [53] => map_u=:map u :w<CR>:!cls<CR>:!C:\xampp\php/php % > out.dat<CR>

So I went "That's really weird. Maybe I did something wrong in my program." So I did a

:!set > out.dat

And in looking at the output file I found:

macos9_path=C:\Program_Files\MacOS9\Programs
mame_path=C:\Program_Files\Mame Gaming
map_h=:map h :w<CR>:!cls<CR>:!C:\xampp\php/php %<CR>
map_i=:map i :w<CR>:!cls<CR>:!C:\xampp\php/php -l %<CR>
map_u=:map u :w<CR>:!cls<CR>:!C:\xampp\php/php % > out.dat<CR>
mingw_path=C:\Program Files (x86)\MinGWStudio\MinGW\bin
MSDevDir=C:\Program Files (x86)\DSv5\SharedIDE

But when I tried to get rid of these map commands, I am told

ERROR: The system was unable to find the specified registry key or value.
ERROR: The system was unable to find the specified registry key or value.
ERROR: The system was unable to find the specified registry key or value.
Hit any key to close this window...

Now - I really do have those commands in my VIM script and they all work. The map_u command was how I just ran the PHP script. What I am wondering about is - how are they being generated. Is it something I'm doing in Vim itself? All I have is a map command:

:map <rest of the command>

So I thought this was rather strange. If anyone has ideas I'd like to hear them because this has me baffled.

Thanks in advance.

Mark

markem

unread,
Nov 29, 2025, 1:31:08 AMNov 29
to vim_use
Sorry - I am running VIM v9.1 on Windows 10 system. If you need more info - let me know. Thanks.

Christian Brabandt

unread,
Nov 30, 2025, 4:48:13 AMNov 30
to vim...@googlegroups.com

On Fr, 28 Nov 2025, markem wrote:

> I am writing a PHP script to allow me to modify everything in my environment variables. All I have gotten to so far was to do the Microsoft DOS command SET to get the list of environment variables. To my surprise I got the following:
>
>     [51] => map_h=:map h :w<CR>:!cls<CR>:!C:\xampp\php/php %<CR>
>     [52] => map_i=:map i :w<CR>:!cls<CR>:!C:\xampp\php/php -l %<CR>
>     [53] => map_u=:map u :w<CR>:!cls<CR>:!C:\xampp\php/php % > out.dat<CR>
>
> So I went "That's really weird. Maybe I did something wrong in my program." So I did a
>
> :!set > out.dat
>
> And in looking at the output file I found:
>
> macos9_path=C:\Program_Files\MacOS9\Programs
> mame_path=C:\Program_Files\Mame Gaming
> map_h=:map h :w<CR>:!cls<CR>:!C:\xampp\php/php %<CR>
> map_i=:map i :w<CR>:!cls<CR>:!C:\xampp\php/php -l %<CR>
> map_u=:map u :w<CR>:!cls<CR>:!C:\xampp\php/php % > out.dat<CR>
> mingw_path=C:\Program Files (x86)\MinGWStudio\MinGW\bin
> MSDevDir=C:\Program Files (x86)\DSv5\SharedIDE

So it seems you did define those in your environment, not inside vim.
Check Environment settings for your Windows operating system.

>
> But when I tried to get rid of these map commands, I am told

What exactly did you try? You should either use `:unlet $map_h` but this
will only unset those variables inside your Vim session, or using
set map_h=
in a cmd.com terminal window to remove it temporarily inside your
cmd.exe session.


Thanks,
Christian
--
Why does a ship carry cargo and a truck carry shipments?

markem

unread,
Dec 7, 2025, 8:33:15 PM (7 days ago) Dec 7
to vim_use
No - I do not want to get rid of the commands. They are a part of my VIM Script when I edit a PHP file. After trying several things for a few hours all I can say is - is that for some reason, when I execute the PHP - these three commands just include themselves. Unknow why. Oh well, I'll just make sure to remove them from whatever information I get from doing an EXEC() command. I was mainly wondering if VIM makes temporary Windows variables.

Christian Brabandt

unread,
Dec 8, 2025, 10:24:18 AM (6 days ago) Dec 8
to vim...@googlegroups.com

On So, 07 Dez 2025, markem wrote:

> No - I do not want to get rid of the commands. They are a part of my
> VIM Script when I edit a PHP file. After trying several things for a
> few hours all I can say is - is that for some reason, when I execute
> the PHP - these three commands just include themselves. Unknow why. Oh
> well, I'll just make sure to remove them
> from whatever information I get from doing an EXEC() command. I was
> mainly wondering if VIM makes temporary Windows variables.

It does so if you do :let $var=..., see :h :let-$

Thanks,


Thanks,
Christian
--
A Los Angeles judge ruled that "a citizen may snore with immunity in
his own home, even though he may be in possession of unusual and
exceptional ability in that particular field."

Mark Manning

unread,
Dec 9, 2025, 2:15:34 AM (6 days ago) Dec 9
to vim...@googlegroups.com
Let me try that.
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/VAd-XX1KMOU/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/vim_use/aTbtb1qHo38hSXDu%40256bit.org.
Reply all
Reply to author
Forward
0 new messages