This gives the custom modeline a chance to run first, that way if the
default modeline crashes the custom modeline is still used. We leave it
at the bottom too so that the custom modeline gets precedence if
everything is working OK.
function format {
# Create a temp file with the provided modeline
tmp="$(mktemp)"
- sed "\$avim: $(get_modeline)" "$1" > "$tmp"
+ sed -e "1ivim: $(get_modeline)" \
+ -e "\$avim: $(get_modeline)" "$1" > "$tmp"
# Determine cache name
md5="$(cat index.cgi vimrc "$tmp" /usr/bin/ex | md5sum -b)"
'+sil! set iconstring= ruf= stl= tal=' \
"+sil! set titlestring=$1\ -\ vpaste.net" \
'+sil! set noml' \
- '+sil! $d|'$2 \
+ '+sil! 1d|$d|'$2 \
'+sil! %s/\r//g' \
'+sil! TOhtml' \
"+sav! $out" \