🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.editors
Article #3

Re: Vim - set differing syntaxes in split view of the same source file?

#3
From: Janis Papanagnou
Date: Thu, 08 Oct 2026 06:13
52 lines
3598 bytes
On 2026-10-07 20:42, Kenny McCormack wrote:
> In article <11a5t6k$2fkbe$3@dont-email.me>,
> Janis Papanagnou  <janis_papanagnou+ng@hotmail.com> wrote:
> ...
>> I wonder whether such a feature - to override the file specific
>> syntax setting in split-views - would be worthwhile to have.[*]
>> (This is just a poll on opinions, yet an academic question.)
> 
> I think not.  I assume that the syntax highlighting variables are local to
> the buffer.  This is basically a feature - it's how buffers work.

Yeah.

> 
> I have sometimes been in the situation of wanting to open the same file
> twice but force VIM to treat them as separate buffers.  I have not tried
> very hard, but it would be worth testing making a link (either hard or
> soft) and opening that in a separate window (and hoping it gets a new
> buffer assigned to it).

Oh, it's less about finding a workaround; or at least to have one
that is easy to achieve on the fly. - The cute thing with ':split'
would be the tight coupling, no external kludge. - It would have
to be some sort of inherited behavior; as you say, the buffers may
have the attributes local, and the split-window could inherit that
as default but could overwrite it on a second level. - So far my
thoughts.

>> [*] Yet I achieve the desired behavior by having a separate but
>> specific vim syntax-code in $HOME/.vim/after/syntax/sh/awkembed.vim
> 
> I assume that I am not telling you anything you don't already know, but,
> yes, the standard solution to this is to use awkembed so that the embedded
> AWK is highlighted as AWK.
> 
> The problem with that is that it doesn't scale.  You have to deal with it
> for each combination that you encounter.

Yes, exactly. - You'd also need to know vim's syntax-scripting. But
using the already existing syntax files - and just "combine" them,
or rather activate them - would need no individual vim-programming,
it would be just there.

I had learned to live with the current behavior, but Vim has so cool
and orthogonal features - even after decades it did still surprise
me a at times! - and if it had such a feature it would alleviate the
"suffering" a bit. (But no big deal.)

I thought I just ask for a second opinion. - Thanks!

Janis
Technical Details
Message-ID: <11a7c9o$2fkbe$4@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11a5t6k$2fkbe$3@dont-email.me> <11a63qf$35cge$1@news.xmission.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.editors
Subject: Re: Vim - set differing syntaxes in split view of the same source
 file?
Date: Thu, 8 Oct 2026 08:13:12 +0200
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <11a7c9o$2fkbe$4@dont-email.me>
References: <11a5t6k$2fkbe$3@dont-email.me>
 <11a63qf$35cge$1@news.xmission.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 08 Oct 2026 06:13:13 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2609518"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19K/+miHCxP8CTsHvLEw6J3"; posting-host="23ea007eea66c34423c9a3219a9f8d24"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rVIaw5tVBkPl1QFIvUrYGVkEvVQ= sha256:7aEsVLrepCm/kvGKIEa31f0nJ+NrppkGljExFWMvgrc=
	sha1:uWDFbyTNctmJuGlNcdhUoF4PhBw= sha256:1iOvSXWxvL9yP7Z19t7OjnA44bIyLeS7sgSGH4Agj/k=
In-Reply-To: <11a63qf$35cge$1@news.xmission.com>
Content-Language: en-US