Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

As of next week, passwords will be entered in Morse code.


computers / alt.comp.os.windows-10 / Does Windows vim have a fmt command?

SubjectAuthor
* Does Windows vim have a fmt command?mike
+* Re: Does Windows vim have a fmt command?mechanic
|`* Re: Does Windows vim have a fmt command?mike
| `* Re: Does Windows vim have a fmt command?mechanic
|  `* Re: Does Windows vim have a fmt command?Thomas
|   `* Re: Does Windows vim have a fmt command?mechanic
|    +- Re: Does Windows vim have a fmt command?soyon
|    `* Re: Does Windows vim have a fmt command?Stan Brown
|     +* Re: Does Windows vim have a fmt command?Paul
|     |`* Re: Does Windows vim have a fmt command?Jerry
|     | `* Re: Does Windows vim have a fmt command?Paul
|     |  `* Re: Does Windows vim have a fmt command?Stan Brown
|     |   `* Re: Does Windows vim have a fmt command?Paul
|     |    `- Re: Does Windows vim have a fmt command?Stan Brown
|     `* Re: Does Windows vim have a fmt command?Chris
|      `* Re: Does Windows vim have a fmt command?Jerry
|       `* Re: Does Windows vim have a fmt command?Chris
|        `* Re: Does Windows vim have a fmt command?Chris
|         `* Re: Does Windows vim have a fmt command?Jerry
|          `- Re: Does Windows vim have a fmt command?Chris
`* Re: Does Windows vim have a fmt command?Paul
 +- Re: Does Windows vim have a fmt command?mike
 `* Re: Does Windows vim have a fmt command?Stan Brown
  `* Re: Does Windows vim have a fmt command?Paul
   +* Re: Does Windows vim have a fmt command?mike
   |+- Re: Does Windows vim have a fmt command?mechanic
   |`- Re: Does Windows vim have a fmt command?Stan Brown
   `* Re: Does Windows vim have a fmt command?Stan Brown
    `* Re: Does Windows vim have a fmt command?Andy Burnelli
     `- Re: Does Windows vim have a fmt command?Andy Burnelli

Pages:12
Does Windows vim have a fmt command?

<t0ijvd$rag$1@solani.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60485&group=alt.comp.os.windows-10#60485

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: thi...@address.is.invalid (mike)
Newsgroups: alt.comp.os.windows-10
Subject: Does Windows vim have a fmt command?
Date: Sat, 12 Mar 2022 22:36:52 +0530
Message-ID: <t0ijvd$rag$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 12 Mar 2022 17:06:54 -0000 (UTC)
Injection-Info: solani.org;
logging-data="27984"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Unison/2.1.10
Cancel-Lock: sha1:JluLkNbEcHbV9vJiZ6yf0KSyM68=
X-User-ID: eJwNyMkBwDAIA7CVCsYc49AQ9h+h1VOEi58wpxuXOw5Jpra+h3VTXwufGgWspfLWQm9kp/XwP+PTKJETK5b4ADf5FIA=
 by: mike - Sat, 12 Mar 2022 17:06 UTC

Does Windows vim have a Unix-like fmt command that can intelligently
truncate 80 character lines at the preceding space like :!fmt does?

Re: Does Windows vim have a fmt command?

<15lo5hi4a77kb.dlg@example1357.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60504&group=alt.comp.os.windows-10#60504

  copy link   Newsgroups: alt.comp.os.windows-10
Followup: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!hOqPe/Sdtq7sShObfZVALw.user.46.165.242.91.POSTED!not-for-mail
From: mecha...@example.net (mechanic)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Followup-To: alt.comp.os.windows-10
Date: Sat, 12 Mar 2022 18:28:31 +0000
Organization: Aioe.org NNTP Server
Message-ID: <15lo5hi4a77kb.dlg@example1357.net>
References: <t0ijvd$rag$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="33817"; posting-host="hOqPe/Sdtq7sShObfZVALw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: mechanic - Sat, 12 Mar 2022 18:28 UTC

On Sat, 12 Mar 2022 22:36:52 +0530, in alt.comp.os.windows-10 you
wrote:

> Does Windows vim have a Unix-like fmt command that can
> intelligently truncate 80 character lines at the preceding space
> like :!fmt does?

https://vi.stackexchange.com/questions/509/can-i-justify-text-in-vim

Re: Does Windows vim have a fmt command?

<t0irlr$10qo$1@solani.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60513&group=alt.comp.os.windows-10#60513

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: thi...@address.is.invalid (mike)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 00:48:18 +0530
Message-ID: <t0irlr$10qo$1@solani.org>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 12 Mar 2022 19:18:19 -0000 (UTC)
Injection-Info: solani.org;
logging-data="33624"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Unison/2.1.10
Cancel-Lock: sha1:9KDKfvDUAXBbayYjumYrPePoBzw=
X-User-ID: eJwNx8kBwDAIA7CVIGCbjpOL/UdI9ROCzq0kmGj0PbM6SexTdkuZtCasYhHCP3WMmaNL5jO89VVchwbgWg80mxP5
 by: mike - Sat, 12 Mar 2022 19:18 UTC

On 12-03-2022 18:28 mechanic <mechanic@example.net> wrote:

> https://vi.stackexchange.com/questions/509/can-i-justify-text-in-vim

Most of that was for linux but I tried the vim commands which didn't fail.
But they didn't work either.

This didn't fail but it didn't do anything.
:runtime macros/justify.vim
_j

This didn't fail either but it didn't do anything either.
:runtime macros/justify.vim
:set textwidth=80
:set formatoptions+=t
:nnoremap <C-j> gggqG_j
_j

What is needed is a solution that works on Windows.

Re: Does Windows vim have a fmt command?

<t0je5g$hdg$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60529&group=alt.comp.os.windows-10#60529

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 12 Mar 2022 19:33:52 -0500
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <t0je5g$hdg$1@dont-email.me>
References: <t0ijvd$rag$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Mar 2022 00:33:52 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="c6f49612b04dbd0177e7dcf054d8a4f6";
logging-data="17840"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+62yY36FDx2keZC7l8gmnRznUDhPPFz9E="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:HP8vloSpp3NmYFS7hDlOtTl0Jmo=
In-Reply-To: <t0ijvd$rag$1@solani.org>
Content-Language: en-US
 by: Paul - Sun, 13 Mar 2022 00:33 UTC

On 3/12/2022 12:06 PM, mike wrote:
> Does Windows vim have a Unix-like fmt command that can intelligently
> truncate 80 character lines at the preceding space like :!fmt does?

You're holding it wrong. Try

:%!/usr/bin/fmt -w 80

The % is a shorthand for the whole file, as % is the end of the file.
Then, having given it a target to work on, call the /usr/bin/fmt of
the bash shell file tree you're running vim in.

I had to find a thread on askubuntu.com to learn that I needed %.
I was escaping to shell OK, but just sitting there like a dope,
and control-c would return me to my vim session. Once the percent
was in there, the fmt worked seamlessly.

In the following, is shown two native Ubuntu windows, before and after.
The two panes at the bottom are Windows Terminal (Powershell) of
Windows 11, with a call to bash first, to enter bash shell, then
vim sample.txt, to edit my overly-long sample file that needs formatting.
The same bash shell is in Windows 10, with the same distro (Ubuntu 20.04)
available.

[Picture] If the frame is empty, right-click and select "Reload"

https://i.postimg.cc/yx1FZ56F/vim.gif

Since there are multiple ways now of getting executables, a hint
as to where you're working would help. In my case, it is bash shell
(wsl2) without wslg (no graphics capability native yet), Ubuntu 20.04
is the release used for the vim run. Remarkably similar to the real
Ubuntu running on the screen to my left, which made the "Ubuntu-colored"
part of the picture.

Paul

Re: Does Windows vim have a fmt command?

<t0jfub$1a3p$1@solani.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60530&group=alt.comp.os.windows-10#60530

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: thi...@address.is.invalid (mike)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 06:34:10 +0530
Message-ID: <t0jfub$1a3p$1@solani.org>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Mar 2022 01:04:12 -0000 (UTC)
Injection-Info: solani.org;
logging-data="43129"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Unison/2.1.10
Cancel-Lock: sha1:eCJSlpANo+DSOFAaynOKq9AWS8k=
X-User-ID: eJwFwYkBwCAIA8CV5EmQcTTU/UfoHYJGVRJMPDzWns86vQKj0lwT/cTpt9cbzZIanxcGOKSlQz25grf8zg9aExWY
 by: mike - Sun, 13 Mar 2022 01:04 UTC

On 12-03-2022 17:33 Paul <nospam@needed.invalid> wrote:

>:%!/usr/bin/fmt -w 80

C:\Windows\system32\cmd.exe /c (/usr/bin/fmt)
The system cannot find the path specified.
shell returned 1
Hit any key to close this window...

I was hoping not to have to install linux into windows.
But maybe that's the only way.
You'd think a macro would exist for Windows vim since it's a normal thing.

Re: Does Windows vim have a fmt command?

<MPG.3c96e6579e1c181a98fecd@news.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60532&group=alt.comp.os.windows-10#60532

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: the_stan...@fastmail.fm (Stan Brown)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 12 Mar 2022 17:18:51 -0800
Organization: Oak Road Systems
Lines: 40
Message-ID: <MPG.3c96e6579e1c181a98fecd@news.individual.net>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net tFlWF2G1wbkrmCJF3g1f0Q1pN8RAo6E5dh725mLs9DsBwcNz1U
Cancel-Lock: sha1:wwNvATZ2bWzsKvtL8CdIkSqgoV4=
User-Agent: MicroPlanet-Gravity/3.0.4
 by: Stan Brown - Sun, 13 Mar 2022 01:18 UTC

On Sat, 12 Mar 2022 19:33:52 -0500, Paul wrote:
> On 3/12/2022 12:06 PM, mike wrote:
> > Does Windows vim have a Unix-like fmt command that can intelligently
> > truncate 80 character lines at the preceding space like :!fmt does?
>
> You're holding it wrong. Try
>
> :%!/usr/bin/fmt -w 80

The OP complained that there was too much Linux in the reference he
found on line, so I think he wants a Windows solution and not any
variety of UNIX.

I don't know of a way in native Windows to wrap lines at or before
the 80th character. But Vim downloads for Windows are readily
available, and Vim can certainly do the job.

1. Create an auxiliary command file, called for example cmd.txt:

:set tw=80
:normal V$G
:normal gq
:wq

These four lines set wrap width to 80 characters, highlight the
entire file, wrap the highlighted part, and exit after writing the
changed file.

NOTE 1: Commands are case sensitive.

NOTE 2: Wrapping will apply to each section of text delimited by
blank lines.

2. Invoke Vim, using that command file to process the text file:

vim -c "so cmd.txt" textfilename

--
Stan Brown, Tehachapi, California, USA https://BrownMath.com/
Shikata ga nai...

Re: Does Windows vim have a fmt command?

<t0js0u$9cr$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60536&group=alt.comp.os.windows-10#60536

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 12 Mar 2022 23:30:21 -0500
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <t0js0u$9cr$1@dont-email.me>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me>
<MPG.3c96e6579e1c181a98fecd@news.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Mar 2022 04:30:22 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="c6f49612b04dbd0177e7dcf054d8a4f6";
logging-data="9627"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19T3JKJAbbNieEX6x0E14grnUUG4BHQGNg="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:2sZk1UKnxLSFpExIjJ8X9ud4Qtg=
In-Reply-To: <MPG.3c96e6579e1c181a98fecd@news.individual.net>
Content-Language: en-US
X-Mozilla-News-Host: news://nntp.aioe.org
 by: Paul - Sun, 13 Mar 2022 04:30 UTC

On 3/12/2022 8:18 PM, Stan Brown wrote:
> On Sat, 12 Mar 2022 19:33:52 -0500, Paul wrote:
>> On 3/12/2022 12:06 PM, mike wrote:
>>> Does Windows vim have a Unix-like fmt command that can intelligently
>>> truncate 80 character lines at the preceding space like :!fmt does?
>>
>> You're holding it wrong. Try
>>
>> :%!/usr/bin/fmt -w 80
>
> The OP complained that there was too much Linux in the reference he
> found on line, so I think he wants a Windows solution and not any
> variety of UNIX.
>
> I don't know of a way in native Windows to wrap lines at or before
> the 80th character. But Vim downloads for Windows are readily
> available, and Vim can certainly do the job.
>
> 1. Create an auxiliary command file, called for example cmd.txt:
>
> :set tw=80
> :normal V$G
> :normal gq
> :wq
>
> These four lines set wrap width to 80 characters, highlight the
> entire file, wrap the highlighted part, and exit after writing the
> changed file.
>
> NOTE 1: Commands are case sensitive.
>
> NOTE 2: Wrapping will apply to each section of text delimited by
> blank lines.
>
> 2. Invoke Vim, using that command file to process the text file:
>
> vim -c "so cmd.txt" textfilename

OK, where are you finding a vim ???

C:\Windows\System32\ ???
C:\Windows\System32\vim\ ???
C:\Program Files\Vim ???

On this copy of Windows 11 Home, there is no vim other
than the one in bash shell. Running a powershell or
a command prompt, is not digging up a positive response,
and neither is an Agent Ransack search.

I don't see anything in "Windows Features" that suggests
a vim is hiding in it.

I switched disks and checked a Win10 install. In a mozilla-build
tree and msys, I found an instance of some vim stuff. But that's an
auxiliary addition from Mozilla.

*******

Coreutils has a fmt in it. The installer will presumably attempt
to add something to %path%. I've never used "professional" installs
for those, just tossing a few bits and pieces into a work folder
when I need one. Back when Microsoft hated Linux, this is how
you got some of those functions.

http://gnuwin32.sourceforge.net/packages/coreutils.htm

Paul

Re: Does Windows vim have a fmt command?

<t0k16f$1nce$1@solani.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60538&group=alt.comp.os.windows-10#60538

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: thi...@address.is.invalid (mike)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 11:28:38 +0530
Message-ID: <t0k16f$1nce$1@solani.org>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me> <MPG.3c96e6579e1c181a98fecd@news.individual.net> <t0js0u$9cr$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Mar 2022 05:58:39 -0000 (UTC)
Injection-Info: solani.org;
logging-data="56718"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Unison/2.1.10
Cancel-Lock: sha1:tosvJs02HrFXQwzrwNj/rR0v6u4=
X-User-ID: eJwFwQERADEIAzBLdFB45Iwd9S/hE3oiX0Uyg6LOPivMUoOqc680i3FvtxpoAy+q09AYsb+9uU9j7GR0/mW8FZg=
 by: mike - Sun, 13 Mar 2022 05:58 UTC

On 13-03-2022 10:00 Paul <nospam@needed.invalid> wrote:

>> vim -c "so cmd.txt" textfilename
>
> OK, where are you finding a vim ???

I didn't realize Windows comes with vim/gvim but you seem to have found it
in an ancillary bash shell.

I loaded gvim from https://www.vim.org/download.php

I first blindly followed Stan's instructions which did something but not
what I wanted. (Some lines were still very long, some were wrapped at 80,
and blank lines seem to have disappeared.) I wasn't too worried about that
though as I didn't want a command line solution but an in-file !fmt result.

I ran the suggested commands inside a gvim session but they didn't wrap at
first, but since I was unfamiliar with the :normal command, I realized from
looking it up that "normal" requires additional "shift+q" & "return"
sequences (which adds a carriage return, usually signified as "^M" in
instructions).
https://vim.fandom.com/wiki/Using_normal_command_in_a_script_for_searching
https://stackoverflow.com/questions/426896/vim-ctrl-v-conflict-with-windows-paste

With the shift+q (in Linux it's control+q I think) in mind, this works well.

Inside a gvim session, set the textwidth :set tw=80
Position the cursor to where you want to begin wrapping long lines.
Wrap at the first blank behind 80 characters :normal V$G<shift+q><return>
That wraps from the cursor on down & puts the cursor at the end of the file.
This didn't do anything that I could tell :normal gq
This wrote and quit :wq

I knew the $G moved the cursor to the beginning of the last line of the
file.

But I wasn't familiar with the "V" command which is a "line Visual" mode.
https://opensource.com/article/19/2/getting-started-vim-visual-mode

I also wasn't familiar with the normal command which is "normal mode."
http://vimdoc.sourceforge.net/htmldoc/various.html#:normal

I still am not sure if the "gq" does anything but looking up ":g" tells me
that it somehow "marks every line for a pattern" but the "q" means "quit".
https://vim.fandom.com/wiki/Power_of_g

I'm not sure what ":normal gq" does, as a result of it not doing anything I
could see, but if I ignore it, the solution still works the same.

Assuming the textwidth=80 is set in the _gvimrc file, all I need to do now
is look up how to simplify (with a macro perhaps) the "V$G^M" typing steps.

Much appreciation goes out to Stan Brown for the ":normal V$G^M" sequence!

Re: Does Windows vim have a fmt command?

<12b42ac6pklsk.dlg@example1357.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60545&group=alt.comp.os.windows-10#60545

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!z5MAgYbMNva1LYentGCg2A.user.46.165.242.91.POSTED!not-for-mail
From: mecha...@example.net (mechanic)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 10:50:30 +0000
Organization: Aioe.org NNTP Server
Message-ID: <12b42ac6pklsk.dlg@example1357.net>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net> <t0irlr$10qo$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="35764"; posting-host="z5MAgYbMNva1LYentGCg2A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: mechanic - Sun, 13 Mar 2022 10:50 UTC

On Sun, 13 Mar 2022 00:48:18 +0530, mike wrote:

> On 12-03-2022 18:28 mechanic <mechanic@example.net> wrote:
>
>> https://vi.stackexchange.com/questions/509/can-i-justify-text-in-vim
>
> Most of that was for linux but I tried the vim commands which didn't fail.
> But they didn't work either.
>
> This didn't fail but it didn't do anything.
> :runtime macros/justify.vim
> _j
>
> This didn't fail either but it didn't do anything either.
> :runtime macros/justify.vim
> :set textwidth=80
> :set formatoptions+=t
> :nnoremap <C-j> gggqG_j
> _j
>
> What is needed is a solution that works on Windows.

Vim and gvim work perfectly well in Windows. No need to run away to
Linux. Getting the right instructions in your gvimrc file takes time
so be patient with your trials. It's a pity that 'par' never got
much drive behind it, it was a much better formatter than the 'fmt'
program in bash. With the few commands you need in your rc file
(textwidth is important) you'll be set with the right options for
your needs. The spell check is pretty good in vim too! I use vim as
the alternate editor in the emailer, and it's pretty good.

Re: Does Windows vim have a fmt command?

<1nngqgtracvp6$.dlg@example1357.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60546&group=alt.comp.os.windows-10#60546

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!z5MAgYbMNva1LYentGCg2A.user.46.165.242.91.POSTED!not-for-mail
From: mecha...@example.net (mechanic)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 10:59:30 +0000
Organization: Aioe.org NNTP Server
Message-ID: <1nngqgtracvp6$.dlg@example1357.net>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me> <MPG.3c96e6579e1c181a98fecd@news.individual.net> <t0js0u$9cr$1@dont-email.me> <t0k16f$1nce$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="42752"; posting-host="z5MAgYbMNva1LYentGCg2A.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: mechanic - Sun, 13 Mar 2022 10:59 UTC

On Sun, 13 Mar 2022 11:28:38 +0530, mike wrote:

> I still am not sure if the "gq" does anything but looking up ":g" tells me
> that it somehow "marks every line for a pattern" but the "q" means "quit".
> https://vim.fandom.com/wiki/Power_of_g

gq is an operator, to be followed by a selector. I use the command
'gqap' a lot to reformat paragraphs.

http://vimdoc.sourceforge.net/htmldoc/usr_25.html

Read the section 'REFORMATTING'

Re: Does Windows vim have a fmt command?

<MPG.3c977baedb6cd5bf98fecf@news.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60549&group=alt.comp.os.windows-10#60549

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: the_stan...@fastmail.fm (Stan Brown)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 04:56:01 -0700
Organization: Oak Road Systems
Lines: 51
Message-ID: <MPG.3c977baedb6cd5bf98fecf@news.individual.net>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me> <MPG.3c96e6579e1c181a98fecd@news.individual.net> <t0js0u$9cr$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net tsAoRD8EwNLKXjzOK4bVPwxNULPXdqHB35x6BADqKN/myP2Hj1
Cancel-Lock: sha1:/7Sn88Ew8Q4Hvi/UnscuamtgA28=
User-Agent: MicroPlanet-Gravity/3.0.4
 by: Stan Brown - Sun, 13 Mar 2022 11:56 UTC

On Sat, 12 Mar 2022 23:30:21 -0500, Paul wrote:
>
> On 3/12/2022 8:18 PM, Stan Brown wrote:
> > The OP complained that there was too much Linux in the reference
> > he
> > found on line, so I think he wants a Windows solution and not any
> > variety of UNIX.
> >
> > I don't know of a way in native Windows to wrap lines at or before
> > the 80th character. But Vim downloads for Windows are readily
> > available, and Vim can certainly do the job.
> >
> > 1. Create an auxiliary command file, called for example cmd.txt:
> >
> > :set tw=80
> > :normal V$G
> > :normal gq
> > :wq
> >
> > These four lines set wrap width to 80 characters, highlight the
> > entire file, wrap the highlighted part, and exit after writing the
> > changed file.
> >
> > NOTE 1: Commands are case sensitive.
> >
> > NOTE 2: Wrapping will apply to each section of text delimited by
> > blank lines.
> >
> > 2. Invoke Vim, using that command file to process the text file:
> >
> > vim -c "so cmd.txt" textfilename
>
> OK, where are you finding a vim ???

It's a third-party application, which I have used for decades and
which someone mentioned upthread. I didn't state explicitly that it
doesn't come with Windows, but I thought that was implied by "I don't
know of a way in native Windows to wrap lines at or before the 80th
character."

Vim can be downloaded from www.vim.org. It's 100% free; the author
requests that you donate to poor children in Uganda but there's no
nagging.

Vim definitely has a learning curve, but you can do about anything in
it, and one great benefit is that it's been ported to almost every OS
there is. I used to use it on VAX/VMS.

--
Stan Brown, Tehachapi, California, USA https://BrownMath.com/
Shikata ga nai...

Re: Does Windows vim have a fmt command?

<MPG.3c977c03969877c998fed0@news.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60550&group=alt.comp.os.windows-10#60550

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.usenet.farm!feed.usenet.farm!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: the_stan...@fastmail.fm (Stan Brown)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 04:57:32 -0700
Organization: Oak Road Systems
Lines: 14
Message-ID: <MPG.3c977c03969877c998fed0@news.individual.net>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me> <MPG.3c96e6579e1c181a98fecd@news.individual.net> <t0js0u$9cr$1@dont-email.me> <t0k16f$1nce$1@solani.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net Fff3YWD3U7Hz8h+QRH+SAwYdfioKqv/j9H8w+Z0IfHm1/vkI1f
Cancel-Lock: sha1:i3oOhLYwUv6mGlIH4qGkm+JP6KI=
User-Agent: MicroPlanet-Gravity/3.0.4
 by: Stan Brown - Sun, 13 Mar 2022 11:57 UTC

On Sun, 13 Mar 2022 11:28:38 +0530, mike wrote:
> I first blindly followed Stan's instructions which did something but not
> what I wanted. (Some lines were still very long, some were wrapped at 80,
> and blank lines seem to have disappeared.)

Empty lines would not disappear. Lines with only blanks on them would
be part of the reflow.

I tested my script before posting, so I must have not understood what
you wanted.

--
Stan Brown, Tehachapi, California, USA https://BrownMath.com/
Shikata ga nai...

Re: Does Windows vim have a fmt command?

<t0lh3v$10lq$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60571&group=alt.comp.os.windows-10#60571

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!3PLzD/rb74ta/CXxNcmbeA.user.46.165.242.75.POSTED!not-for-mail
From: spa...@nospam.com (Andy Burnelli)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 19:36:31 +0000
Organization: Aioe.org NNTP Server
Message-ID: <t0lh3v$10lq$1@gioia.aioe.org>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me> <MPG.3c96e6579e1c181a98fecd@news.individual.net> <t0js0u$9cr$1@dont-email.me> <MPG.3c977baedb6cd5bf98fecf@news.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="33466"; posting-host="3PLzD/rb74ta/CXxNcmbeA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Andy Burnelli - Sun, 13 Mar 2022 19:36 UTC

Stan Brown wrote:

> Vim definitely has a learning curve, but you can do about anything in
> it, and one great benefit is that it's been ported to almost every OS
> there is. I used to use it on VAX/VMS.

To be purposefully helpful and to advise Paul about the ubiquity of "vi",
I can emphatically second what Stan Brown said which is that many people who
worked in the Silicon Valley like I did for decades went through the phases
of AT&T Unix, Masscomp, Sun, DEC, etc., well before "Linux" became the norm.

We'd go to customer sites and then need to work on their computer as
portable computers didn't exist either - so you were at the mercy of
"whatever they had" as your text editor, such as emacs or nano.

You soon learned that "ed" (as I recall) was always there but so was "vi"
which was a hellova lot better (in most of our opinions). Sure there were
others, but "vi" was _always_ gonna be there (and in the default path).

As Stan Brown said, the learning curve is horrific, but once it's engrained
into your finger memory, you never forget it (it's like your first car).

Then Linux supplanted SunOS/Solaris and "vi" was still always there.
When we moved to Windows, the Notepad was atrocious (and probably still is).

So we simply added gVim (which is basically an almost perfect copy of vi on
Windows) where gVim has the best of both worlds in terms of GUI and
finger-control. I'm sure Stan Brown knows this, but vi was designed to be
_all_ fingers, so almost anything (if not everything) can be done with your
fingers.

The gVim GUI sucks but that doesn't matter (IMHO) since you almost never
need to use it, except maybe to position the cursor when where you want the
cursor to be is already on the screen.

In fact, Marek Novotny wrote most of my "newsreader" scripts which I'm using
to compose this message where I'm composing in gVim and sending via telnet
scripts (i.e., my "newsreader" is vi plus a bunch of telnet scripts).

The advantage of vi is that it can do anything.
The disadvantage of vi is that the learning curve is at least a month.

One _great_ thing though is if you've used vi for decades, like I have, and
like Stan Brown probably has, the GUI never changes in any way that you
care.

By way of contrast, if you used Microsoft Word 2003 and then 2007 and then
2010 and then 2016, etc., the damn GUI changes a lot.

Same stuff. Different location.
That _never_ happens with vi.

As my wife (whom I met at a startup when I moved to the Silicon Valley) used
to tell me, diamonds aren't forever, "vi is forever".

Re: Does Windows vim have a fmt command?

<t0lie1$1j96$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60573&group=alt.comp.os.windows-10#60573

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!3PLzD/rb74ta/CXxNcmbeA.user.46.165.242.75.POSTED!not-for-mail
From: spa...@nospam.com (Andy Burnelli)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sun, 13 Mar 2022 19:58:57 +0000
Organization: Aioe.org NNTP Server
Message-ID: <t0lie1$1j96$1@gioia.aioe.org>
References: <t0ijvd$rag$1@solani.org> <t0je5g$hdg$1@dont-email.me> <MPG.3c96e6579e1c181a98fecd@news.individual.net> <t0js0u$9cr$1@dont-email.me> <MPG.3c977baedb6cd5bf98fecf@news.individual.net> <t0lh3v$10lq$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="52518"; posting-host="3PLzD/rb74ta/CXxNcmbeA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-GB
 by: Andy Burnelli - Sun, 13 Mar 2022 19:58 UTC

Andy Burnelli wrote:

> As Stan Brown said, the learning curve is horrific, but once it's engrained
> into your finger memory, you never forget it (it's like your first car).

In post processing that comment I want to stress that it's like learning to
drive your first car assuming that first car was a manual transmission.

The learning curve (as most of us were somewhere around 13 or 14 when we
learned to drive) is something that never leaves you as most of you must
know who drove sticks in those days.

You never forget how to drive a stick (nor how to ride a motorcycle).

It never changes no matter what vehicle you are in, which is why Stan Browne
mentioned that it's the one text editor that you can always count on as the
location of the commands never change given they're all on the keyboard.

Most of us do keep a cheat sheet in Windows which I recommend setting up.
Run > vi
Where that brings up your cheat sheet, oh, say, in
c:\data\docs\hints\vi.txt
And where there's a one-time setup for Run commands in the registry
Computer\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\
vi.exe === c:\data\docs\hints\vi.txt

An example of what you might have in your vi cheat sheet could be
%s/^/\=printf('%-4d', line('.')) => insert line numbers
:g/^\s*$/d => remove blank lines
:g/^$/d => delete empty lines
:%s/\s\+$//e => eliminate duplicate blank lines
:v/\S/,/\S/-j => join consequitive lines not between blank lines
:g/^[ \t\u3000]*$/d => remmove empty lines & lines with space, tab or ideographs
etc.
--
Working alongide intelligent helpful people, we can solve most problems.

Re: Does Windows vim have a fmt command?

<t1285o$1ptdk$1@paganini.bofh.team>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60750&group=alt.comp.os.windows-10#60750

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!paganini.bofh.team!not-for-mail
From: canope...@gmail.com (Thomas)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Fri, 18 Mar 2022 08:23:38 -0700
Organization: To protect and to server
Message-ID: <t1285o$1ptdk$1@paganini.bofh.team>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net> <t0irlr$10qo$1@solani.org> <12b42ac6pklsk.dlg@example1357.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Date: Fri, 18 Mar 2022 15:23:37 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="1897908"; posting-host="PcTzBk7xBAJXWnz+B5lyzg.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team";
User-Agent: G2/1.0
X-Notice: Filtered by postfilter v. 0.9.1
 by: Thomas - Fri, 18 Mar 2022 15:23 UTC

On Sunday, March 13, 2022 at 3:50:30 AM, mechanic wrote:

> Vim and gvim work perfectly well in Windows.

Would the MKS Toolkit "fmt" command work on Windows?
https://www.mkssoftware.com/docs/man1/fmt.1.asp

Re: Does Windows vim have a fmt command?

<1u3elk1ngf7ed$.dlg@example1357.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60762&group=alt.comp.os.windows-10#60762

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!1A+qb9cKjDZYu4Kb22CNLg.user.46.165.242.91.POSTED!not-for-mail
From: mecha...@example.net (mechanic)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Fri, 18 Mar 2022 18:44:49 +0000
Organization: Aioe.org NNTP Server
Message-ID: <1u3elk1ngf7ed$.dlg@example1357.net>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net> <t0irlr$10qo$1@solani.org> <12b42ac6pklsk.dlg@example1357.net> <t1285o$1ptdk$1@paganini.bofh.team>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="60661"; posting-host="1A+qb9cKjDZYu4Kb22CNLg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: 40tude_Dialog/2.0.15.1
X-Notice: Filtered by postfilter v. 0.9.2
 by: mechanic - Fri, 18 Mar 2022 18:44 UTC

On Fri, 18 Mar 2022 08:23:38 -0700, in alt.comp.os.windows-10 you
wrote:

> On Sunday, March 13, 2022 at 3:50:30 AM, mechanic wrote:
>
>> Vim and gvim work perfectly well in Windows.
>
> Would the MKS Toolkit "fmt" command work on Windows?
> https://www.mkssoftware.com/docs/man1/fmt.1.asp

'fmt' -> not an editor command

You can run external Linux commands but in windows (unless you have
cygwin or something like that) that 'fmt' command won't be
recognised.

Re: Does Windows vim have a fmt command?

<t12lbb$rpv$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60764&group=alt.comp.os.windows-10#60764

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!n4f+oovcZiSGm3Yl2G/OEA.user.46.165.242.75.POSTED!not-for-mail
From: soy...@soyon.biz (soyon)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Fri, 18 Mar 2022 19:08:27 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <t12lbb$rpv$1@gioia.aioe.org>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net> <t0irlr$10qo$1@solani.org> <12b42ac6pklsk.dlg@example1357.net> <t1285o$1ptdk$1@paganini.bofh.team> <1u3elk1ngf7ed$.dlg@example1357.net>
Injection-Info: gioia.aioe.org; logging-data="28479"; posting-host="n4f+oovcZiSGm3Yl2G/OEA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: soyon - Fri, 18 Mar 2022 19:08 UTC

On Fri, 18 Mar 2022 18:44:49 +0000, mechanic wrote:

>> Would the MKS Toolkit "fmt" command work on Windows?
>> https://www.mkssoftware.com/docs/man1/fmt.1.asp
>
> 'fmt' -> not an editor command
>
> You can run external Linux commands but in windows (unless you have
> cygwin or something like that) that 'fmt' command won't be
> recognised.

Try this inside gvim and you'll see how the editor calls external commands.
:!sort u
:%sort

One calls the external sort command (found in the path).
The other calls the internal sort command (which has different options).

It would act the same with the fmt command if it's in the user's PATH.

Re: Does Windows vim have a fmt command?

<MPG.3c9e8558397321b98fedc@news.individual.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60768&group=alt.comp.os.windows-10#60768

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!news.uzoreto.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: the_stan...@fastmail.fm (Stan Brown)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Fri, 18 Mar 2022 13:03:08 -0700
Organization: Oak Road Systems
Lines: 23
Message-ID: <MPG.3c9e8558397321b98fedc@news.individual.net>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net> <t0irlr$10qo$1@solani.org> <12b42ac6pklsk.dlg@example1357.net> <t1285o$1ptdk$1@paganini.bofh.team> <1u3elk1ngf7ed$.dlg@example1357.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net HWf9UkZOKtPepNVrknpzAgXPPns2d2+ztIICNCsGhiacf5SIjr
Cancel-Lock: sha1:tFpqLdIoYloMeW7oxuZeE9HZDUo=
User-Agent: MicroPlanet-Gravity/3.0.11 (GRC)
 by: Stan Brown - Fri, 18 Mar 2022 20:03 UTC

On Fri, 18 Mar 2022 18:44:49 +0000, mechanic wrote:
> You can run external Linux commands but in windows (unless you have
> cygwin or something like that) that 'fmt' command won't be
> recognised.
>

What about WSL? If we install WSL, do we simply get the shell, or do
we get commands like fmt?

<https://docs.microsoft.com/en-us/windows/wsl/about>
says "The Windows Subsystem for Linux lets developers run a GNU/Linux
environment -- including most command-line tools, utilities, and
applications -- directly on Windows. ... Run Bash shell scripts and
GNU/Linux command-line applications including: vim, emacs, tmux. ..."

That certainly sounds like you'd get fmt, assuming fmt is a standard
Linux command-line utility. (My Linux knowledge isn't deep enough to
know whether it is or it isn't.)

--
Stan Brown, Tehachapi, California, USA https://BrownMath.com/
Shikata ga nai...

Re: Does Windows vim have a fmt command?

<t13jqb$l8h$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60777&group=alt.comp.os.windows-10#60777

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Fri, 18 Mar 2022 23:48:20 -0400
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <t13jqb$l8h$1@dont-email.me>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net>
<t0irlr$10qo$1@solani.org> <12b42ac6pklsk.dlg@example1357.net>
<t1285o$1ptdk$1@paganini.bofh.team> <1u3elk1ngf7ed$.dlg@example1357.net>
<MPG.3c9e8558397321b98fedc@news.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 19 Mar 2022 03:48:27 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="8fbccf5a9a67e4f3e59cc26801a02084";
logging-data="21777"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1814T7jwNzUzcELTypXC5u/S9jWbfNGCFo="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:qnoDOkF8y/90GShAj9KSbqI7YIk=
In-Reply-To: <MPG.3c9e8558397321b98fedc@news.individual.net>
Content-Language: en-US
 by: Paul - Sat, 19 Mar 2022 03:48 UTC

On 3/18/2022 4:03 PM, Stan Brown wrote:
> On Fri, 18 Mar 2022 18:44:49 +0000, mechanic wrote:
>> You can run external Linux commands but in windows (unless you have
>> cygwin or something like that) that 'fmt' command won't be
>> recognised.
>>
>
> What about WSL? If we install WSL, do we simply get the shell, or do
> we get commands like fmt?
>
> <https://docs.microsoft.com/en-us/windows/wsl/about>
> says "The Windows Subsystem for Linux lets developers run a GNU/Linux
> environment -- including most command-line tools, utilities, and
> applications -- directly on Windows. ... Run Bash shell scripts and
> GNU/Linux command-line applications including: vim, emacs, tmux. ..."
>
> That certainly sounds like you'd get fmt, assuming fmt is a standard
> Linux command-line utility. (My Linux knowledge isn't deep enough to
> know whether it is or it isn't.)

In the Bash shell on Windows (WSL), this is a user directory

/mnt/c/users/username/Downloads

and this is a location of a tool and its friend.

/usr/bin/fmt
/usr/bin/vim

The /usr/bin is inside this container.

C:\Users\username\AppData\Local\Packages\
CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState\

Name: ext4.vhdx
Size: 2,185,232,384 bytes (2084 MiB)

The size grows as you add Ubuntu packages to it with

sudo apt install vim

The .vhdx file can't be opened with 7ZIP, whereas 7ZIP opens .vhd files just
fine and .vhdx is more of a orphan (Hyper-V) format. I don't know if I have
a third-party tool to convert a .vhdx to something else.

But ext4.vhdx is in principle where /usr/bin/vim or /usr/bin/vim.basic is located.

Paul

Re: Does Windows vim have a fmt command?

<t1488e$bre$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60779&group=alt.comp.os.windows-10#60779

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ithink...@gmail.com (Chris)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 19 Mar 2022 09:37:18 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <t1488e$bre$1@dont-email.me>
References: <t0ijvd$rag$1@solani.org>
<15lo5hi4a77kb.dlg@example1357.net>
<t0irlr$10qo$1@solani.org>
<12b42ac6pklsk.dlg@example1357.net>
<t1285o$1ptdk$1@paganini.bofh.team>
<1u3elk1ngf7ed$.dlg@example1357.net>
<MPG.3c9e8558397321b98fedc@news.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 19 Mar 2022 09:37:18 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d38bf789ac904647431075118597e139";
logging-data="12142"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SkSiYtLicOCUyRw+DOXSeYy7DQp+RSzw="
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:JBFKUpw1sjzlqiId3Jwmqm1yOQU=
sha1:puR1V3A+9Zta4V+InD/kaQDAPwI=
 by: Chris - Sat, 19 Mar 2022 09:37 UTC

Stan Brown <the_stan_brown@fastmail.fm> wrote:
> On Fri, 18 Mar 2022 18:44:49 +0000, mechanic wrote:
>> You can run external Linux commands but in windows (unless you have
>> cygwin or something like that) that 'fmt' command won't be
>> recognised.
>>
>
> What about WSL? If we install WSL, do we simply get the shell, or do
> we get commands like fmt?

Once WSL is enabled you can install a complète linux distribution - Ubuntu
or SUSE - and so you can have whatever linux tools you want.

However, it's massive overkill for your needs. If you can't get vim to work
as you like just use Notepad++ instead.

Re: Does Windows vim have a fmt command?

<t14h7u$1r7f$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60781&group=alt.comp.os.windows-10#60781

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!REtAK2mXiPXg9gCemUmZDw.user.46.165.242.75.POSTED!not-for-mail
From: Jer...@JerryThinks.com (Jerry)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 19 Mar 2022 05:10:41 -0700
Organization: Aioe.org NNTP Server
Message-ID: <t14h7u$1r7f$1@gioia.aioe.org>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net> <t0irlr$10qo$1@solani.org> <12b42ac6pklsk.dlg@example1357.net> <t1285o$1ptdk$1@paganini.bofh.team> <1u3elk1ngf7ed$.dlg@example1357.net> <MPG.3c9e8558397321b98fedc@news.individual.net> <t1488e$bre$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="60655"; posting-host="REtAK2mXiPXg9gCemUmZDw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.5
X-Notice: Filtered by postfilter v. 0.9.2
 by: Jerry - Sat, 19 Mar 2022 12:10 UTC

On Sat, 19 Mar 2022 09:37:18 -0000 (UTC), Chris wrote:

> Once WSL is enabled you can install a compl�te linux distribution - Ubuntu
> or SUSE - and so you can have whatever linux tools you want.
>
> However, it's massive overkill for your needs. If you can't get vim to work
> as you like just use Notepad++ instead.

Notepad++ solves nothing unless you already have a fmt.exe executable.
Even then, the op needs to call the fmt.exe command from within Notepad++.

The Windows port of the GNU CoreUtils has a fmt.exe executable for example.
http://gnuwin32.sourceforge.net/packages/coreutils.htm

that fmt.exe port seems to have the options for what the op is asking for.
https://www.pconlife.com/viewfileinfo/fmt-exe/

But how does the op call that fmt.exe command from within Notepad++?

Re: Does Windows vim have a fmt command?

<t14hue$4h1$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60782&group=alt.comp.os.windows-10#60782

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!aioe.org!REtAK2mXiPXg9gCemUmZDw.user.46.165.242.75.POSTED!not-for-mail
From: Jer...@JerryThinks.com (Jerry)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 19 Mar 2022 05:22:41 -0700
Organization: Aioe.org NNTP Server
Message-ID: <t14hue$4h1$1@gioia.aioe.org>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net> <t0irlr$10qo$1@solani.org> <12b42ac6pklsk.dlg@example1357.net> <t1285o$1ptdk$1@paganini.bofh.team> <1u3elk1ngf7ed$.dlg@example1357.net> <MPG.3c9e8558397321b98fedc@news.individual.net> <t13jqb$l8h$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="4641"; posting-host="REtAK2mXiPXg9gCemUmZDw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.5
X-Notice: Filtered by postfilter v. 0.9.2
 by: Jerry - Sat, 19 Mar 2022 12:22 UTC

On Fri, 18 Mar 2022 23:48:20 -0400, Paul wrote:

> In the Bash shell on Windows (WSL), this is a user directory
>
> /mnt/c/users/username/Downloads
>
> and this is a location of a tool and its friend.
>
> /usr/bin/fmt
> /usr/bin/vim

All that is needed is any fmt.exe executable which is ported to Windows.

A search found fmt.exe in the Windows Tiny Unix Tools for Windows site.
https://tinyapps.org/blog/201606040700_tiny_unix_tools_windows.html

That's inside something called Git For Windows which I've never heard of.
https://gitforwindows.org/

What do you think of this Git for Windows unix environment?

It's also in Unix Tools For Windows but that's only in an archive.
https://web.archive.org/web/20040803020450/http://thinstall.com/help/index.html?unixtooldemo.htm

Ever use that?

Re: Does Windows vim have a fmt command?

<t1534c$hrg$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60785&group=alt.comp.os.windows-10#60785

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ithink...@gmail.com (Chris)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 19 Mar 2022 17:15:56 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <t1534c$hrg$1@dont-email.me>
References: <t0ijvd$rag$1@solani.org>
<15lo5hi4a77kb.dlg@example1357.net>
<t0irlr$10qo$1@solani.org>
<12b42ac6pklsk.dlg@example1357.net>
<t1285o$1ptdk$1@paganini.bofh.team>
<1u3elk1ngf7ed$.dlg@example1357.net>
<MPG.3c9e8558397321b98fedc@news.individual.net>
<t1488e$bre$1@dont-email.me>
<t14h7u$1r7f$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 19 Mar 2022 17:15:56 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d38bf789ac904647431075118597e139";
logging-data="18288"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ZMOS/c1ELVjV2ZCIzaF5SWmKwmDE7+6g="
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:gfge4/Kz/ZhhVvHtnZKkYgmx7yk=
sha1:D2SE9nWkdCwY9TtoRlUPEQlaXvA=
 by: Chris - Sat, 19 Mar 2022 17:15 UTC

Jerry <Jerry@JerryThinks.com> wrote:
> On Sat, 19 Mar 2022 09:37:18 -0000 (UTC), Chris wrote:
>
>> Once WSL is enabled you can install a complète linux distribution - Ubuntu
>> or SUSE - and so you can have whatever linux tools you want.
>>
>> However, it's massive overkill for your needs. If you can't get vim to work
>> as you like just use Notepad++ instead.
>
> Notepad++ solves nothing unless you already have a fmt.exe executable.
> Even then, the op needs to call the fmt.exe command from within Notepad++.
>
> The Windows port of the GNU CoreUtils has a fmt.exe executable for example.
> http://gnuwin32.sourceforge.net/packages/coreutils.htm
>
> that fmt.exe port seems to have the options for what the op is asking for.
> https://www.pconlife.com/viewfileinfo/fmt-exe/
>
> But how does the op call that fmt.exe command from within Notepad++?

I wouldn't be surprised if there's an equivalent functionality or plugin
available.

Re: Does Windows vim have a fmt command?

<t15371$icn$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60786&group=alt.comp.os.windows-10#60786

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ithink...@gmail.com (Chris)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 19 Mar 2022 17:17:21 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <t15371$icn$1@dont-email.me>
References: <t0ijvd$rag$1@solani.org>
<15lo5hi4a77kb.dlg@example1357.net>
<t0irlr$10qo$1@solani.org>
<12b42ac6pklsk.dlg@example1357.net>
<t1285o$1ptdk$1@paganini.bofh.team>
<1u3elk1ngf7ed$.dlg@example1357.net>
<MPG.3c9e8558397321b98fedc@news.individual.net>
<t1488e$bre$1@dont-email.me>
<t14h7u$1r7f$1@gioia.aioe.org>
<t1534c$hrg$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 19 Mar 2022 17:17:21 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="d38bf789ac904647431075118597e139";
logging-data="18839"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vxMLAy9wBOtO76N/Va/sp4s5oF95srJU="
User-Agent: NewsTap/5.5 (iPhone/iPod Touch)
Cancel-Lock: sha1:0btr87UQl7yBtqSQc9DS2ojBAPg=
sha1:2ncULc5wMZBNBDyrnob/WRF348E=
 by: Chris - Sat, 19 Mar 2022 17:17 UTC

Chris <ithinkiam@gmail.com> wrote:
> Jerry <Jerry@JerryThinks.com> wrote:
>> On Sat, 19 Mar 2022 09:37:18 -0000 (UTC), Chris wrote:
>>
>>> Once WSL is enabled you can install a complète linux distribution - Ubuntu
>>> or SUSE - and so you can have whatever linux tools you want.
>>>
>>> However, it's massive overkill for your needs. If you can't get vim to work
>>> as you like just use Notepad++ instead.
>>
>> Notepad++ solves nothing unless you already have a fmt.exe executable.
>> Even then, the op needs to call the fmt.exe command from within Notepad++.
>>
>> The Windows port of the GNU CoreUtils has a fmt.exe executable for example.
>> http://gnuwin32.sourceforge.net/packages/coreutils.htm
>>
>> that fmt.exe port seems to have the options for what the op is asking for.
>> https://www.pconlife.com/viewfileinfo/fmt-exe/
>>
>> But how does the op call that fmt.exe command from within Notepad++?
>
> I wouldn't be surprised if there's an equivalent functionality or plugin
> available.

Actually looks like sublime text can do justification really well.
https://packagecontrol.io/packages/Justify

Re: Does Windows vim have a fmt command?

<t157r2$pca$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=60790&group=alt.comp.os.windows-10#60790

  copy link   Newsgroups: alt.comp.os.windows-10
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: nos...@needed.invalid (Paul)
Newsgroups: alt.comp.os.windows-10
Subject: Re: Does Windows vim have a fmt command?
Date: Sat, 19 Mar 2022 14:36:11 -0400
Organization: A noiseless patient Spider
Lines: 85
Message-ID: <t157r2$pca$1@dont-email.me>
References: <t0ijvd$rag$1@solani.org> <15lo5hi4a77kb.dlg@example1357.net>
<t0irlr$10qo$1@solani.org> <12b42ac6pklsk.dlg@example1357.net>
<t1285o$1ptdk$1@paganini.bofh.team> <1u3elk1ngf7ed$.dlg@example1357.net>
<MPG.3c9e8558397321b98fedc@news.individual.net> <t13jqb$l8h$1@dont-email.me>
<t14hue$4h1$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 19 Mar 2022 18:36:19 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="8fbccf5a9a67e4f3e59cc26801a02084";
logging-data="25994"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tl6GXqrk+lT6Ecv5S0h+GTIUH1CyAXv8="
User-Agent: Ratcatcher/2.0.0.25 (Windows/20130802)
Cancel-Lock: sha1:4zsqTrxz1G4ATsb8wxswLwAial4=
In-Reply-To: <t14hue$4h1$1@gioia.aioe.org>
Content-Language: en-US
 by: Paul - Sat, 19 Mar 2022 18:36 UTC

On 3/19/2022 8:22 AM, Jerry wrote:
> On Fri, 18 Mar 2022 23:48:20 -0400, Paul wrote:
>
>> In the Bash shell on Windows (WSL), this is a user directory
>>
>>     /mnt/c/users/username/Downloads
>>
>> and this is a location of a tool and its friend.
>>
>>     /usr/bin/fmt
>>     /usr/bin/vim
>
> All that is needed is any fmt.exe executable which is ported to Windows.
>
> A search found fmt.exe in the Windows Tiny Unix Tools for Windows site.
> https://tinyapps.org/blog/201606040700_tiny_unix_tools_windows.html
>
> That's inside something called Git For Windows which I've never heard of.
> https://gitforwindows.org/
>
> What do you think of this Git for Windows unix environment?
>
> It's also in Unix Tools For Windows but that's only in an archive.
> https://web.archive.org/web/20040803020450/http://thinstall.com/help/index.html?unixtooldemo.htm
>
> Ever use that?

I just use gunwin32 (ten years old).
Some of the packages contain sets of executables.

http://gnuwin32.sourceforge.net/packages/coreutils.htm

Others can be more selective.

http://gnuwin32.sourceforge.net/packages.html

There's also Cygwin, which I'm told by others here is
still going. Once you pull something in from the Cygwin
tree, you can keep just the EXE and a couple of DLLs and
use the stuff in a portable manner. So in some ways,
a similar set of support issues to gnuwin32.

The namespaces can be slightly different. Cygwin might
use /dev/sda as an identifier for the first disk drive.
Gnuwin32 might use identifiers similar to how dd.exe
from Chrysocome uses them.

There can also be line ending differences. The Gawk in
WSL uses Linux line endings, and needs a two line Begin
clause added to source scripts. The GNUwin32 Gawk 3 uses
Windows line endings making it "more" native.

The differences can be very subtle (and annoying, if you
let such things annoy you).

The netpbm in the GNUWin32 collection, might be a more
complete set than the netpbm in WSL. I installed netpbm
the other day in WSL and discovered it's no longer
a complete orthogonal set (if there is atob there is btoa
as well kind of thing). Netpbm was kinda over the top
when that person was working on it. Cutting it down to
the subset in WSL isn't really doing anyone any favors.
Sure, it's more secure I suppose, but hardly "helpful".

There are lots of old codes and libraries which were
never "hardened" and had exploitable stuff removed
from them. You could download a JPeg with a corrupt
header and tip over the machine, with some of the
uncorrected libraries. There might be a danger of that
with the ten year old GNUWin32 for that matter.
It's quite possible Windows Defender could be scanning
your JPeg and checking for that, before you get to
play with it.

Not everything is a box of chocolates out there :-)
You might have to make tradeoffs between completeness
and security when evaluating sources of ports. Maybe
something you test for the first time, isn't blatantly
filled with malware, but it might have defects you don't
know about, that are already listed somewhere in a CVE.
I'm quite sure my small collection here is filled
with issues like that.

Paul

Pages:12
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor