mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 20:07:59 +01:00
move global help() command to a vimperator slot
This commit is contained in:
@@ -397,7 +397,7 @@ function Commands() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new Command(["exu[sage]"],
|
||||
function() { help("commands"); },
|
||||
function(args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); },
|
||||
{
|
||||
usage: ["exu[sage]"],
|
||||
short_help: "Show help for Ex commands"
|
||||
@@ -427,7 +427,7 @@ function Commands() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new Command(["h[elp]"],
|
||||
help,
|
||||
function(args, special, count, modifiers) { vimperator.help(args, special, null, modifiers); },
|
||||
{
|
||||
usage: ["h[elp] {subject}"],
|
||||
short_help: "Open the help window",
|
||||
@@ -620,7 +620,7 @@ function Commands() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new Command(["se[t]"],
|
||||
function(args, special)
|
||||
function(args, special, count, modifiers)
|
||||
{
|
||||
if (args == "")
|
||||
{
|
||||
@@ -888,7 +888,7 @@ function Commands() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultCommand(new Command(["viu[sage]"],
|
||||
function() { help("mappings"); },
|
||||
function(args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
|
||||
{
|
||||
usage: ["viu[sage]"],
|
||||
short_help: "Show help for normal mode commands"
|
||||
|
||||
@@ -26,7 +26,7 @@ the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
}}} ***** END LICENSE BLOCK *****/
|
||||
|
||||
function help(section, easter) //{{{
|
||||
Vimperator.prototype.help = function(section, easter) //{{{
|
||||
{
|
||||
if (easter)
|
||||
{
|
||||
@@ -210,7 +210,7 @@ function help(section, easter) //{{{
|
||||
return false;
|
||||
|
||||
openURLs("about:blank");
|
||||
setTimeout(function () { help(section, false, null, {recursive: true}); }, 250);
|
||||
setTimeout(function () { vimperator.help(section, false, null, {recursive: true}); }, 250);
|
||||
return;
|
||||
}
|
||||
doc.write(fulldoc);
|
||||
|
||||
@@ -199,7 +199,7 @@ function Mappings() //{{{
|
||||
* Normal mode
|
||||
*/
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["'", "`"],
|
||||
function (mark) { vimperator.marks.jumpTo(mark) },
|
||||
function(mark) { vimperator.marks.jumpTo(mark) },
|
||||
{
|
||||
short_help: "Jump to the mark in the current buffer",
|
||||
usage: ["'{a-zA-Z0-9}"],
|
||||
@@ -207,14 +207,16 @@ function Mappings() //{{{
|
||||
flags: Mappings.flags.ARGUMENT
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["]f"], function(count) { focusNextFrame(count > 1 ? count : 1, true); },
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["]f"],
|
||||
function(count) { focusNextFrame(count > 1 ? count : 1, true); },
|
||||
{
|
||||
short_help: "Focus next frame",
|
||||
help: "Transfers keyboard focus to the [count]th next frame in order. The newly focused frame is briefly colored red.",
|
||||
flags: Mappings.flags.COUNT
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["[f"], function(count) { focusNextFrame(count > 1 ? count : 1, false); },
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["[f"],
|
||||
function(count) { focusNextFrame(count > 1 ? count : 1, false); },
|
||||
{
|
||||
short_help: "Focus previous frame",
|
||||
help: "Transfers keyboard focus to the [count]th previous frame in order. The newly focused frame is briefly colored red.",
|
||||
@@ -222,7 +224,7 @@ function Mappings() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["b"],
|
||||
function (args) { vimperator.commandline.open(":", "buffer ", vimperator.modes.EX); },
|
||||
function(args) { vimperator.commandline.open(":", "buffer ", vimperator.modes.EX); },
|
||||
{
|
||||
short_help: "Open a prompt to switch buffers",
|
||||
help: "Typing the corresponding number opens switches to this buffer."
|
||||
@@ -266,7 +268,7 @@ function Mappings() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["go"],
|
||||
function (mark) { vimperator.quickmarks.jumpTo(mark, false) },
|
||||
function(mark) { vimperator.quickmarks.jumpTo(mark, false) },
|
||||
{
|
||||
short_help: "Jump to a QuickMark in the current buffer",
|
||||
usage: ["go{a-zA-Z0-9}"],
|
||||
@@ -276,7 +278,7 @@ function Mappings() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["gn"],
|
||||
function (mark) { vimperator.quickmarks.jumpTo(mark, true) },
|
||||
function(mark) { vimperator.quickmarks.jumpTo(mark, true) },
|
||||
{
|
||||
short_help: "Jump to a QuickMark in a new buffer",
|
||||
usage: ["gn{a-zA-Z0-9}"],
|
||||
@@ -308,7 +310,8 @@ function Mappings() //{{{
|
||||
}
|
||||
));
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ['<C-^>', '<C-6>'],
|
||||
function (args) {
|
||||
function()
|
||||
{
|
||||
if (vimperator.tabs.getTab() == vimperator.tabs.alternate)
|
||||
{
|
||||
vimperator.echoerr("E23: No alternate page");
|
||||
@@ -684,7 +687,7 @@ function Mappings() //{{{
|
||||
|
||||
/* vimperator managment */
|
||||
addDefaultMap(new Map(vimperator.modes.NORMAL, ["<F1>"],
|
||||
function(count) { help(null); },
|
||||
function(count) { vimperator.help(null); },
|
||||
{
|
||||
short_help: "Open help window",
|
||||
help: "The default section is shown, if you need help for a specific topic, try <code class=\"command\">:help <F1></code> (jumping to a specific section not implemented yet)."
|
||||
|
||||
@@ -112,7 +112,7 @@ function init() //{{{
|
||||
if (Options.getPref("firsttime", true))
|
||||
{
|
||||
setTimeout(function() {
|
||||
help(null, null, null, { inTab: true });
|
||||
vimperator.help(null, null, null, { inTab: true });
|
||||
Options.setPref("firsttime", false);
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
@@ -38,8 +38,8 @@ the terms of any one of the MPL, the GPL or the LGPL.
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/x-javascript;version=1.7" src="help.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="vimperator.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="help.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="commands.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="ui.js"/>
|
||||
<script type="application/x-javascript;version=1.7" src="options.js"/>
|
||||
|
||||
Reference in New Issue
Block a user