this post was submitted on 20 Oct 2023
3 points (100.0% liked)
Emacs
314 readers
2 users here now
A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!
Get Emacs
Rules
- Posts should be emacs related
- Be kind please
- Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.
Emacs Resources
Emacs Tutorials
- Beginner’s Guide to Emacs
- Absolute Beginner's Guide to Emacs
- How to Learn Emacs: A Hand-drawn One-pager for Beginners
Useful Emacs configuration files and distributions
Quick pain-saver tip
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Here is the solution for my
.zsh_history
example:I first created a small function for the unix time string. More of the functionality in the replacement string can be included if preferred.
The search string:
\(: \)\([0-9]\{10\}\)\(:0;\)
The replacement string:
\,(concat (format "%6d " (line-number-at-pos)) (rgx-get-time-string (match-string 2)) " "))
(match-string 2)
is an alternative for the back reference for the second string matched\2