RSS

Blog

Behat plugin for vim

By Vincent Velociter
19 January 2012
In the Development category

If you already enjoy writing behat steps with vim, you are certainly using the cucumber runtime files developed by Tim Pope. Those are great, as they provide you syntax and indentation for Gherkin (Behat and Cucumber plain text DSL).

Cucumber plugin also has autocompletion of steps, mappings to jump to step definition from the feature file, and a compiler plugin. There's one hiccup, though: all that good stuff was made for cucumber and is not working with Behat.

But, wait! Now we have a behat plugin, we can enjoy these features too! So, let's go straight to the point:

Download and installation

You can find here the plugin and the installation details.

Insight of autocompletion

autocomplete example

As you can see, the named subpatterns of mink definitions have been replaced with a placeholder, that you can modify later. Actually all custom characters from your regex are replaced (for instance "([^"]*)" would be replaced by "" and (\d+) by 1).

Insight of compiler

compiler example

  • 2012-02-11 Stof

    The behat support is in the roadmap for the next release:  http://confluence.jetbrains.ne...

  • 2012-01-26 Florian Klein

    Indeed, vim, miss some kind of events on autocompletion, but it's very customizable nevertheless.

  • 2012-01-20 cordoval

    color is hackeable but not autocomplete unfortunately

  • 2012-01-19 Florian Klein

    What you need is switch to Vim :)

  • 2012-01-19 jrubr

    Yeah! Very nice indeed.

  • 2012-01-19 everzet

    I'm VIM user, but i kinda tired to ask JetBrainz guys to add Behat support for community http://youtrack.jetbrains.net/... :-/

  • 2012-01-19 Gabriel Pillet

    Need this shit on PHPStorm now ! :x