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\“)n# do tddnnClean up the buffer’s autocmd. Run on the code window.n:au! *

Leave a Reply