sentientmonkey / vim-tcr

VIM plugin for Test && Commit || Revert

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

   ________________
  /_  __/ ____/ __ \
   / / / /   / /_/ /
  / / / /___/ _, _/
 /_/  \____/_/ |_|

Test && Commit || Revert for vim

tcr.vim

This plugin allows you to set up a TCR flow inside of vim. This is a work in progress, and still evolving so it's very simple. I wrote this because I was tired of using the same autocmd one-liner before practing TCR.

What is TCR?

test && commit || revert is a development methology as an offshoot of Test-Driven Development (TDD). The idea is that Every time you save a file, you run all of the tests. If it fails, your changes are reverted. If it passes, a small commit is made and you can continue.

Inspiration:

Installing

Use your favorite plugin manager. I tend to use vim-plug.

  Plug 'sentientmonkey/vim-tcr'

Commands

:TCR    " Toggles TCR mode off/on
:TCRon  " Turns TCR mode on
:TCRoff " Turns TCR mode off

When TCR mode is on, every time you save, it will run your tests. If they pass, the plugin will add and commit the working file.

Supported filetypes

Right now, only the following filetypes are supported, and customizing test runners is not yet a supported feature.

  • ruby
  • javascript
  • typescript
  • kotlin

Features

Lots of features not yet implemented. Here's a running list.

  • Runs tests on save
  • Configurable commit message
  • Configurable revert command
  • Configurable for other filetypes
  • Configurable for other test commands
  • Add all files in working directory before commit
  • See history of output after pressing enter
  • Handle multiple file saves at once

About

VIM plugin for Test && Commit || Revert


Languages

Language:Vim Script 100.0%