Use Vim Inside a Unix Pipe Like Sed or AWK
blog.robertelder.org
Use Vim Inside a Unix Pipe Like Sed or AWK
1–10 of 49 posts
Re: Use Vim Inside a Unix Pipe Like Sed or AWK
#2I 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
#3 function vimify() {
(vim - -esbnN -c $@ -c 'w!/dev/fd/3|q!' >/dev/null) 3>&1
}
$ echo 'Change Me' | vimify 'norm vitxiOK I Will'
(Don't forget '-c' if you have more than one transform.)Re: Use Vim Inside a Unix Pipe Like Sed or AWK
#4 diff file1 file2 | vim -
Gives you the diff but colorized with Vim. Handy little trick.Re: Use Vim Inside a Unix Pipe Like Sed or AWK
#5Hi, 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…
Just an FYI :)
Re: Use Vim Inside a Unix Pipe Like Sed or AWK
#6Hi, 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 :)
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
#7I 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.
Re: Use Vim Inside a Unix Pipe Like Sed or AWK
#8Re: Use Vim Inside a Unix Pipe Like Sed or AWK
#9I 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?
Re: Use Vim Inside a Unix Pipe Like Sed or AWK
#10http://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...