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.)
Janis
[*] Yet I achieve the desired behavior by having a separate but
specific vim syntax-code in $HOME/.vim/after/syntax/sh/awkembed.vim
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.
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).
[*] 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.
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).
[*] Yet I achieve the desired behavior by having a separate but
specific vim syntax-code in $HOME/.vim/after/syntax/sh/awkembed.vim
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 thought I just ask for a second opinion. - Thanks!
BTW, I may be mis-understanding the overall goal here.
I mean, I understand how you would want the AWK part of a shell script highlighted as if it were AWK, but would you really want the entire shell script highlighted that way? I doubt that would look very good.
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.
There *is* a tool out there, that I learned about once on the VIM mailing list, that is sort of a "generic AWKembed" - i.e., it is supposed to handle any combination of languages. But I looked at it and tried to figure it
out - how to actually use it - and couldn't quite get it. It just looked
too complicated and I gave up.
On 2026-10-07 20:42, Kenny McCormack wrote:*SKIP* [ 27 lines 3 levels deep]
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 specificI think not. I assume that the syntax highlighting variables are
syntax setting in split-views - would be worthwhile to have.[*]
(This is just a poll on opinions, yet an academic question.)
local to the buffer. This is basically a feature - it's how buffers
work.
I thought I just ask for a second opinion. - Thanks!
(disclaimer) I've not developed intuition about files-buffers-windows
yet (and my fight with :hi hasn't even started), but looks like
:h :ownsyntax
is what you're after. Would it work is beyond my understanding.
On 2026-10-08 12:52, Eric Pozharski wrote:
:h :ownsyntaxI just read your interesting hint; as described that's exactly what I
is what you're after. Would it work is beyond my understanding.
had been after. And quick test shows that it works! :-)
with <11a8m47$2fkbe$6@dont-email.me> Janis Papanagnou wrote:
On 2026-10-08 12:52, Eric Pozharski wrote:
*SKIP* [ 2 lines 2 levels deep]
:h :ownsyntaxI just read your interesting hint; as described that's exactly what I
is what you're after. Would it work is beyond my understanding.
had been after. And quick test shows that it works! :-)
And 15min after posting I've realized that I've set up The
Disappointment Roller-Coaster. I'm sorry :(
p.s. Yes, I've checked my grudge (vim script with embedded perl). At
least I won't have to fight here-docs anymore (and loose).
On 2026-10-09 14:08, Eric Pozharski wrote:
with <11a8m47$2fkbe$6@dont-email.me> Janis Papanagnou wrote:
On 2026-10-08 12:52, Eric Pozharski wrote:
And 15min after posting I've realized that I've set up TheI don't understand what you wrote here. (This "Roller-Coaster".) And
Disappointment Roller-Coaster. I'm sorry :(
there's nothing to be sorry about. (At least with the hint you gave.)
- If you care to explain to a non-native speaker what I am missing
here... - thanks.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 55:28:35 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,684 |