Gotta love NeoVim's terminal! For simple projects, it can replace a lot of what dedicated plugins do, not to mention external dependencies like file watchers.


Here is a TDD recipe for a small project. No plugins used:

Start nvim


Split a new terminal vertically

:vsp | :terminal

Get the terminal's job id.

:echo b:terminal_job_id

Switch to the other window


Add an autocmd that sends a command to the terminal to run the tests. The job id is used here.

:au BufWritePost <buffer> :call jobsend(3, "\<C-c>clear\<CR>python3\<CR>")
# do tdd

Clean up the buffer's autocmd. Run on the code window.

:au! * <buffer>