vim: Cleanup word matching code

**Don't merge it yet!** It requires review from people that actually know the Vim syntax :)