[vim] gstar and ghash implementation

This is an attempt to fix the issue #2296 with unit tests