Using Vimperator 3.4 - in a user-defined command - I use the current buffer's URL like this:
command -nargs=0 <name> :execute "!echo " + content.location.href
This defines the user-command :<name>
, which takes no arguments. It calls the Vimperator command :execute
which takes a string and executes it as though you were the who typed it. In this case it takes the string "!echo " + content.location.href
. The content.location.href
evaluates as a JavaScript expression (or something like that) and returns the URL of the page where the command was executed.
Executing :<name>
on this page outputs this (after a brief pop-up terminal window - on Windows 7, using Cygwin's Bash as my shell):
http://superuser.com/questions/363654/vimperator-how-to-use-current-pages-url-as-shell-command-argument