On Tue, 08 Feb 2005 15:11, Douglas Royds wrote:
Anyone know how to get an "edit this page" capability out of Firefox? I'd like to be able to hurl the current page into either Vim or Nvu, especially when it's a page on my local machine.
^S is the shortcut for 'Save As' in the file menu.
edit the resultant file.
I wanted to edit a file that is already on my hard disk, without having to browse to it, but I have succeeded.
Answering my own question:
I have succeeded with "mozex" (http://extensionroom.mozdev.org/more-info/mozex). I can now right-click on a page and select mozex->view page source, and the page will come up in Vim. As an extra bonus, I can right-click in a text box, and throw the contents of the text-box into Vim as well.
Quite a hassle to configure. The configuration itself is thoroughly hidden under chrome://mozex/content/mozexPrefDialog.xul
On Win32 it requires a perl script to deal with %20 and the like in file names. For completeness, the perl script follows. mozex is configured to run the script, passing it the target filename:
# Maps difficult characters in a URL for the mozex extension to Firefox
$filename = $ARGV[0];
$filename =~ s/%20/ /g;
$filename =~ s/%23/#/g;
$filename =~ s/%25/%/g;
$filename =~ s/%5B/[/g;
$filename =~ s/%5D/]/g;
$filename =~ s/%5E/^/g;
$filename =~ s/%60/`/g;
$filename =~ s/%7B/{/g;
$filename =~ s/%7D/}/g;
$filename =~ s/html#.*/html/g;
$filename =~ s/htm#.*/htm/g;
$filename =~ s/\//\\/g;
$filename =~ s/(.*)/"$1"/;
#$filename =~ s/(.*)/-edit "$1"/; #edit with nvu
exec "C:\\\\vim\\vim62\\gvim.exe","--remote-silent",$filename;
#exec "C:\\\\Progra~1\\NoteTa~1\\NotePro.exe",$filename;
#exec "C:\\\\Progra~1\\Programs\\nvu-0.70\\nvu.exe",$filename;
#exec "C:\\\\WINDOWS\\notepad.exe",$filename======================================================================= This email, including any attachments, is only for the intended addressee. It is subject to copyright, is confidential and may be the subject of legal or other privilege, none of which is waived or lost by reason of this transmission. If the receiver is not the intended addressee, please accept our apologies, notify us by return, delete all copies and perform no other act on the email. Unfortunately, we cannot warrant that the email has not been altered or corrupted during transmission. =======================================================================
