Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

"If anything can go wrong, it will." -- Edsel Murphy


devel / comp.unix.shell / Re: Vim syntax file for ksh93 ?

SubjectAuthor
* Vim syntax file for ksh93 ?Janis Papanagnou
+* Vim syntax file for ksh93 ?jeorge
|`* Vim syntax file for ksh93 ?Janis Papanagnou
| +* Vim syntax file for ksh93 ?Kenny McCormack
| |`- Vim syntax file for ksh93 ?Janis Papanagnou
| `* Vim syntax file for ksh93 ?Benjamin Esham
|  `* Vim syntax file for ksh93 ?Janis Papanagnou
|   `* Vim syntax file for ksh93 ?castAway
|    `* Vim syntax file for ksh93 ?Janis Papanagnou
|     `* Vim syntax file for ksh93 ?Janis Papanagnou
|      `- Vim syntax file for ksh93 ?castAway
`- Vim syntax file for ksh93 ?Kaz Kylheku

1
Vim syntax file for ksh93 ?

<uarri3$31oah$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6548&group=comp.unix.shell#6548

  copy link   Newsgroups: comp.unix.shell comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell,comp.editors
Subject: Vim syntax file for ksh93 ?
Date: Tue, 8 Aug 2023 00:34:42 +0200
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uarri3$31oah$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 7 Aug 2023 22:34:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="521ef36333c047c9aeee7ae1946d5b07";
logging-data="3203409"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dqi/GJDbEmSdY6W/lPJmm"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:U77zBO9ZSMw1V8CBk4GcMBC8Ojo=
X-Enigmail-Draft-Status: N1110
X-Mozilla-News-Host: news://news.eternal-september.org:119
 by: Janis Papanagnou - Mon, 7 Aug 2023 22:34 UTC

Is there some Vim syntax file existing that handles a contemporary
Kornshell syntax (ksh93u+) correctly, i.e. without displaying valid
ksh93 constructs as errors (as the existing sh.vim does[*])?

Janis

[*] A specific ksh.vim is obviously not existing in my Linux distro;
online resources seem to indicate that an sh.vim should cover that.

Re: Vim syntax file for ksh93 ?

<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6549&group=comp.unix.shell#6549

  copy link   Newsgroups: comp.unix.shell comp.editors
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!newsfeed.hasname.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
From: someone@invalid.invalid (jeorge)
Newsgroups: comp.unix.shell,comp.editors
Subject: Re: Vim syntax file for ksh93 ?
Date: Mon, 7 Aug 2023 17:08:25 -0600
Organization: Ministry of Madness
Message-ID: <uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
References: <uarri3$31oah$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 7 Aug 2023 23:08:25 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com; posting-account="YKRG+wcUE3ZH5QknWLsQFQjWpafUZ9Hi6Jg7DGavMDA";
logging-data="93876"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:NlCspv6xm5Ux+Sn8e86l2y9x+jo= sha256:ifCopuXt65ZmiMVOtw3Zg8E63GHdydDimN/rH8ic4CQ=
sha1:rRerhl3VADOuSAxvNohRSkn/QLM= sha256:alQSMgobIZ5MJzeyPko46RT4y+zjO9vwRY/0vK2M19Q=
In-Reply-To: <uarri3$31oah$1@dont-email.me>
Content-Language: en-US
 by: jeorge - Mon, 7 Aug 2023 23:08 UTC

On 8/7/23 4:34 PM, Janis Papanagnou wrote:
> Is there some Vim syntax file existing that handles a contemporary
> Kornshell syntax (ksh93u+) correctly, i.e. without displaying valid
> ksh93 constructs as errors (as the existing sh.vim does[*])?
>
> Janis
>
> [*] A specific ksh.vim is obviously not existing in my Linux distro;
> online resources seem to indicate that an sh.vim should cover that.

Does adding the following to your .vimrc file help?

let g:is_kornshell = 1

The ref link below has some other suggestions but you've likely tried
them already.

ref: https://vimhelp.org/syntax.txt.html#sh.vim

Re: Vim syntax file for ksh93 ?

<uas5co$331bp$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6550&group=comp.unix.shell#6550

  copy link   Newsgroups: comp.unix.shell comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell,comp.editors
Subject: Re: Vim syntax file for ksh93 ?
Date: Tue, 8 Aug 2023 03:22:31 +0200
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <uas5co$331bp$1@dont-email.me>
References: <uarri3$31oah$1@dont-email.me>
<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 01:22:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="521ef36333c047c9aeee7ae1946d5b07";
logging-data="3245433"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18iDjREUM5+0KSLW8Bem5iG"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:syRFWZXGjFXDLv0xqppMwz5SDdI=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
 by: Janis Papanagnou - Tue, 8 Aug 2023 01:22 UTC

On 08.08.2023 01:08, jeorge wrote:
> On 8/7/23 4:34 PM, Janis Papanagnou wrote:
>> Is there some Vim syntax file existing that handles a contemporary
>> Kornshell syntax (ksh93u+) correctly, i.e. without displaying valid
>> ksh93 constructs as errors (as the existing sh.vim does[*])?
>>
>> Janis
>>
>> [*] A specific ksh.vim is obviously not existing in my Linux distro;
>> online resources seem to indicate that an sh.vim should cover that.
>
> Does adding the following to your .vimrc file help?
>
> let g:is_kornshell = 1

No, as far as I can see it doesn't change anything.

To name just two wrongly marked syntax errors (as examples):

In ${.sh.value} marked as error: .sh.value
In ${PWD/${HOME}\//\~/}
marked as error: / and \//\~/

Janis

Re: Vim syntax file for ksh93 ?

<uas602$399tj$1@news.xmission.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6551&group=comp.unix.shell#6551

  copy link   Newsgroups: comp.unix.shell comp.editors
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.us.feeder.erje.net!feeder.erje.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.shell,comp.editors
Subject: Re: Vim syntax file for ksh93 ?
Date: Tue, 8 Aug 2023 01:32:50 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <uas602$399tj$1@news.xmission.com>
References: <uarri3$31oah$1@dont-email.me> <uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com> <uas5co$331bp$1@dont-email.me>
Injection-Date: Tue, 8 Aug 2023 01:32:50 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="3450803"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Tue, 8 Aug 2023 01:32 UTC

In article <uas5co$331bp$1@dont-email.me>,
Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
....
>> let g:is_kornshell = 1
>
>No, as far as I can see it doesn't change anything.

Just to be clear, I want you to run the following tests:

$ vim mykornscript

Then do:

:echo b:is_kornshell

In fact, the way I usually do it is type in everything up to the _, then hit
tab to cycle through all the ones that are set. Note that the actual value
of the variable is irrelevant; it will always be either 1 or unset.

If you see that is_kornshell is already set, then you can ignore the rest
of this.

If it isn't, then do:

:let b:is_kornshell=1
:e

The :e is critical!

See if that fixes things (or not).

--
Treating the stock market indexes as general measures of the well-being of a
society is like treating your blood pressure as an indicator of health. The
higher, the better, right? In fact, a high stock market is good for the investor
class, but it means the rest of us are getting screwed better than ever.

Re: Vim syntax file for ksh93 ?

<uas7p5$3730l$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6553&group=comp.unix.shell#6553

  copy link   Newsgroups: comp.unix.shell comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell,comp.editors
Subject: Re: Vim syntax file for ksh93 ?
Date: Tue, 8 Aug 2023 04:03:17 +0200
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <uas7p5$3730l$1@dont-email.me>
References: <uarri3$31oah$1@dont-email.me>
<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
<uas5co$331bp$1@dont-email.me> <uas602$399tj$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 02:03:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="521ef36333c047c9aeee7ae1946d5b07";
logging-data="3378197"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+HavbuVKw9NKZNtIY7Kyt6"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:FSABEa+Gfp6VQe/ipeFeWehoDP8=
In-Reply-To: <uas602$399tj$1@news.xmission.com>
 by: Janis Papanagnou - Tue, 8 Aug 2023 02:03 UTC

On 08.08.2023 03:32, Kenny McCormack wrote:
> In article <uas5co$331bp$1@dont-email.me>,
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
> ...
>>> let g:is_kornshell = 1
>>
>> No, as far as I can see it doesn't change anything.
>
> Just to be clear, I want you to run the following tests:
>
> $ vim mykornscript
>
> Then do:
>
> :echo b:is_kornshell
>
> In fact, the way I usually do it is type in everything up to the _, then hit
> tab to cycle through all the ones that are set. Note that the actual value
> of the variable is irrelevant; it will always be either 1 or unset.
>
> If you see that is_kornshell is already set, then you can ignore the rest
> of this.
>
> If it isn't, then do:
>
> :let b:is_kornshell=1
> :e
>
> The :e is critical!
>
> See if that fixes things (or not).
>

Previously I had already tried

:let b:is_kornshell=1
:e!

now I also tried with :e and omitted the '!' (as you wrote).
The effect is the same, though.

Janis

Re: Vim syntax file for ksh93 ?

<20230807191518.264@kylheku.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6554&group=comp.unix.shell#6554

  copy link   Newsgroups: comp.unix.shell comp.editors
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-4973@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.shell,comp.editors
Subject: Re: Vim syntax file for ksh93 ?
Date: Tue, 8 Aug 2023 02:16:15 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <20230807191518.264@kylheku.com>
References: <uarri3$31oah$1@dont-email.me>
Injection-Date: Tue, 8 Aug 2023 02:16:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="2e64aa5a28c0801679f7444cde71de51";
logging-data="3380865"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/V28J8b7QDCd+wlonlQx6/TkmIx+M5ZSI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:Si+T35GuQk423FQ7dPdV7g4+aBg=
 by: Kaz Kylheku - Tue, 8 Aug 2023 02:16 UTC

On 2023-08-07, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
> Is there some Vim syntax file existing that handles a contemporary
> Kornshell syntax (ksh93u+) correctly, i.e. without displaying valid
> ksh93 constructs as errors (as the existing sh.vim does[*])?

Sir, I'm on a call with a customer who wants working POSIX shell
and Bash syntax highlighting for Vim. Can you hold please?

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca

Re: Vim syntax file for ksh93 ?

<rzk79m.8tugqn@bdesham.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6565&group=comp.unix.shell#6565

  copy link   Newsgroups: comp.unix.shell comp.editors
Followup: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: usenet@esham.io (Benjamin Esham)
Newsgroups: comp.unix.shell,comp.editors
Subject: Re: Vim syntax file for ksh93 ?
Followup-To: comp.unix.shell
Date: Thu, 17 Aug 2023 20:01:04 -0400
Organization: United Federation of Planets
Lines: 34
Message-ID: <rzk79m.8tugqn@bdesham.net>
References: <uarri3$31oah$1@dont-email.me>
<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
<uas5co$331bp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="dde67cb52f96580227d7fca6d57bea69";
logging-data="4161427"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SFVXyE6kBUAEXb7z2lDO+YGLjrUr4oOg955dfP/cgEQ=="
User-Agent: Gnus/5.13 (macOS)
Cancel-Lock: sha1:2jB7I3fJbvY2IWre9qohA119cA4=
sha1:PoRO5hIg7bIw/Dc6Th1u8wuSG3E=
 by: Benjamin Esham - Fri, 18 Aug 2023 00:01 UTC

Janis Papanagnou wrote:

>> On 8/7/23 4:34 PM, Janis Papanagnou wrote:
>>
>>> Is there some Vim syntax file existing that handles a contemporary
>>> Kornshell syntax (ksh93u+) correctly, i.e. without displaying valid
>>> ksh93 constructs as errors (as the existing sh.vim does[*])?
>>>
>>> [snip]
>
> To name just two wrongly marked syntax errors (as examples):
>
> In ${.sh.value} marked as error: .sh.value
> In ${PWD/${HOME}\//\~/}
> marked as error: / and \//\~/

Have you tried the zsh syntax highlighting (:set filetype=zsh)? I tried
these two constructs and neither was marked as an error.

Zsh supports a fairly large subset of ksh syntax and semantics,[1][2] so I'd
imagine that a lot of your scripts would be highlighted in a reasonable way
by the zsh syntax file. (If anything, you might run into problems where ksh
syntax errors *aren't* flagged because they're valid in zsh.)

Hope this helps,

Benjamin

[1] At least that's my impression as a zsh user but ksh non-user.

[2] I don't know whether the ksh emulation ever covered 100% of ksh syntax
and semantics, and even if it did in the past, ksh may have evolved
since then. I am far from an expert here :-)

Re: Vim syntax file for ksh93 ?

<ubmpl6$496u$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=6566&group=comp.unix.shell#6566

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Vim syntax file for ksh93 ?
Date: Fri, 18 Aug 2023 05:47:49 +0200
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <ubmpl6$496u$1@dont-email.me>
References: <uarri3$31oah$1@dont-email.me>
<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
<uas5co$331bp$1@dont-email.me> <rzk79m.8tugqn@bdesham.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 18 Aug 2023 03:47:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="034ef73ca4b367c97e0627ccee91f722";
logging-data="140510"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+6f8vuUDzbdlMlAxJOvrY0"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:fX6XjQKcpItlk6AS9NMdCYVJbk4=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <rzk79m.8tugqn@bdesham.net>
 by: Janis Papanagnou - Fri, 18 Aug 2023 03:47 UTC

On 18.08.2023 02:01, Benjamin Esham wrote:
> Janis Papanagnou wrote:
>
>>> On 8/7/23 4:34 PM, Janis Papanagnou wrote:
>>>
>>>> Is there some Vim syntax file existing that handles a contemporary
>>>> Kornshell syntax (ksh93u+) correctly, i.e. without displaying valid
>>>> ksh93 constructs as errors (as the existing sh.vim does[*])?
>>>>
>
> Have you tried the zsh syntax highlighting (:set filetype=zsh)? I tried
> these two constructs and neither was marked as an error.

I thought that I had tried that with zsh syntax in the past...

>
> Zsh supports a fairly large subset of ksh syntax and semantics,[1][2] so I'd
> imagine that a lot of your scripts would be highlighted in a reasonable way
> by the zsh syntax file. (If anything, you might run into problems where ksh
> syntax errors *aren't* flagged because they're valid in zsh.)

....but upon retrying now the result is indeed very good.

The only thing is that my (k)sh syntax file supports embedded awk
scripts so that both, ksh and awk, are highlighted accordingly.
The zsh syntax does not support that feature, the whole awk program
is marked monochrome as an undifferentiated string. It may be that
this embedded syntax feature had been added later (it was probably
contributed by someone in the shell and/or awk newsgroup). (I'll
have a look into that, but I'm no expert in vim's syntax language,
so I have to see what I can make of it.)

>
> Hope this helps,

Yes, thanks.

Janis

>
> Benjamin
>
>
> [1] At least that's my impression as a zsh user but ksh non-user.
>
> [2] I don't know whether the ksh emulation ever covered 100% of ksh syntax
> and semantics, and even if it did in the past, ksh may have evolved
> since then. I am far from an expert here :-)
>

Re: Vim syntax file for ksh93 ?

<ueeppo$2ueb6$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7421&group=comp.unix.shell#7421

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!rocksolid2!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no@where.com (castAway)
Newsgroups: comp.unix.shell
Subject: Re: Vim syntax file for ksh93 ?
Date: Wed, 20 Sep 2023 09:50:00 -0300
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <ueeppo$2ueb6$1@dont-email.me>
References: <uarri3$31oah$1@dont-email.me>
<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
<uas5co$331bp$1@dont-email.me> <rzk79m.8tugqn@bdesham.net>
<ubmpl6$496u$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 20 Sep 2023 12:50:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="081c84680e75305376a51f8731866c53";
logging-data="3094886"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GG5QjEE7K1hvfl9S+WFYstkDIkwrseGo="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:HH0S1phm/TSf7/LNM5UdGD820bI=
In-Reply-To: <ubmpl6$496u$1@dont-email.me>
Content-Language: pt-BR, en-GB
 by: castAway - Wed, 20 Sep 2023 12:50 UTC

On 18/08/2023 00:47, Janis Papanagnou wrote:
> On 18.08.2023 02:01, Benjamin Esham wrote:
>> Janis Papanagnou wrote:
> The only thing is that my (k)sh syntax file supports embedded awk
> scripts so that both, ksh and awk, are highlighted accordingly.
> The zsh syntax does not support that feature, the whole awk program
> is marked monochrome as an undifferentiated string. It may be that
> this embedded syntax feature had been added later (it was probably
> contributed by someone in the shell and/or awk newsgroup). (I'll
> have a look into that, but I'm no expert in vim's syntax language,
> so I have to see what I can make of it.)
>

Check `:h sh-awk`:

*sh-embed* *sh-awk*
Sh: EMBEDDING LANGUAGES~

You may wish to embed languages into sh. I'll give an example courtesy of
Lorance Stinson on how to do this with awk as an example. Put the following
file into $HOME/.vim/after/syntax/sh/awkembed.vim: >

[code]


This code will then let the awk code in the single quotes: >
awk '...awk code here...'
be highlighted using the awk highlighting syntax. Clearly this may be
extended to other languages.

The awkembed.vim ball may be changed to be read after ksh syntax, I reckon.

Re: Vim syntax file for ksh93 ?

<uefen8$32m75$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7422&group=comp.unix.shell#7422

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Vim syntax file for ksh93 ?
Date: Wed, 20 Sep 2023 20:47:02 +0200
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <uefen8$32m75$1@dont-email.me>
References: <uarri3$31oah$1@dont-email.me>
<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
<uas5co$331bp$1@dont-email.me> <rzk79m.8tugqn@bdesham.net>
<ubmpl6$496u$1@dont-email.me> <ueeppo$2ueb6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 20 Sep 2023 18:47:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6abf4c1a47e04293fdd9cae3fc01076";
logging-data="3234021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++PppG4mZ3+rYc1lOIO/Sr"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:woUI3Xg81l/pyhysC2IiWeydN80=
In-Reply-To: <ueeppo$2ueb6$1@dont-email.me>
 by: Janis Papanagnou - Wed, 20 Sep 2023 18:47 UTC

On 20.09.2023 14:50, castAway wrote:
>> [ awk syntax within ksh syntax highlighting ]
>
> Check `:h sh-awk`:
> [...]
> file into $HOME/.vim/after/syntax/sh/awkembed.vim: >
>
> [code]
>
> This code will then let the awk code in the single quotes: >
> awk '...awk code here...'
> be highlighted using the awk highlighting syntax. Clearly this may be
> extended to other languages.
> [...]

Thanks! :-)

Janis

Re: Vim syntax file for ksh93 ?

<uefglh$331ud$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7423&group=comp.unix.shell#7423

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: janis_papanagnou+ng@hotmail.com (Janis Papanagnou)
Newsgroups: comp.unix.shell
Subject: Re: Vim syntax file for ksh93 ?
Date: Wed, 20 Sep 2023 21:20:16 +0200
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <uefglh$331ud$1@dont-email.me>
References: <uarri3$31oah$1@dont-email.me>
<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
<uas5co$331bp$1@dont-email.me> <rzk79m.8tugqn@bdesham.net>
<ubmpl6$496u$1@dont-email.me> <ueeppo$2ueb6$1@dont-email.me>
<uefen8$32m75$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 20 Sep 2023 19:20:17 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b6abf4c1a47e04293fdd9cae3fc01076";
logging-data="3246029"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19+fgAYXvahxsHh5jHpLRkb"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
Thunderbird/45.8.0
Cancel-Lock: sha1:qWH+onPvuON+86/jWkyB0B5y/Dk=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <uefen8$32m75$1@dont-email.me>
 by: Janis Papanagnou - Wed, 20 Sep 2023 19:20 UTC

On 20.09.2023 20:47, Janis Papanagnou wrote:
> On 20.09.2023 14:50, castAway wrote:
>>> [ awk syntax within ksh syntax highlighting ]
>>
>> Check `:h sh-awk`:
>> [...]
>> file into $HOME/.vim/after/syntax/sh/awkembed.vim: >
>>
>> [code]
>>
>> This code will then let the awk code in the single quotes: >
>> awk '...awk code here...'
>> be highlighted using the awk highlighting syntax. Clearly this may be
>> extended to other languages.
>> [...]
>
> Thanks! :-)

Upthread I noted I have problems with new ksh syntax constructs, e.g.
in (( count++ )) the final closing parenthesis is market as error.
This was the primary concern of my (original) post.

The suggestion was - granted, it's a kludge - to set syntax to 'zsh'
(instead of 'sh'). This changed the coloring slightly but it worked
as as far as such constructs were not any more marked as errors. Fine.

The awkembed.vim suggestion now doesn't work correctly with the other
syntax issue; now either awk programs have a correct coloring but I
see those spurious syntax errors (with syntax=sh and awkembed.vim) or
I see no spurious errors but the whole awk program is uncolored (with
syntax=zsh).

It would be nice to have a solution that works correctly for both
requirements.

I tried to install a $HOME/.vim/after/syntax/zsh/awkembed.vi for zsh
but obviously this is not how this is supposed to work.

Any idea or how to fix both issues reliably (not just one or the other)?

Janis

Re: Vim syntax file for ksh93 ?

<ueftmd$35cet$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=7424&group=comp.unix.shell#7424

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: no@where.com (castAway)
Newsgroups: comp.unix.shell
Subject: Re: Vim syntax file for ksh93 ?
Date: Wed, 20 Sep 2023 20:02:37 -0300
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <ueftmd$35cet$1@dont-email.me>
References: <uarri3$31oah$1@dont-email.me>
<uarth9$2rlk$1@nnrp.usenet.blueworldhosting.com>
<uas5co$331bp$1@dont-email.me> <rzk79m.8tugqn@bdesham.net>
<ubmpl6$496u$1@dont-email.me> <ueeppo$2ueb6$1@dont-email.me>
<uefen8$32m75$1@dont-email.me> <uefglh$331ud$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 20 Sep 2023 23:02:37 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="083452dd2f8f6159ad1b80a5d0d6a7ed";
logging-data="3322333"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GN4XiDoiSv8UnKUdT4ioiWU+7jAKsp38="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4GNryHO8o6hhmV/m4GR+RyiKjz8=
Content-Language: pt-BR, en-GB
In-Reply-To: <uefglh$331ud$1@dont-email.me>
 by: castAway - Wed, 20 Sep 2023 23:02 UTC

On 20/09/2023 16:20, Janis Papanagnou wrote:
> On 20.09.2023 20:47, Janis Papanagnou wrote:
>> On 20.09.2023 14:50, castAway wrote:
>>>> [ awk syntax within ksh syntax highlighting ]

>
> I tried to install a $HOME/.vim/after/syntax/zsh/awkembed.vi for zsh
> but obviously this is not how this is supposed to work.
>
> Any idea or how to fix both issues reliably (not just one or the other)?
>
> Janis
>

I beg your pardon but awk syntax does work for me with zsh (I just set it up today).

Note that the file path you wrote is:

$HOME/.vim/after/syntax/zsh/awkembed.vi

Shouldn't that end with .vim?

Also note that I use DrChip's Vim Colorscheme astronaut.vba.gz.

Maybe try changing your colourscheme?

Best regards,
JSN

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor