Extreme Vim Macros for Traditionalist Catholics

52,955
0
Published 2021-03-02
This is how you do pretty advanced actions in vim automatically. In this case, I want vim to automatically insert footnotes taken from the end of a text file in the appropriate place for them to be formatted automatically in a LaTeX document. This would be a huge chore for a Wordcuck or someone using a text editor or IDE without sufficient macro capabilities, but vim makes it pretty easy. Keys are displayed with screenkey.

My website: lukesmith.xyz/
Please donate: lukesmith.xyz/donate
Get all my videos off YouTube: videos.lukesmith.xyz/
or Odysee: odysee.com/$/invite/@Luke:7

BTC: bc1qk2dz5x6m3sjnkzf0mhlz9pmsz4xfjtjmfrgm9d
XMR: 48jewbtxe4jU3MnzJFjTs3gVFWh2nRrAMWdUuUd7Ubo375LL4SjLTnMRKBrXburvEh38QSNLrJy3EateykVCypnm6gcT9bh

OR affiliate links to things l use:
www.vultr.com/?ref=8384069-6G Get a VPS and host a website or server for anything else.
www.epik.com/?affid=we2ro7sa6 Get a cheap and reliable domain name with Epik.
brave.com/luk005 Get the Brave browser.
odysee.com/$/invite/@Luke:7 View my videos on Odysee and get a bonus for joining.
www.coinex.com/register?refer_code=ndf87 Get crypto-rich on Coinex. Get reduced exchange fees for 3 months.
www.coinbase.com/join/smith_5to1 Get crypto-rich on Coinbase. We both get $10 in Bitcoin when you buy or sell $100 in cryptocurrencies.

All Comments (21)
  • @warecamel
    Default runescape character maximizing his prayer level
  • @Ryan-rn3sq
    Every day we get closer to the inevitable TempleOS in-car screencast video.
  • @AnalyticMinded
    Does this work for any document or just Papal encyclicals?
  • @Gornius
    "Advanced applied laziness" goes straight into my dictionary.
  • This video is the best recommendation the YouTube algorithm has ever given me... I use Vim. I attend TLM.
  • @tokiomutex4148
    "advanced applied laziness" for those familiar with functional programming this may sound like a performance improvement
  • @johnflood9818
    I was astounded to come across this video! I am a 73 year old Catholic religious brother living in Nairobi and as a way of forcing my self to read a bit "actively" I recently finished going through "Fratelli Tutti", an encyclical of Pope Francis published last October, using vim to give a heading to each and every paragraph in order to force me to read attentively! It has 288 footnotes! I had finished reading it but I was planning when I got a bit of free time (I'm not quite retired) to do EXACTLY what you showed in the video! Thanks
  • @chadwilson3323
    As a traditionalist Catholic and avid vim user, I was very excited and very confused when this popped into my feed! I was actually going to do this as a personal project to learn LaTeX more... great work!
  • @olafcreed4726
    You are very catholically blessed to know all the commands to do something like this
  • @Mawkler
    An even more beautiful way to do this is to make the macro recursive, i.e. in your case add @f at the end of your recording. You then just have to call the macro one single time and it will keep calling itself until it can't find a match.
  • @ultrahalf
    "advanced applied laziness", sounds like major I wanna do
  • @JeffGeerling
    Now write a macro to scan all the encyclicals and find which one has the most footnotes. And which has the lowest biblical-reference-to-other-docs-reference ratio.
  • When returning to the footnote, you can use backquote-quote (`') to return to the exact column you were on in the line, which keeps you from having to search for the empty parens to get back there.
  • @ajay--yadav
    One of the things I like about your channel is that it covers mainly linux fundamentals. Using your videos, I got to learn about tools/commands like pipes, du, cat, sxhkd, window managers, rsync. Thanks for this. Please keep uploading such videos.
  • @remline
    Love it! Those professionally typeset encyclicals look wonderful.