mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 23:58:00 +01:00
new gf gF and :viewsource commands (thanks dpb)
This commit is contained in:
1
AUTHORS
1
AUTHORS
@@ -10,6 +10,7 @@ Inactive/former developers:
|
|||||||
* Viktor Kojouharov (Виктор Кожухаров)
|
* Viktor Kojouharov (Виктор Кожухаров)
|
||||||
|
|
||||||
Patches (in no special order):
|
Patches (in no special order):
|
||||||
|
* Daniel Bainton (:viewsource)
|
||||||
* Muthu Kannan (ctrl-v support)
|
* Muthu Kannan (ctrl-v support)
|
||||||
* Lars Kindler (:buffer(s) functionality)
|
* Lars Kindler (:buffer(s) functionality)
|
||||||
* Lee Hinman (:open ./.. support)
|
* Lee Hinman (:open ./.. support)
|
||||||
|
|||||||
5
NEWS
5
NEWS
@@ -1,5 +1,5 @@
|
|||||||
<pre>
|
<pre>
|
||||||
2007-xx-xx:
|
2008-xx-xx:
|
||||||
* version 0.6
|
* version 0.6
|
||||||
* THIS VERSION ONLY WORKS WITH FIREFOX 3.0 beta1 or newer
|
* THIS VERSION ONLY WORKS WITH FIREFOX 3.0 beta1 or newer
|
||||||
* IMPORTANT: options are no longer automatically stored - use the
|
* IMPORTANT: options are no longer automatically stored - use the
|
||||||
@@ -9,12 +9,13 @@
|
|||||||
removed the following hint options: 'hintchars' 'maxhints'
|
removed the following hint options: 'hintchars' 'maxhints'
|
||||||
added the following hint options: 'hinttimeout'
|
added the following hint options: 'hinttimeout'
|
||||||
* IMPORTANT: changed 'I' key to Ctrl-Q to also work in textboxes
|
* IMPORTANT: changed 'I' key to Ctrl-Q to also work in textboxes
|
||||||
* :au[tocmd] executes commands on events (only 'onPageLoad' actually) on websites
|
* :au[tocmd] executes commands on events (only 'PageLoad' actually) on websites
|
||||||
* @@ to repeat last macro
|
* @@ to repeat last macro
|
||||||
* new macro commands q[a-z0-9] and @[a-z0-9] to replay them (thanks Marco!)
|
* new macro commands q[a-z0-9] and @[a-z0-9] to replay them (thanks Marco!)
|
||||||
* scroll commands like j/k/gg/etc. have a much better heuristic to find a scrollable frame
|
* scroll commands like j/k/gg/etc. have a much better heuristic to find a scrollable frame
|
||||||
* imap, inoremap, iunmap and imapclear added
|
* imap, inoremap, iunmap and imapclear added
|
||||||
* new g0 and g$ mappings to go to the first/last tab
|
* new g0 and g$ mappings to go to the first/last tab
|
||||||
|
* new gf and gF mappings and ;v and ;V hints mode to view the source code
|
||||||
* new 'history' option for specifying the number of Ex commands and
|
* new 'history' option for specifying the number of Ex commands and
|
||||||
search patterns to store in the commandline history
|
search patterns to store in the commandline history
|
||||||
* new ctrl-x and ctrl-a mappings to increment the last number in the URL
|
* new ctrl-x and ctrl-a mappings to increment the last number in the URL
|
||||||
|
|||||||
1
TODO
1
TODO
@@ -30,7 +30,6 @@ FEATURES:
|
|||||||
6 use '' to jump between marks like vim
|
6 use '' to jump between marks like vim
|
||||||
6 pipe selected text/link/website to an external command
|
6 pipe selected text/link/website to an external command
|
||||||
6 macros (qq, @q, ...)
|
6 macros (qq, @q, ...)
|
||||||
6 gf = view source?
|
|
||||||
6 :set wildoptions=auto mode, which would list completions on each keystroke (maybe performance problems)
|
6 :set wildoptions=auto mode, which would list completions on each keystroke (maybe performance problems)
|
||||||
5 Use ctrl-w+j/k/w to switch between sidebar, content, preview window
|
5 Use ctrl-w+j/k/w to switch between sidebar, content, preview window
|
||||||
5 Favicons in completion windows and some other places?
|
5 Favicons in completion windows and some other places?
|
||||||
|
|||||||
@@ -2517,6 +2517,39 @@ vimperator.Commands = function () //{{{
|
|||||||
help: "You can show the Firefox version page with <code class=\"command\">:version!</code>."
|
help: "You can show the Firefox version page with <code class=\"command\">:version!</code>."
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
commandManager.add(new vimperator.Command(["vie[wsource]"],
|
||||||
|
function (args, special)
|
||||||
|
{
|
||||||
|
var url = args || vimperator.buffer.URL;
|
||||||
|
if (special) // internal editor
|
||||||
|
{
|
||||||
|
vimperator.open("view-source:" + url)
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: make that a helper function
|
||||||
|
// TODO: save return value in v:shell_error
|
||||||
|
var newThread = Components.classes["@mozilla.org/thread-manager;1"].getService().newThread(0);
|
||||||
|
var editor = vimperator.options["editor"];
|
||||||
|
var args = editor.split(" "); // FIXME: too simple
|
||||||
|
if (args.length < 1)
|
||||||
|
{
|
||||||
|
vimperator.open("view-source:" + url)
|
||||||
|
vimperator.echoerr("no editor specified");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var prog = args.shift();
|
||||||
|
args.push(url)
|
||||||
|
vimperator.callFunctionInThread(newThread, vimperator.run, [prog, args, true]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
usage: ["vie[wsource][!] [url]"],
|
||||||
|
shortHelp: "View source code of current document",
|
||||||
|
help: "When ! is given, it is opened with the internal editor, otherwise with the external."
|
||||||
|
}
|
||||||
|
));
|
||||||
commandManager.add(new vimperator.Command(["viu[sage]"],
|
commandManager.add(new vimperator.Command(["viu[sage]"],
|
||||||
function (args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
|
function (args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -329,8 +329,7 @@ vimperator.Editor = function () //{{{
|
|||||||
{
|
{
|
||||||
var textBox = document.commandDispatcher.focusedElement;
|
var textBox = document.commandDispatcher.focusedElement;
|
||||||
var editor = vimperator.options["editor"];
|
var editor = vimperator.options["editor"];
|
||||||
var args = [];
|
var args = editor.split(" ");
|
||||||
args = editor.split(" ");
|
|
||||||
if (args.length < 1)
|
if (args.length < 1)
|
||||||
{
|
{
|
||||||
vimperator.echoerr("no editor specified");
|
vimperator.echoerr("no editor specified");
|
||||||
|
|||||||
@@ -440,6 +440,8 @@ vimperator.Hints = function () //{{{
|
|||||||
case "O": vimperator.commandline.open(":", "open " + loc, vimperator.modes.EX); break;
|
case "O": vimperator.commandline.open(":", "open " + loc, vimperator.modes.EX); break;
|
||||||
case "t": openHint(vimperator.NEW_TAB); break;
|
case "t": openHint(vimperator.NEW_TAB); break;
|
||||||
case "T": vimperator.commandline.open(":", "tabopen " + loc, vimperator.modes.EX); break;
|
case "T": vimperator.commandline.open(":", "tabopen " + loc, vimperator.modes.EX); break;
|
||||||
|
case "v": vimperator.commands.viewsource(loc); break;
|
||||||
|
case "V": vimperator.commands.viewsource(loc, true); break;
|
||||||
case "w": openHint(vimperator.NEW_WINDOW); break;
|
case "w": openHint(vimperator.NEW_WINDOW); break;
|
||||||
case "W": vimperator.commandline.open(":", "winopen " + loc, vimperator.modes.EX); break;
|
case "W": vimperator.commandline.open(":", "winopen " + loc, vimperator.modes.EX); break;
|
||||||
case "y": yankHint(false); break;
|
case "y": yankHint(false); break;
|
||||||
@@ -491,7 +493,7 @@ vimperator.Hints = function () //{{{
|
|||||||
// TODO: implement framesets
|
// TODO: implement framesets
|
||||||
show: function (mode, minor, filter)
|
show: function (mode, minor, filter)
|
||||||
{
|
{
|
||||||
if (mode == vimperator.modes.EXTENDED_HINT && !/^[;asoOtTwWyY]$/.test(minor))
|
if (mode == vimperator.modes.EXTENDED_HINT && !/^[;asoOtTvVwWyY]$/.test(minor))
|
||||||
{
|
{
|
||||||
vimperator.beep();
|
vimperator.beep();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -567,6 +567,22 @@ vimperator.Mappings = function () //{{{
|
|||||||
help: "You can also use the hints to create the probably fastest file browser on earth."
|
help: "You can also use the hints to create the probably fastest file browser on earth."
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gf"],
|
||||||
|
function () { vimperator.commands.viewsource(); },
|
||||||
|
{
|
||||||
|
shortHelp: "View source",
|
||||||
|
help: "Opens the source code of the current website with the external editor specified " +
|
||||||
|
"by the <code class='option'>'editor'</code> option. For now the external editor " +
|
||||||
|
"must be able to download and open files from a remote URL."
|
||||||
|
}
|
||||||
|
));
|
||||||
|
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gF"],
|
||||||
|
function () { vimperator.commands.viewsource(null, true); },
|
||||||
|
{
|
||||||
|
shortHelp: "View source in current tab",
|
||||||
|
help: "Opens the source code of the current website with the internal editor."
|
||||||
|
}
|
||||||
|
));
|
||||||
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gh"],
|
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gh"],
|
||||||
BrowserHome,
|
BrowserHome,
|
||||||
{
|
{
|
||||||
@@ -1244,6 +1260,7 @@ vimperator.Mappings = function () //{{{
|
|||||||
"<li><code class=\"mapping\">t</code> to open its location in a new tab</li>" +
|
"<li><code class=\"mapping\">t</code> to open its location in a new tab</li>" +
|
||||||
"<li><code class=\"mapping\">O</code> to open its location in an <code class=\"command\">:open</code> query</li>" +
|
"<li><code class=\"mapping\">O</code> to open its location in an <code class=\"command\">:open</code> query</li>" +
|
||||||
"<li><code class=\"mapping\">T</code> to open its location in a <code class=\"command\">:tabopen</code> query</li>" +
|
"<li><code class=\"mapping\">T</code> to open its location in a <code class=\"command\">:tabopen</code> query</li>" +
|
||||||
|
"<li><code class=\"mapping\">v</code> to view its destination source</li>" +
|
||||||
"<li><code class=\"mapping\">w</code> to open its destination in a new window</li>" +
|
"<li><code class=\"mapping\">w</code> to open its destination in a new window</li>" +
|
||||||
"<li><code class=\"mapping\">W</code> to open its location in a <code class=\"command\">:winopen</code> query</li>" +
|
"<li><code class=\"mapping\">W</code> to open its location in a <code class=\"command\">:winopen</code> query</li>" +
|
||||||
"<li><code class=\"mapping\">y</code> to yank its location</li>" +
|
"<li><code class=\"mapping\">y</code> to yank its location</li>" +
|
||||||
|
|||||||
Reference in New Issue
Block a user