Lifted from vim.org/scripts