vim: bunch of improvements to function and form