Registration of Vim executable on Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Registration of Vim executable on Windows

Anton Shepelev
Hello, all

How are the Vim executables regitered on Windows so that
they are always available from the command prompt even
though no environment variable seems to contain their path? On
my PC, for example, Vim's executables are installed at

  C:\Program Files\Vim\vim80

but

  set | grep vim

does show anything.  How does Windows locate vim.exe,
gvim.exe when I invoke them from the command line?

--
Please, do not forward replies to the list to my e-mail.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200803151054.b965329b07d6e7e428acc067%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Christian Brabandt

On Mo, 03 Aug 2020, Anton Shepelev wrote:

> Hello, all
>
> How are the Vim executables regitered on Windows so that
> they are always available from the command prompt even
> though no environment variable seems to contain their path? On
> my PC, for example, Vim's executables are installed at
>
>   C:\Program Files\Vim\vim80
>
> but
>
>   set | grep vim
>
> does show anything.  How does Windows locate vim.exe,
> gvim.exe when I invoke them from the command line?

This is done using the %PATH% environment variable, see e.g. the
wikipedia article: https://en.wikipedia.org/wiki/PATH_(variable)

Best,
Christian
--
Toni fällt in den See wird aber gerettet. Der Retter fragt ihn:
"Warum bist du denn nicht geschwommen?" Toni: "Aber da steht doch ein
Schild - Schwimmen Verboten!"

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200803121257.GD4701%40256bit.org.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Anton Shepelev
In reply to this post by Anton Shepelev
I wrote:

> On my PC, for example, Vim's executables are installed at
>
>   C:\Program Files\Vim\vim80
>
> but
>
>   set | grep vim
>
> does show anything.

* does not show anything.

--
Please, do not forward replies to the list to my e-mail.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200803151340.f7ce607e6e4dd85a10693525%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Tony Mechelynck
On Mon, Aug 3, 2020 at 2:15 PM Anton Shepelev <[hidden email]> wrote:

>
> I wrote:
>
> > On my PC, for example, Vim's executables are installed at
> >
> >   C:\Program Files\Vim\vim80
> >
> > but
> >
> >   set | grep vim
> >
> > does show anything.
>
> * does not show anything.

At the command prompt,
    echo %PATH%

should display a list of directories, one of which contains the Vim
executables. All executables you invoke at the command prompt are
searched in that same list, and the first one found gets executed. (If
your comand interpreter includes code for built-in commands, those
ones are looked-up first, and executed if a match is found, unless you
specify the .exe, .com, or .bat extension.)

Best regards,
Tony.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXtiEn%2BTbkS3S-E-RqYMhSx0v_-OtqNDogZowiapqRxyEw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Anton Shepelev
Tony Mechelynck to Anton Shepelev:

> > On my PC, for example, Vim's executables are installed
> > at
> >
> >   C:\Program Files\Vim\vim80
> >
> > but
> >
> >   set | grep vim
> >
> > does [not] show anything.
>
> At the command prompt,
>     echo %PATH%
>
> should display a list of directories, one of which
> contains the Vim executables.

