awkembed.vim

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

awkembed.vim

J S-3
(On the subject of syntax highlighting languages embedded in other languages)

I frequently write (bash) shell scripts with embedded AWK scripts, and I've found the awkembed.vim script quite useful.  I have it installed at:

~/.vim/after/syntax/sh/awkembed.vim

And it works quite well.  Now, I would like to extend the idea beyond the set of "shell" and "awk".

There are, obviously, two variables here: The enclosing language and the embedded language.  As far as I can tell (based on a little Googoling) this has only been done for the one specific combination: shell & awk.  Note: :help sh-embed

Specifically, I have an Expect script with embedded AWK.  How hard is it going to be to get this to work?

I took a look at the awkembed.vim script - it's mostly greek to me, although I was able to modify it slightly because my awk has a different name than the one assumed by the script.

It'd be nice if someone could tell me either a quick way to make a script to do what I want - or to tell me it can't be done...

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/1632295224.1316600.1563020677437%40mail.yahoo.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: awkembed.vim

arocker

> I frequently write (bash) shell scripts with embedded AWK scripts,

It sounds as though Perl might be good fit for whatever you are doing.
(Perl evolved because shell, sed and awk combinations were becoming
cumbersome.)

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/19b6f2c832eeee701a0b5a9838ebb08f.squirrel%40webmail.vybenetworks.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: awkembed.vim

Christian Brabandt
In reply to this post by J S-3

On Sa, 13 Jul 2019, 'J S' via vim_use wrote:

> (On the subject of syntax highlighting languages embedded in other languages)
>
> I frequently write (bash) shell scripts with embedded AWK scripts, and I've found the awkembed.vim script quite useful.  I have it installed at:
>
> ~/.vim/after/syntax/sh/awkembed.vim
>
> And it works quite well.  Now, I would like to extend the idea beyond the set of "shell" and "awk".
>
> There are, obviously, two variables here: The enclosing language and the embedded language.  As far as I can tell (based on a little Googoling) this has only been done for the one specific combination: shell & awk.  Note: :help sh-embed
>
> Specifically, I have an Expect script with embedded AWK.  How hard is it going to be to get this to work?
>
> I took a look at the awkembed.vim script - it's mostly greek to me, although I was able to modify it slightly because my awk has a different name than the one assumed by the script.
>
> It'd be nice if someone could tell me either a quick way to make a script to do what I want - or to tell me it can't be done...

Have a look at :h sh-embed for the general principle.

Best,
Christian
--
Ist Windows 98 ein Spiel oder ein Betriebssystem?

Nein, ich finde ein Spiel sollte schon eine Lösung haben.
Ich stecke im 97. Level.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20190714132100.GC31610%40256bit.org.
For more options, visit https://groups.google.com/d/optout.