vim: move isCommand into a function