Live data from Hacker News

Use Vim Inside a Unix Pipe Like Sed or AWK

blog.robertelder.org

1–10 of 49 posts

Re: Use Vim Inside a Unix Pipe Like Sed or AWK

#2
Hi, I'm the author. While I've got your attention, I would be interested in hearing feedback about how I can improve the reading experience (text colour/fonts/sizes/wording etc.) of my blog posts.

I used to have blinking text for the email signups at the bottom, but I got rid of it since it didn't have a huge effect (I think it only doubled the conversion rate). I have learned that some people really hate blinking text.

Re: Use Vim Inside a Unix Pipe Like Sed or AWK

#5

Hi, I'm the author. While I've got your attention, I would be interested in hearing feedback about how I can improve the reading experience (text colour/fonts/sizes/wording etc.) of my blog posts. I used to have blinking text for the email signups at the bottom, but I got rid of it since it didn't have a huge effect (I think it only doubled the conversion rate). I have learned that some people really hate blinking te…

Hey Robert! I've had your virtual memory article open in a tab since it made the HN homepage recently - but I had to close it because every day it would cause a massive memory leak in Safari for some really odd reason. I'd repeatedly kill the process hosting the webpage (it'll respawn 3 times then surrender) but every time I visited that tab by accident it would happen again.

Just an FYI :)

Re: Use Vim Inside a Unix Pipe Like Sed or AWK

#6

Hi, I'm the author. While I've got your attention, I would be interested in hearing feedback about how I can improve the reading experience (text colour/fonts/sizes/wording etc.) of my blog posts. I used to have blinking text for the email signups at the bottom, but I got rid of it since it didn't have a huge effect (I think it only doubled the conversion rate). I have learned that some people really hate blinking te…

Hey Robert! I've had your virtual memory article open in a tab since it made the HN homepage recently - but I had to close it because every day it would cause a massive memory leak in Safari for some really odd reason. I'd repeatedly kill the process hosting the webpage (it'll respawn 3 times then surrender) but every time I visited that tab by accident it would happen again. Just an FYI :)

Yes that's not surprising, the code for that implementation is quite scary and in order to make the page not lag terribly I realized at the end that I would effectively have to re-invent some of what react.js does (because it would have taken too long to completely re-write). I've considered re-writing an open source version with react that people could fork and incorporate into course material, but all that stuff takes time.

I can think of a few places where there would probably be circular object references, so that's probably where the memory leaks come from.

Thanks for the feedback :)

Re: Use Vim Inside a Unix Pipe Like Sed or AWK

#9
post #7
post #4

I have to say the only time I ever pipe directly to vim in a real world scenario is when I want to see a diff in color: diff file1 file2 | vim - Gives you the diff but colorized with Vim. Handy little trick.

Why not run vimdiff directly?

Or vimcat: https://github.com/ofavre/vimcat Or pygments: pygmentize -l diff

Re: Use Vim Inside a Unix Pipe Like Sed or AWK

#10
This post hints toward vim's history: the ed family of editors.

http://blog.sanctum.geek.nz/actually-using-ed/ http://blog.sanctum.geek.nz/using-more-of-ex/

A big use case for them was using them as scriptable editors in pipelines, and a lot of vim's commands are inherited from them. The diff(1) utility actually has an option to emit ed script, allowing files to be patched in ed pipelines: http://www.gnu.org/software/diffutils/manual/html_node/ed-Sc...

Post reply on HN