revered vimscript to @waedt version