For example, could I type something like
firefox open
this is a search
where open
is just passed to the vimperator command line?
Vimperator founder here:
Yes, it is possible. The complete syntax is here:
https://github.com/vimperator/vimperator-labs/blob/master/common/locale/en-US/starting.xml or given in :help startup
So try that:
firefox -vimperator "+c 'javascript alert(\"from commandline\");'"
would show an prompt after starting firefox. For opening URLs or searching, you need a slight "hack" as there is a race condition and we need to add a slight delay like so:
firefox -vimperator "+c \
'javascript liberator.sleep(1000) && liberator.open(\"this is a search\");'"
If it is really required to put that content into the command line and not executing it directly, you can try the normal command:
firefox -vimperator "+c 'normal \":open this is a search\"'"
In general, pay attention about the correct escaping of quotes. I recommend using the mixture of " ' and \" like in the above examples.
You can use the following function to make this a single one-liner, like so:
$ function vimpopen () {
firefox -vimperator "+c 'normal \":open $@\"'"
}
function vimpopen() { firefox -vimperator "+c 'normal :open $@'"; }
And it sort of worked. Firefox opens with what I type and I have to press enter. The terminal is also linked to the firefox window so that if I close out of the terminal, then firefox also closes -- which isn't desirable.
– George Oct 11 '14 at 23:05
$ firefox -search 'this is a search'
. – anlar Oct 04 '14 at 09:02