Small performance improvements for Vim.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>