Using Vim Macros to Undo Shortened URLsEvan Travers
I've been tinkering with my blog setup. I use Instapaper to do most of my reading on the internet. As I find links that intrigue me, I add them to my Instapaper queue. Once upon a time, every link that I starred in Instapaper got immediately posted to twitter... which explains most of my tweet count.
I have decided to be a little more thoughtful. Rather than blasting the interent, now when I like a link on Instapaper, I use an IFTTT applet to save the title and link to my personal wiki on dropbox, in a folder marked links. I have been manually copying the interesting ones out of that folder to build my monthly link posts. I just wrote a little script that grabs all the links for the current month, and outputs my preferred markdown format so that I can generate a link post at any point. I have also started pulling quotes and commentary out of the link into the saved text file, both in terms of generating the blog post and summarizing what I thought was important about it for my personal knowledge base.
One thing that bugged me about my applet was that it was saving all the links with ifttt's link shortener... While I just discovered that you can turn that off (read the docs, right?), last month I spent a lot of time opening each link, copying the original URL, and putting it back in the blog post. Yucky.
In preparation for this month I was cleaning up the URLs I had "liked" before turning off the link shortener, and I realized that the way I was using vim was a great example of the power of Vim: movement, magic, and macros... so I humblebragged on Slack and stopped to recreate the edit as a demo:
A "real" version of this macro would have also probably saved the file and
automatically gone to the next file in the list using
:bn, but this was a
quick and dirty version for internet fame. It'll
I'm always telling people it's worth the effort to learn their preferred editor well. Maybe this task demonstrates why Vim is a good option. I didn't even stop to think what I was doing until I was done, and I had accomplished a fairly complex and repetitive task with speed and efficiency.
2022-06-08 11:31:29 -0500Rename articles
2020-06-18 14:26:02 -0500Move everything to CST
Don't know why I didn't do that before. It caused _no_ end of
2019-11-14 19:21:38 -0600Remove Tag: programming
`code` is the same tag and has more coverage.
2019-03-08 16:07:02 -0600Remove dumb duplicate title.
2019-03-08 15:30:30 -0600Post: Vim Macros example