Vim power: transforming yaml to m4

The more I learn vim, the more I am impressed with the efficient ways it handles complex nrepetitive editing tasks:nMy task is to transform a yaml file to a bunch of m4 definitionsn# Welcome to Jekyll!n#n# This config file is meant for settings that affect your whole blog, valuesn# which you are expected to set up once and rarely edit after that. If you findn# yourself editing this file very often, consider using Jekyll’s data filesn# feature for the data you need to update frequently.n#n# For technical reasons, this file is *NOT* reloaded automatically when you usen# ‘bundle exec jekyll serve’. If you change this file, please restart the server process.nn# Site settingsn# These are used to personalize your new site. If you look in the HTML files,n# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.n# You can create any custom variable you would like, and they will be accessiblen# in the templates via {{ site.myvariable }}.ntitle: Sitenemail: site@example.comndescription: “some example site”nlogo: falsennbaseurl: “”nurl: “https://example.com”npermalink: “:year/:month/:day/:title/”ndomain_name: “https://example.com”nn# Details for the RSS feed generatornauthor: “anon”nn# cache buster, increment when we have changesncache_version: 2nnexcerpt_separator: “

Simple TDD with NeoVim’s Terminal

Gotta love NeoVim’s terminal! For simple projects, it can replace a lot of whatndedicated plugins do, not to mention external dependencies like file watchers.n![kvdev]({{ site.baseurl }}/assets/img/kv.png)nHere is a TDD recipe for a small project. No plugins used:nStart nvimnnvim feature.pynnSplit a new terminal verticallyn:vsp | :terminalnnGet the terminal’s job id.nn:echo b:terminal_job_idn3nnSwitch to the other windownnwnnAdd an autocmd that sends a command to the terminal to run the tests. The job id is used here.n:au BufWritePost :call jobsend(3, “\clear\python3 feature_test.py\“)n# do tddnnClean up the buffer’s autocmd. Run on the code window.n:au! *