zsh-users
 help / color / mirror / code / Atom feed
* coloring a substitution
@ 2022-11-08 20:56 Ray Andrews
  2022-11-08 21:10 ` Roman Perepelitsa
  0 siblings, 1 reply; 9+ messages in thread
From: Ray Andrews @ 2022-11-08 20:56 UTC (permalink / raw)
  To: Zsh Users

I'm seeing if I can make my function 100% zsh native.  The 'sed' works.  
'$color' is just incrementing integers in a for loop starting at 31 (red):

  recent[$aa]=$( print $recent[$aa] | sed -r 
"s/$filter/\x1b\[$color;1m$filter\x1b\[0m/Ig" )

... so I'm trying to get zsh string replacement to do the same job:

recent[$aa]=${recent[$aa]/\x1b\[$color;1m$filter\x1b\[0m/}

... but it's not working, can it be repaired?  I'll bet it can, it's 
just a question of getting the backslashes right or some other tweak in 
the grammar.



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-11-12  3:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 20:56 coloring a substitution Ray Andrews
2022-11-08 21:10 ` Roman Perepelitsa
2022-11-08 23:49   ` Ray Andrews
2022-11-09  0:11     ` Bart Schaefer
2022-11-09  0:32       ` Ray Andrews
2022-11-09  8:19     ` Roman Perepelitsa
2022-11-11 22:24       ` Ray Andrews
2022-11-11 22:39         ` Roman Perepelitsa
2022-11-12  3:36           ` Ray Andrews

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).