These functions write a URL (or file name) to another buffer. If writing to a buffer in another session, the functions write the URL after the current line. The functions behave differently. If the current buffer is a web page and the current line contains one or more links, the `u` function writes the URL of the current page and the `url` function writes the URLs of the links. If the current buffer is a directory, the `u` function writes the path of the current file in that directory and the `url` function writes the path of the directory. # Write the file name to a buffer. # usage: ] function+u { db0 H- ebvar+ lsX if(*) { ![ -z "~0" ] if(*) { ebvar- enew r !echo '_/'. bw } else { ebvar- e~0 r !echo '_/'. eret } } else { ![ -z "~0" ] if(*) { ebvar- enew r !echo "$EB_BASE" bw } else { ebvar- e~0 r !echo "$EB_BASE" eret } } } # Write the current URL. # usage $/f +,+2d ,s/^
$/$1/f # Replace character entity references. ,s/'/'/gf ,s/&/\&/gf bw w~0@. if(*) { ^ } else { w~0 if(*) { ^ } else { w+ ~0 if(*) { ^ } } } } }