The `set' command, invoked without parameters, lists all the
available environment variables with their values, so my
command `set | grep vim' should have found `vim' too.  Here
is my complete output of `echo %PATH%':

  C:\MinGW\bin\
  D:\PROGRAMS\TCC\
  C:\WINDOWS\system32
  C:\WINDOWS
  C:\WINDOWS\System32\Wbem
  D:\BIN\
  D:\PROGRAMS\GRAPHVIZ\bin\
  C:\Program Files\gs\gs9.10\lib\
  C:\Program Files\gs\gs9.10\bin\
  D:\PROGRAMS\FPC\bin\i386-Win32
  C:\Program Files\GtkSharp\2.12\bin
  C:\Program Files\Subversion\bin
  C:\Program Files\Pandoc\

and the only instance of gvim.exe on my entire PC is:

  C:\Program Files\Vim\vim80\gvim.exe

Yet I can start gvim from the command line in any
directory...

--
Please, do not forward replies to the list to my e-mail.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200803203138.c4fb9f00ea80f5cb8aa60462%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Christian Brabandt

On Mo, 03 Aug 2020, Anton Shepelev wrote:

> Tony Mechelynck to Anton Shepelev:
>
> > > On my PC, for example, Vim's executables are installed
> > > at
> > >
> > >   C:\Program Files\Vim\vim80
> > >
> > > but
> > >
> > >   set | grep vim
> > >
> > > does [not] show anything.
> >
> > At the command prompt,
> >     echo %PATH%
> >
> > should display a list of directories, one of which
> > contains the Vim executables.

You can also use the path command

>
> The `set' command, invoked without parameters, lists all the
> available environment variables with their values, so my
> command `set | grep vim' should have found `vim' too.  Here
> is my complete output of `echo %PATH%':
>
>   C:\MinGW\bin\
>   D:\PROGRAMS\TCC\
>   C:\WINDOWS\system32
>   C:\WINDOWS
>   C:\WINDOWS\System32\Wbem
>   D:\BIN\
>   D:\PROGRAMS\GRAPHVIZ\bin\
>   C:\Program Files\gs\gs9.10\lib\
>   C:\Program Files\gs\gs9.10\bin\
>   D:\PROGRAMS\FPC\bin\i386-Win32
>   C:\Program Files\GtkSharp\2.12\bin
>   C:\Program Files\Subversion\bin
>   C:\Program Files\Pandoc\
>
> and the only instance of gvim.exe on my entire PC is:
>
>   C:\Program Files\Vim\vim80\gvim.exe
>
> Yet I can start gvim from the command line in any
> directory...

You can or you cannot? I believe the vim installer adds a vim.bat or
gvim.bat file to C:\windows\system32

Best,
Christian
--
Barmen (V.)
  Beschreibt den Versuch eines  Betrunkenen, sich bei jemandem lieb Kind
  zu machen.
                -- Douglas Adams, John Lloyd, Sven Böttcher ("Der tiefere Sinn des Labenz")

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200803175007.GE4701%40256bit.org.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Gabriele Fava
On 03/08/2020 19.50, Christian Brabandt wrote:
> You can or you cannot? I believe the vim installer adds a vim.bat or
> gvim.bat file to C:\windows\system32

It adds various .bat files, among which vim.bat and gvim.bat, to
C:\Windows, which by default is included in the %PATH%.

It is indeed quite unusual and if you're not aware or have forgotten
about the files it's not very easy to find out what's going on.

However the installer mentions them clearly (currently the option is
called "Create .bat files", with a description "Create .bat files for
Vim variants in the Windows directory for command line use"), and indeed
they are not added by the default installation, you have to toggle the
option manually or choose the "Full" installation.

Older installers though did not have the description, so it was harder
to understand what the option did.

And in any case you'll probably forget about the whole thing after a few
months (I did)


Kind regards,

Gabriele

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/3a2cc40b-59d0-9784-c7b0-4e80c541b329%40tiscali.it.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Anton Shepelev
In reply to this post by Christian Brabandt
Christian Brabandt to Anton Shepelev:

> > Yet I can start gvim from the command line in any
> > directory...
>
> You can or you cannot? I believe the vim installer adds a
> vim.bat or gvim.bat file to C:\windows\system32

Ah, that explains it.  Thank you, Christian.

--
Please, do not forward replies to my e-mail.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200803232625.0fa138dee9588c5a96835e73%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Anton Shepelev
In reply to this post by Gabriele Fava
Gabriele Fava to Christian Brabandt:

> > I believe the vim installer adds a vim.bat or gvim.bat
> > file to C:\windows\system32
>
> It adds various .bat files, among which vim.bat and
> gvim.bat, to C:\Windows, which by default is included in
> the %PATH%.
>
> It is indeed quite unusual and if you're not aware or have
> forgotten about the files it's not very easy to find out
> what's going on.
>
> However the installer mentions them clearly (currently the
> option is called "Create .bat files", with a description
> "Create .bat files for Vim variants in the Windows
> directory for command line use"), and indeed they are not
> added by the default installation, you have to toggle the
> option manually or choose the "Full" installation.

Indeed. I thought those .bat files to were supplementary
scripts for using Vim non-interactively and did not care a
carrot about reading the detailed description. Thank you for
the explanation, Gabriele. I should like to propose a more
descriptive name for that installer item but cannot come up
with one sufficiently short.

--
Please, do not forward replies to my e-mail.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200803233411.c2d1adb1e0ac1a92b51da4fa%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Gabriele Fava
On 03/08/2020 22.34, Anton Shepelev wrote:
> I should like to propose a more
> descriptive name for that installer item but cannot come up
> with one sufficiently short.

I dug through vim's history and I found out that these batch files were
introduced along with the nsis instaler in vim 6.0
(https://ftp.vim.org/pub/vim/pc/gvim60.exe), and the option's
description stayed "Create .bat files for command line use" from that
version up to v8.1.0616 when the whole installer was refreshed (and the
current "Create .bat files" string was introduced).

It's not very easy to choose a better name, maybe "Add .bat files in
%SystemRoot%" might be more clear (hopefully with %SystemRoot% expanded
to its actual value - usually C:\Windows).
And the description maybe might just say, since there's only so much
space for it, something like "...so that typing 'vim', 'gvim' etc. will
launch vim from any command prompt"

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/31342ef3-44ee-1e31-6f1e-c8d86ed1eb9d%40tiscali.it.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Anton Shepelev
Gabriele Fava:

> I  dug  through vim's history and I found out that
> these batch files were introduced along  with  the
> nsis instaler in vim 6.0
> (https://ftp.vim.org/pub/vim/pc/gvim60.exe),
> and  the  option's description stayed "Create .bat
> files for command line use" from that  version  up
> to  v8.1.0616  when  the  whole  installer was re-
> freshed  (and  the  current  "Create  .bat  files"
> string was introduced).

Thanks for the reasearch, Gabriele!

> It's  not very easy to choose a better name, maybe
> "Add .bat files in  %SystemRoot%"  might  be  more
> clear (hopefully with %SystemRoot% expanded to its
> actual value - usually C:\Windows).  And  the  de-
> scription maybe might just say, since there's only
> so much space for it, something like  "...so  that
> typing 'vim', 'gvim' etc. will launch vim from any
> command prompt"

It is a hard problem in English compostion,  indeed.
Maybe say something more abstract:

  1.  Make Vim available on command line
  2.  Register Vim for command-line invocaton

and  let the Description tell the implementation de-
tails,  that  it  means  putting   .bat   files   in
C:\Windows ?   I  for one should prefer it that way,
because this wording would not confuse me.

--
Please, do not forward replies to my e-mail.

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200807001833.850bdee0cec2cd8b5a731404%40gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Gabriele Fava
On 06/08/2020 23.18, Anton Shepelev wrote:

> Gabriele Fava:
>
>> I  dug  through vim's history and I found out that
>> these batch files were introduced along  with  the
>> nsis instaler in vim 6.0
>> (https://ftp.vim.org/pub/vim/pc/gvim60.exe),
>> and  the  option's description stayed "Create .bat
>> files for command line use" from that  version  up
>> to  v8.1.0616  when  the  whole  installer was re-
>> freshed  (and  the  current  "Create  .bat  files"
>> string was introduced).
> Thanks for the reasearch, Gabriele!
>
>> It's  not very easy to choose a better name, maybe
>> "Add .bat files in  %SystemRoot%"  might  be  more
>> clear (hopefully with %SystemRoot% expanded to its
>> actual value - usually C:\Windows).  And  the  de-
>> scription maybe might just say, since there's only
>> so much space for it, something like  "...so  that
>> typing 'vim', 'gvim' etc. will launch vim from any
>> command prompt"
> It is a hard problem in English compostion,  indeed.
> Maybe say something more abstract:
>
>    1.  Make Vim available on command line
>    2.  Register Vim for command-line invocaton
>
> and  let the Description tell the implementation de-
> tails,  that  it  means  putting   .bat   files   in
> C:\Windows ?   I  for one should prefer it that way,
> because this wording would not confuse me.

I apologise for replying so late, I missed your message and then forgot
about the thread

Yes, I agree with you, "Make Vim available on command line" sounds good.

By the way, for the developers, I also noticed that the italian
translation of the option is wrong and very hard to understand (I think
a correct one, for the current descriptions, would be "Crea file .bat"
and "Crea file .bat per varianti di Vim nella directory di Windows, per
utilizzo da riga di comando").


Kind regards,

Gabriele

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/dcf36004-bddc-7510-c198-1cd71f7b3ac9%40tiscali.it.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Christian Brabandt

On Di, 08 Sep 2020, Gabriele Fava wrote:
> By the way, for the developers, I also noticed that the italian
> translation
> of the option is wrong and very hard to understand (I think a correct one,
> for the current descriptions, would be "Crea file .bat" and "Crea file .bat
> per varianti di Vim nella directory di Windows, per utilizzo da riga di
> comando").

Could you please fork and clone the repository to your local workspace,
go to the nsis/lang/ directory, then you can fix the typo in the file
italian.nsi. Then commit your change and push to your fork and create a
PR for the changed file. Thanks!

Best,
Christian
--
Kein Kunde kauft jemals ein Erzeugnis. Er kauft immer das, was das
Erzeugnis für ihn leistet.
                -- Peter Drucker

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200908165158.GC8698%40256bit.org.
Reply | Threaded
Open this post in threaded view
|

Re: Registration of Vim executable on Windows

Gabriele Fava
On 08/09/2020 18.51, Christian Brabandt wrote:
> Could you please fork and clone the repository to your local workspace,
> go to the nsis/lang/ directory, then you can fix the typo in the file
> italian.nsi. Then commit your change and push to your fork and create a
> PR for the changed file. Thanks!

Ok, done

--
--
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 the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/e40e8b9c-f65c-5984-7469-7498e7947b7e%40tiscali.it.