diff --git a/content/commands.js b/content/commands.js
index 35e9cb99..6849bb59 100644
--- a/content/commands.js
+++ b/content/commands.js
@@ -72,16 +72,8 @@ vimperator.Command = function (specs, action, extraInfo) //{{{
this.action = action;
- // TODO: build a better default usage string
- this.usage = [this.specs[0]];
-
if (extraInfo)
{
- //var flags = extraInfo.flags || 0;
-
- if (extraInfo.usage)
- this.usage = extraInfo.usage;
-
this.help = extraInfo.help || null;
this.shortHelp = extraInfo.shortHelp || null;
this.completer = extraInfo.completer || null;
@@ -564,8 +556,7 @@ vimperator.Commands = function () //{{{
commandManager.add(new vimperator.Command(["addo[ns]"],
function () { vimperator.open("chrome://mozapps/content/extensions/extensions.xul", vimperator.NEW_TAB); },
{
- shortHelp: "Show available Browser Extensions and Themes",
- help: "You can add/remove/disable browser extensions from this dialog.
Be aware that not all Firefox extensions work, because Vimperator overrides some key bindings and changes Firefox's GUI."
+ shortHelp: "Show available Browser Extensions and Themes"
}
));
commandManager.add(new vimperator.Command(["ba[ck]"],
@@ -591,10 +582,7 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["[count]ba[ck][!] [url]"],
shortHelp: "Go back in the browser history",
- help: "Count is supported, :3back goes back 3 pages in the browser history.
" +
- "The special version :back! goes to the beginning of the browser history.",
completer: function (filter)
{
var sh = getWebNavigation().sessionHistory;
@@ -614,10 +602,7 @@ vimperator.Commands = function () //{{{
commandManager.add(new vimperator.Command(["bd[elete]", "bw[ipeout]", "bun[load]", "tabc[lose]"],
function (args, special, count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count > 0 ? count : 1, special, 0); },
{
- usage: ["[count]bd[elete][!]"],
- shortHelp: "Delete current buffer (=tab)",
- help: "Count is supported, :2bd removes two tabs and the one to the right is selected. " +
- "Do :bdelete! to select the tab to the left after removing the current tab."
+ shortHelp: "Delete current buffer (=tab)"
}
));
commandManager.add(new vimperator.Command(["beep"],
@@ -651,14 +636,7 @@ vimperator.Commands = function () //{{{
vimperator.echoerr("Exxx: Could not add bookmark `" + title + "'", vimperator.commandline.FORCE_SINGLELINE);
},
{
- usage: ["bma[rk] [-title=title] [-keyword=kw] [-tags=tag1,tag2] [url]"],
shortHelp: "Add a bookmark",
- help: "If you don't add a custom title, either the title of the web page or the URL is taken as the title.
" +
- "You can omit the optional [url] argument, so just do :bmark to bookmark the currently loaded web page with a default title and without any tags.
" +
- "The following options are interpreted:
" +
- " -title=\"custom title\"
" +
- " -tags=comma,separated,tag,list
" +
- " -keyword=keyword
",
args: [[["-title", "-t"], OPTION_STRING],
[["-tags", "-T"], OPTION_LIST],
[["-keyword", "-k"], OPTION_STRING, function (arg) { return /\w/.test(arg); }]]
@@ -675,12 +653,7 @@ vimperator.Commands = function () //{{{
vimperator.bookmarks.list(res.args.join(" "), tags, special);
},
{
- usage: ["bmarks[!] [filter]"],
shortHelp: "List or open multiple bookmarks",
- help: "Open the message window at the bottom of the screen with all bookmarks which match [filter] either in the title or URL.
" +
- "The special version :bmarks! works the same as :bmarks except it opens all the found bookmarks in new tabs.
" +
- "Filter can also contain the following options:
" +
- "-tags=comma,separated,tag,list
",
completer: function (filter) { return [0, vimperator.bookmarks.get(filter)]; },
args: [[["-tags", "-T"], OPTION_LIST]]
}
@@ -688,13 +661,7 @@ vimperator.Commands = function () //{{{
commandManager.add(new vimperator.Command(["b[uffer]"],
function (args, special) { vimperator.buffer.switchTo(args, special); },
{
- usage: ["b[uffer][!] {url|index}"],
shortHelp: "Go to buffer from buffer list",
- help: "Argument can be either the buffer index or the full URL.
" +
- "If argument is neither a full URL nor an index but uniquely identifies a buffer, " +
- "it is selected. With [!] the next buffer matching the argument " +
- "is selected, even if it cannot be identified uniquely.
" +
- "Use b as a shortcut to open this prompt.",
completer: function (filter) { return vimperator.completion.buffer(filter); }
}
));
@@ -759,9 +726,7 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["dia[log] [firefox-dialog]"],
- shortHelp: "Open a firefox-dialog",
- help: "Available dialogs: use completion on :dialog <tab>",
+ shortHelp: "Open a Firefox dialog",
completer: function (filter) { return vimperator.completion.dialog(filter); }
}
));
@@ -777,10 +742,7 @@ vimperator.Commands = function () //{{{
vimperator.buffer.list(special);
},
{
- usage: ["buffers[!]"],
- shortHelp: "Show a list of all buffers (=tabs)",
- help: "The special version :buffers! opens the buffer list in a persistent preview window. " +
- "Call the special version of this command again to close the window."
+ shortHelp: "Show a list of all buffers (=tabs)"
}
));
commandManager.add(new vimperator.Command(["delbm[arks]"],
@@ -794,13 +756,7 @@ vimperator.Commands = function () //{{{
vimperator.echo(deletedCount + " bookmark(s) with url `" + url + "' deleted", vimperator.commandline.FORCE_SINGLELINE);
},
{
- usage: ["delbm[arks] [url]"],
shortHelp: "Delete a bookmark",
- help: "Deletes all bookmarks which match the [url]. " +
- "If omitted, [url] defaults to the URL of the current buffer. " +
- "Use <Tab> key on a string to complete the URL which you want to delete.
" +
- "The following options WILL be interpreted in the future:
" +
- " [!] a special version to delete ALL bookmarks
",
completer: function (filter) { return [0, vimperator.bookmarks.get(filter)]; }
}
));
@@ -814,9 +770,7 @@ vimperator.Commands = function () //{{{
vimperator.echo(vimperator.io.getCurrentDirectory());
},
{
- usage: ["cd [-|path]"],
shortHelp: "Change the current directory",
- help: ":cd - changes to the last directory.",
completer: function (filter) { return vimperator.completion.file(filter, true); }
}
));
@@ -868,9 +822,7 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["com[mand][!] [{attr}...] {cmd} {rep}"],
- shortHelp: "Lists and defines commands",
- help: "To be written - but it works similar to vim's :command" /*,
+ shortHelp: "Lists and defines commands" /*,
args: [[["-nargs"], OPTION_STRING, function (arg) { return /^(0|1|\*|\?|\+)$/.test(arg); }],
[["-bang"], OPTION_NOARG],
[["-bar"], OPTION_NOARG]] */
@@ -920,12 +872,7 @@ vimperator.Commands = function () //{{{
vimperator.marks.remove(args, special);
},
{
- usage: ["delm[arks] {marks}", "delm[arks]!"],
- shortHelp: "Delete the specified marks",
- help: "Marks are presented as a list. Example:
" +
- ":delmarks Aa b p deletes marks A, a, b and p
" +
- ":delmarks b-p deletes all marks in the range b to p
" +
- ":delmarks! deletes all marks for the current buffer"
+ shortHelp: "Delete the specified marks"
}
));
@@ -950,23 +897,17 @@ vimperator.Commands = function () //{{{
vimperator.quickmarks.remove(args);
},
{
- usage: ["delqm[arks] {marks}", "delqm[arks]!"],
- shortHelp: "Delete the specified QuickMarks",
- help: "QuickMarks are presented as a list. Example:
" +
- ":delqmarks Aa b p deletes QuickMarks A, a, b and p
" +
- ":delqmarks b-p deletes all QuickMarks in the range b to p
" +
- ":delqmarks! deletes all QuickMarks"
+ shortHelp: "Delete the specified QuickMarks"
}
));
commandManager.add(new vimperator.Command(["downl[oads]", "dl"],
function () { vimperator.open("chrome://mozapps/content/downloads/downloads.xul", vimperator.NEW_TAB); },
{
- shortHelp: "Show progress of current downloads",
- help: "Open the original Firefox download dialog in a new tab.
" +
- "Here, downloads can be paused, canceled and resumed."
+ shortHelp: "Show progress of current downloads"
}
));
+ // TODO: move helper function somewhere else?
function argToString(arg, color)
{
if (!arg)
@@ -1003,11 +944,7 @@ vimperator.Commands = function () //{{{
vimperator.echo(res);
},
{
- usage: ["ec[ho] {expr}"],
shortHelp: "Display a string at the bottom of the window",
- help: "Useful for showing informational messages. Multiple lines can be separated by \\n.
" +
- "{expr} can either be a quoted string, or any expression which can be fed to eval() like 4+5. " +
- "You can also view the source code of objects and functions if the return value of {expr} is an object or function.",
completer: function (filter) { return vimperator.completion.javascript(filter); }
}
));
@@ -1019,9 +956,7 @@ vimperator.Commands = function () //{{{
vimperator.echoerr(res);
},
{
- usage: ["echoe[rr] {expr}"],
shortHelp: "Display an error string at the bottom of the window",
- help: "Just like :ec[ho], but echoes the result highlighted in red. Useful for showing important messages.",
completer: function (filter) { return vimperator.completion.javascript(filter); }
}
));
@@ -1038,13 +973,23 @@ vimperator.Commands = function () //{{{
vimperator.execute(args);
},
{
- usage: ["exe[cute] {expr1} [ ... ]"],
- shortHelp: "Execute the string that results from the evaluation of {expr1} as an Ex command.",
- help: "Example: :execute echo \"test\" shows a message with the text "test".
"
+ shortHelp: "Execute the string that results from the evaluation of {expr1} as an Ex command."
}
));
commandManager.add(new vimperator.Command(["exu[sage]"],
- function (args, special, count, modifiers) { vimperator.help("commands", special, null, modifiers); },
+ function (args, special, count, modifiers)
+ {
+ var usage = "
| :" + + vimperator.util.escapeHTML(command.name) + " | " + + vimperator.util.escapeHTML(command.shortHelp) + " |
:3forward goes forward 3 pages in the browser history.:forward! goes to the end of the browser history.",
completer: function (filter)
{
var sh = getWebNavigation().sessionHistory;
@@ -1095,40 +1037,59 @@ vimperator.Commands = function () //{{{
commandManager.add(new vimperator.Command(["ha[rdcopy]"],
function () { getBrowser().contentWindow.print(); },
{
- shortHelp: "Print current document",
- help: "Open a GUI dialog where you can select the printer, number of copies, orientation, etc."
- }
- ));
- commandManager.add(new vimperator.Command(["H[elp]"],
- function (args, special, count, modifiers) { vimperator.help(args, special, null, modifiers); },
- {
- usage: ["H[elp] {subject}"],
- shortHelp: "Open the help window",
- help: "You can jump to the specified {subject} with :help {subject}.{subject}. This means::help :help for commands (: prefix):help 'complete' for options (surrounded by ' and '):help o for mappings (no pre- or postfix):help he<Tab> completes :help :help.",
- completer: function (filter) { return vimperator.completion.help(filter); }
+ shortHelp: "Print current document"
}
));
commandManager.add(new vimperator.Command(["h[elp]"],
- function (args, special, count, modifiers) { vimperator.Help((args || "intro")); },
+ function (args, special, count, modifiers)
{
- shortHelp: "Not all help converted to new format, use :Help if you don't find your information.",
- completer: function (filter) { return vimperator.completion.Help(filter); }
+ function jumpToTag(file, tag)
+ {
+ vimperator.open("chrome://vimperator/locale/" + file);
+ setTimeout(function() {
+ var elem = vimperator.buffer.getElement('@class="tag" and text()="' + tag + '"');
+ if (elem)
+ window.content.scrollTo(0, elem.getBoundingClientRect().top - 10); // 10px context
+ else
+ dump('no element: ' + '@class="tag" and text()="' + tag + '"\n' );
+ }, 200);
+ }
+
+ if (!args)
+ {
+ vimperator.open("chrome://vimperator/locale/intro.html");
+ return;
+ }
+
+ var [, items] = vimperator.completion.help(args);
+ var partialMatch = -1;
+ for (var i = 0; i < items.length; i++)
+ {
+ if (items[i][0] == args)
+ {
+ jumpToTag(items[i][1], items[i][0]);
+ return;
+ }
+ else if (partialMatch == -1 && items[i][0].indexOf(args) > -1)
+ {
+ partialMatch = i;
+ }
+ }
+
+ if (partialMatch > -1)
+ jumpToTag(items[partialMatch][1], items[partialMatch][0]);
+ else
+ vimperator.echoerr("E149: Sorry, no help for " + args);
+ },
+ {
+ shortHelp: "Display help",
+ completer: function (filter) { return vimperator.completion.help(filter); }
}
));
commandManager.add(new vimperator.Command(["hist[ory]", "hs"],
function (args, special) { vimperator.history.list(args, special); },
{
- usage: ["hist[ory][!] [filter]"],
shortHelp: "Show recently visited URLs",
- help: "Open the message window at the bottom of the screen with all history items which match [filter] either in the title or URL.:history! works the same as :history except it opens all the found items in new tabs.eval().:javascript alert('Hello world') shows a dialog box with the text \"Hello world\".:javascript <<EOF reads all the lines until a line starting with 'EOF' is found, and interpret them with the JavaScript eval() function.:javascript! opens the JavaScript console of Firefox.<Tab> completion is available for :javascript {cmd}<Tab> (but not yet for the " +
- ":js <<EOF multiline widget). Be aware that Vimperator needs to run {cmd} through eval() " +
- "to get the completions, which could have unwanted side effects.",
completer: function (filter) { return vimperator.completion.javascript(filter); }
}
));
@@ -1271,12 +1224,7 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["let {var-name} [+-.]= {expr1}", "let {var-name}", "let"],
- shortHelp: "Sets or lists a variable",
- help: "Sets the variable {var-name} " +
- "to the value of the expression {expr1}." +
- "If no expression is given, the value of the variable is displayed." +
- "Without arguments, displays a list of all variables."
+ shortHelp: "Sets or lists a variable"
}
));
// code for abbreviations
@@ -1297,11 +1245,7 @@ vimperator.Commands = function () //{{{
vimperator.editor.listAbbreviations("!", lhs);
},
{
- usage: ["ab[breviate] {lhs} {rhs}", "ab[breviate] {lhs}", "ab[breviate]"],
- shortHelp: "Abbreviate a key sequence",
- help: "Abbreviate {lhs} to {rhs}.{lhs} given, list that particual abbreviation.:ab[reviate], but for Command-line mode only."
+ shortHelp: "Abbreviate a key sequence for Command-line mode"
}
));
commandManager.add(new vimperator.Command(["ia[bbrev]"],
@@ -1342,34 +1284,19 @@ vimperator.Commands = function () //{{{
else
vimperator.editor.listAbbreviations("i", lhs);
},
- {
- usage: ["ia[bbrev] {lhs} {rhs}", "ia[bbrev] {lhs}", "ia[bbrev]"],
- shortHelp: "Abbreviate a key sequence for Insert mode",
- help: "Same as :ab[breviate], but for Insert mode only."
- }
+ { shortHelp: "Abbreviate a key sequence for Insert mode" }
));
commandManager.add(new vimperator.Command(["una[bbreviate]"],
function (args) { vimperator.editor.removeAbbreviation("!", args); },
- {
- usage: ["una[bbreviate] {lhs}"],
- shortHelp: "Remove an abbreviation"
- }
+ { shortHelp: "Remove an abbreviation" }
));
commandManager.add(new vimperator.Command(["cuna[bbrev]"],
function (args) { vimperator.editor.removeAbbreviation("c", args); },
- {
- usage: ["cuna[bbrev] {lhs}"],
- shortHelp: "Remove an abbreviation for Command-line mode",
- help: "Same as :una[bbreviate], but for Command-line mode only."
- }
+ { shortHelp: "Remove an abbreviation for Command-line mode" }
));
commandManager.add(new vimperator.Command(["iuna[bbrev]"],
function (args) { vimperator.editor.removeAbbreviation("i", args); },
- {
- usage: ["iuna[bbrev] {lhs}"],
- shortHelp: "Remove an abbreviation for Insert mode",
- help: "Same as :una[bbreviate], but for Insert mode only."
- }
+ { shortHelp: "Remove an abbreviation for Insert mode" }
));
commandManager.add(new vimperator.Command(["abc[lear]"],
function (args) { vimperator.editor.removeAllAbbreviations("!"); },
@@ -1426,16 +1353,6 @@ vimperator.Commands = function () //{{{
},
{
shortHelp: "Execute commands automatically on events",
- help: ":au[tocmd] {event} {pat} {cmd}:autocmd[!] {events} {pat}:autocmd[!] {events}:autocmd[!] * {pat}:autocmd[!]{rhs} is remapped, allowing for nested and recursive mappings.{rhs} is remapped, allowing for nested and recursive mappings.{rhs} is remapped, allowing for nested and recursive mappings.:map or :noremap are cleared."
+ shortHelp: "Remove all mappings"
}
));
commandManager.add(new vimperator.Command(["cmapc[lear]"],
@@ -1575,9 +1470,7 @@ vimperator.Commands = function () //{{{
vimperator.mappings.removeAll(vimperator.modes.COMMAND_LINE);
},
{
- shortHelp: "Remove all mappings (in command-line mode)",
- help: "All user-defined mappings which were set by " +
- ":cmap or :cnoremap are cleared."
+ shortHelp: "Remove all mappings (in command-line mode)"
}
));
commandManager.add(new vimperator.Command(["imapc[lear]"],
@@ -1593,9 +1486,7 @@ vimperator.Commands = function () //{{{
vimperator.mappings.removeAll(vimperator.modes.TEXTAREA);
},
{
- shortHelp: "Remove all mappings (in insert mode)",
- help: "All user-defined mappings which were set by " +
- ":imap or :inoremap are cleared."
+ shortHelp: "Remove all mappings (in insert mode)"
}
));
commandManager.add(new vimperator.Command(["ma[rk]"],
@@ -1620,7 +1511,6 @@ vimperator.Commands = function () //{{{
vimperator.marks.add(args);
},
{
- usage: ["ma[rk] {a-zA-Z}"],
shortHelp: "Mark current location within the web page"
}
));
@@ -1638,9 +1528,7 @@ vimperator.Commands = function () //{{{
vimperator.marks.list(filter);
},
{
- usage: ["marks [arg]"],
- shortHelp: "Show all location marks of current web page",
- help: "If [arg] is specified then limit the list to those marks mentioned."
+ shortHelp: "Show all location marks of current web page"
}
));
commandManager.add(new vimperator.Command(["mkv[imperatorrc]"],
@@ -1705,23 +1593,12 @@ vimperator.Commands = function () //{{{
vimperator.io.writeFile(file, line);
},
{
- usage: ["mkv[imperatorrc] [file]"],
- shortHelp: "Write current key mappings and changed options to [file]",
- help: "If no [file] is specified then ~/.vimperatorrc is written unless this file already exists. " +
- "The special version will overwrite [file] if it exists.'hlsearch' option is set."
- }
+ function (args) { vimperator.search.clear(); },
+ { shortHelp: "Remove the search highlighting" }
));
commandManager.add(new vimperator.Command(["norm[al]"],
function (args, special)
@@ -1735,37 +1612,22 @@ vimperator.Commands = function () //{{{
vimperator.events.feedkeys(args, special);
},
{
- usage: ["norm[al][!] {commands}"],
- shortHelp: "Execute Normal mode commands",
- help: "Example: :normal 20j scrolls 20 lines down. " +
- "If the [!] is specified mappings will not be used."
+ shortHelp: "Execute Normal mode commands"
}
));
// TODO: remove duplication in :map
commandManager.add(new vimperator.Command(["no[remap]"],
function (args) { map(args, [vimperator.modes.NORMAL], true); },
- {
- usage: ["no[remap] {lhs} {rhs}", "no[remap] {lhs}", "no[remap]"],
- shortHelp: "Map the key sequence {lhs} to {rhs}",
- help: "No remapping of the {rhs} is performed."
- }
+ { shortHelp: "Map the key sequence {lhs} to {rhs}" }
));
// XXX: TODO: remove duplication in :cmap
commandManager.add(new vimperator.Command(["cno[remap]"],
function (args) { map(args, [vimperator.modes.COMMAND_LINE], true); },
- {
- usage: ["cno[remap] {lhs} {rhs}", "cno[remap] {lhs}", "cno[remap]"],
- shortHelp: "Map the key sequence {lhs} to {rhs} (in command-line mode)",
- help: "No remapping of the {rhs} is performed."
- }
+ { shortHelp: "Map the key sequence {lhs} to {rhs} (in command-line mode)" }
));
commandManager.add(new vimperator.Command(["ino[remap]"],
function (args) { map(args, [vimperator.modes.INSERT, vimperator.modes.TEXTAREA], true); },
- {
- usage: ["ino[remap] {lhs} {rhs}", "ino[remap] {lhs}", "ino[remap]"],
- shortHelp: "Map the key sequence {lhs} to {rhs} (in insert mode)",
- help: "No remapping of the {rhs} is performed."
- }
+ { shortHelp: "Map the key sequence {lhs} to {rhs} (in insert mode)" }
));
commandManager.add(new vimperator.Command(["o[pen]", "e[dit]"],
function (args, special)
@@ -1783,44 +1645,17 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["o[pen] [url] [, url]"],
shortHelp: "Open one or more URLs in the current tab",
- help: "Multiple URLs can be separated with \", \". Note that the space after the comma is required.:open /etc/fstab shows the file system table.:open ../other/foo.html in your home directory opens \"/home/other/foo.html\":open wikipedia linus torvalds " +
- "opens the wikipedia entry for linus torvalds). The short name of a search engine is automatically guessed from its name. " +
- "If you want to set a custom name, open the $FIREFOX_PROFILE/searchplugins/*.xml file of the search engine, and add/change " +
- "<Alias>myalias</Alias>'defsearch' option) " +
- "if the first word is no search engine (:open linus torvalds opens a Google search for linux torvalds).:open www.osnews.com, www.slashdot.org " +
- "opens OSNews in the current, and Slashdot in a new background tab).:open -tags linux torvalds<Tab> to complete bookmarks " +
- "with tag \"linux\" and which contain \"torvalds\". Note that -tags support is only available for tab completion, not for the actual command.<Tab> are specified in the 'complete' option.!, reloads the current page skipping the cache.",
completer: function (filter) { return vimperator.completion.url(filter); }
}
));
commandManager.add(new vimperator.Command(["pa[geinfo]"],
function () { vimperator.buffer.showPageInfo(true); },
- {
- shortHelp: "Show various page information",
- help: "See :help 'pageinfo' for available options"
- }
+ { shortHelp: "Show various page information" }
));
commandManager.add(new vimperator.Command(["pc[lose]"],
function () { vimperator.previewwindow.hide(); },
- {
- shortHelp: "Close preview window on bottom of screen"
- }
+ { shortHelp: "Close preview window on bottom of screen" }
));
commandManager.add(new vimperator.Command(["pref[erences]", "prefs"],
function (args, special, count, modifiers)
@@ -1847,11 +1682,7 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["pref[erences][!]"],
- shortHelp: "Show Browser Preferences",
- help: "You can change the browser preferences from this dialog. " +
- "Be aware that not all Firefox preferences work, because Vimperator overrides some key bindings and changes Firefox's GUI.:prefs! opens about:config in the current tab where you can change advanced Firefox preferences."
+ shortHelp: "Show Browser Preferences"
}
));
commandManager.add(new vimperator.Command(["qma[rk]"],
@@ -1872,10 +1703,7 @@ vimperator.Commands = function () //{{{
vimperator.quickmarks.add(matches[1], matches[2]);
},
{
- usage: ["qma[rk] {a-zA-Z0-9} [url]"],
- shortHelp: "Mark a URL with a letter for quick access",
- help: "You can also mark whole groups like this: :qmark f http://forum1.com, http://forum2.com, imdb some artist"
+ shortHelp: "Mark a URL with a letter for quick access"
}
));
commandManager.add(new vimperator.Command(["qmarks"],
@@ -1892,25 +1720,16 @@ vimperator.Commands = function () //{{{
vimperator.quickmarks.list(filter);
},
{
- usage: ["qmarks [arg]"],
- shortHelp: "Show all QuickMarks",
- help: "If [arg] is specified then limit the list to those QuickMarks mentioned."
+ shortHelp: "Show all QuickMarks"
}
));
commandManager.add(new vimperator.Command(["q[uit]"],
function () { vimperator.tabs.remove(getBrowser().mCurrentTab, 1, false, 1); },
- {
- shortHelp: "Quit current tab",
- help: "If this is the last tab in the window, close the window. If this was the " +
- "last window, close Vimperator. When quitting Vimperator, the session is not stored."
- }
+ { shortHelp: "Quit current tab" }
));
commandManager.add(new vimperator.Command(["quita[ll]", "qa[ll]"],
function () { vimperator.quit(false); },
- {
- shortHelp: "Quit Vimperator",
- help: "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored."
- }
+ { shortHelp: "Quit Vimperator", }
));
commandManager.add(new vimperator.Command(["redr[aw]"],
function ()
@@ -1919,33 +1738,19 @@ vimperator.Commands = function () //{{{
getInterface(Components.interfaces.nsIDOMWindowUtils);
wu.redraw();
},
- {
- shortHelp: "Redraw the screen",
- help: "Useful to update the screen halfway executing a script or function."
- }
+ { shortHelp: "Redraw the screen", }
));
commandManager.add(new vimperator.Command(["re[load]"],
function (args, special) { vimperator.tabs.reload(getBrowser().mCurrentTab, special); },
- {
- usage: ["re[load][!]"],
- shortHelp: "Reload current page",
- help: "Forces reloading of the current page. If ! is given, skip the cache."
- }
+ { shortHelp: "Reload current page" }
));
commandManager.add(new vimperator.Command(["reloada[ll]"],
function (args, special) { vimperator.tabs.reloadAll(special); },
- {
- usage: ["reloada[ll][!]"],
- shortHelp: "Reload all pages",
- help: "Forces reloading of all pages. If ! is given, skip the cache."
- }
+ { shortHelp: "Reload all pages" }
));
commandManager.add(new vimperator.Command(["res[tart]"],
function () { vimperator.restart(); },
- {
- shortHelp: "Force the browser to restart",
- help: "Useful when installing extensions."
- }
+ { shortHelp: "Force the browser to restart" }
));
commandManager.add(new vimperator.Command(["sav[eas]", "w[rite]"],
function (args, special)
@@ -1962,10 +1767,7 @@ vimperator.Commands = function () //{{{
saveDocument(window.content.document, special);
},
{
- shortHelp: "Save current web page to disk",
- help: "Opens the original Firefox \"Save page as...\" dialog.:set without an argument shows all Vimperator options which differ from their default values.:set! without an argument shows all about:config preferences which differ from their default values.:set option and :set nooption. " +
- "Number and string option types must be set with :set option={value}.:set option! and :set invoption invert the value of a boolean option.:set option? or :set option(for string and list options) shows the current value of an option.:set option& resets an option to its default value.:set option+={value}, :set option^={value} and :set option-={value} " +
- "adds/multiplies/subtracts {value} from a number option and appends/prepends/removes {value} from a string option.:set all shows the current value of all options and :set all& resets all options to their default values.{name} is any of the menu items listed under the standard Firefox View->Sidebar " +
- "menu. Add-ons, Preferences and Downloads are also available in the sidebar.",
completer: function (filter) { return vimperator.completion.sidebar(filter); }
}
));
@@ -2299,43 +2084,24 @@ vimperator.Commands = function () //{{{
vimperator.source(args, special);
},
{
- usage: ["so[urce][!] {file}"],
shortHelp: "Read Ex commands from {file}",
- help: "You can either source files which mostly contain Ex commands like map < gt " +
- "and put JavaScript code within a:" +
- "js <<EOF
hello = function () {
alert(\"Hello world\");
}
EOF
section.function hello2() {
alert(\"Hello world\");
}
are only available within the scope of the script. ! is specified, errors are not printed.",
completer: function (filter) { return vimperator.completion.file(filter, true); }
}
));
commandManager.add(new vimperator.Command(["st[op]"],
BrowserStop,
- {
- shortHelp: "Stop loading",
- help: "Stop loading current web page."
- }
+ { shortHelp: "Stop loading" }
));
commandManager.add(new vimperator.Command(["tab"],
function (args) { vimperator.execute(args, { inTab: true }); },
{
- usage: ["tab {cmd}"],
shortHelp: "Execute {cmd} and tell it to output in a new tab",
- help: "Works only for commands that support it, currently:" +
- "! is specified the movement wraps around the start or end of the tab list."
+ shortHelp: "Move the current tab after tab N"
}
));
commandManager.add(new vimperator.Command(["tabn[ext]", "tn[ext]"],
@@ -2381,16 +2144,12 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["tabn[ext] [count]"],
- shortHelp: "Switch to the next or [count]th tab",
- help: "Cycles to the first tab when the last is selected and {count} is not specified."
+ shortHelp: "Switch to the next or [count]th tab"
}
));
commandManager.add(new vimperator.Command(["tabo[nly]"],
function () { vimperator.tabs.keepOnly(getBrowser().mCurrentTab); },
- {
- shortHelp: "Close all other tabs"
- }
+ { shortHelp: "Close all other tabs" }
));
commandManager.add(new vimperator.Command(["tabopen", "t[open]", "tabnew", "tabe[dit]"],
function (args, special)
@@ -2405,10 +2164,7 @@ vimperator.Commands = function () //{{{
vimperator.open("about:blank", where);
},
{
- usage: ["tabopen [url] [, url]"],
shortHelp: "Open one or more URLs in a new tab",
- help: "Like :open but open URLs in a new tab.!, the 'tabopen' value of the 'activate' option is negated.",
completer: function (filter) { return vimperator.completion.url(filter); }
}
));
@@ -2424,17 +2180,12 @@ vimperator.Commands = function () //{{{
vimperator.echoerr("E488: Trailing characters");
},
{
- usage: ["tabp[revious] [count]"],
- shortHelp: "Switch to the previous tab or go [count] tabs back",
- help: "Wraps around from the first tab to the last tab."
+ shortHelp: "Switch to the previous tab or go [count] tabs back"
}
));
commandManager.add(new vimperator.Command(["tabr[ewind]", "tabfir[st]"],
function () { vimperator.tabs.select(0, false); },
- {
- usage: ["tabr[ewind]", "tabfir[st]"],
- shortHelp: "Switch to the first tab"
- }
+ { shortHelp: "Switch to the first tab" }
));
commandManager.add(new vimperator.Command(["time"],
function (args, special, count)
@@ -2519,12 +2270,7 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["{count}time[!] {code|:command}"],
- shortHelp: "Profile a piece of code or a command",
- help: "Runs {code} {count} times (default 1) and returns the elapsed time. " +
- "{code} is always passed to JavaScript's eval(), which might be slow, so take the results with a grain of salt.{code} starts with a :, it is executed as a Vimperator command.[count]th last tab. " +
- "With [url] restores the tab matching the url.",
completer: function (filter)
{
// get closed-tabs from nsSessionStore
@@ -2591,8 +2334,7 @@ vimperator.Commands = function () //{{{
undoCloseTab(); // doesn't work with i as the index to undoCloseTab
},
{
- shortHelp: "Undo closing of all closed tabs",
- help: "Firefox stores up to 10 closed tabs, even after a browser restart."
+ shortHelp: "Undo closing of all closed tabs"
}
));
commandManager.add(new vimperator.Command(["unl[et]"],
@@ -2621,10 +2363,7 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["unl[et][!] {name} ..."],
- shortHelp: "Deletes a variable.",
- help: "Deletes the variable {name}." +
- "Several variable names can be given."
+ shortHelp: "Deletes a variable."
}
));
commandManager.add(new vimperator.Command(["unm[ap]"],
@@ -2644,9 +2383,7 @@ vimperator.Commands = function () //{{{
vimperator.echoerr("E31: No such mapping");
},
{
- usage: ["unm[ap] {lhs}"],
- shortHelp: "Remove the mapping of {lhs}",
- help: ""
+ shortHelp: "Remove the mapping of {lhs}"
}
));
commandManager.add(new vimperator.Command(["cunm[ap]"],
@@ -2666,9 +2403,7 @@ vimperator.Commands = function () //{{{
vimperator.echoerr("E31: No such mapping");
},
{
- usage: ["cunm[ap] {lhs}"],
- shortHelp: "Remove the mapping of {lhs} (in command-line mode)",
- help: ""
+ shortHelp: "Remove the mapping of {lhs} (in command-line mode)"
}
));
commandManager.add(new vimperator.Command(["iunm[ap]"],
@@ -2697,9 +2432,7 @@ vimperator.Commands = function () //{{{
vimperator.echoerr("E31: No such mapping");
},
{
- usage: ["iunm[ap] {lhs}"],
- shortHelp: "Remove the mapping of {lhs} (in insert mode)",
- help: ""
+ shortHelp: "Remove the mapping of {lhs} (in insert mode)"
}
));
commandManager.add(new vimperator.Command(["ve[rsion]"],
@@ -2712,9 +2445,7 @@ vimperator.Commands = function () //{{{
"\nVimperator " + vimperator.version + " running on:\n" + navigator.userAgent);
},
{
- usage: ["ve[rsion][!]"],
- shortHelp: "Show version information",
- help: "You can show the Firefox version page with :version!."
+ shortHelp: "Show version information"
}
));
commandManager.add(new vimperator.Command(["vie[wsource]"],
@@ -2745,26 +2476,30 @@ vimperator.Commands = function () //{{{
}
},
{
- usage: ["vie[wsource][!] [url]"],
- shortHelp: "View source code of current document",
- help: "When ! is given, it is opened with the external editor."
+ shortHelp: "View source code of current document"
}
));
commandManager.add(new vimperator.Command(["viu[sage]"],
- function (args, special, count, modifiers) { vimperator.help("mappings", special, null, modifiers); },
+ function (args, special, count, modifiers)
+ {
+ var usage = "| " + + vimperator.util.escapeHTML(mapping.names[0]) + " | " + + vimperator.util.escapeHTML(mapping.shortHelp || "") + " |
:open but open URLs in a new window.:wq is different as in Vim, as it closes the window instead of just one tab by popular demand. Complain on the mailing list, if you want to change that."
- }
+ { shortHelp: "Save the session and quit" }
));
commandManager.add(new vimperator.Command(["zo[om]"],
function (args, special)
@@ -2827,11 +2555,7 @@ vimperator.Commands = function () //{{{
vimperator.buffer.textZoom = level;
},
{
- usage: ["zo[om][!] [value]", "zo[om][!] +{value} | -{value}"],
- shortHelp: "Set zoom value of current web page",
- help: "If {value} can be an absolute value between 1 and 2000% or a relative value if prefixed with - or +. " +
- "If {value} is omitted, zoom is reset to 100%.[!] it operates on full zoom."
+ shortHelp: "Set zoom value of current web page"
}
));
commandManager.add(new vimperator.Command(["!", "run"],
@@ -2850,12 +2574,7 @@ vimperator.Commands = function () //{{{
vimperator.echo(vimperator.util.escapeHTML(output));
},
{
- usage: ["!{cmd}"],
- shortHelp: "Run a command",
- help: "Runs {cmd} through system() and displays its output. " +
- "Any '!' in {cmd} is replaced with the previous external command. " +
- "But not when there is a backslash before the '!', then that backslash is removed.
First there was a Navigator, then there was an Explorer.\n' + - 'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)
'; - - var introduction = 'introductionVimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor. ' + - 'It has similar key bindings, and you could call it a modal web browser, as key bindings differ according to which mode you are in.
' + - - 'Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.
' +
- 'If you really need them, type: :set guioptions+=mT to get them back.\n' +
- 'If you don\'t like Vimperator at all, you can uninstall it by typing :addons and remove/disable it.\n' +
- 'If you like it, but can\'t remember the shortcuts, press F1 or :help to get this help window back.
Vimperator was written by Martin Stubenschrott. ' + - 'If you appreciate my work on Vimperator and want to encourage me working on it more, you can either send me greetings, patches or make a donation:
' + - - '' + - - 'Of course as a believer in free open source software, only make a donation if you really like Vimperator and the money doesn\'t hurt - otherwise just use it, recommend it and like it :)
'; - - var initialization = 'initializationAt startup Vimperator sources a user RC file, containing Ex commands, and any JavaScript files found in the plugin directory.
' + - 'The RC file may be named .vimperatorrc or _vimperatorrc. The search order is:
' + - 'The plugin directory is named:
' + - 'The user\'s $HOME(~) directory is determined as follows:
' + - 'mappingsThe denotion of modifier keys is like in Vim, so C- means the Control key, M- the Meta key, A- the Alt key and S- the Shift key.
' + - 'You found it, Arthur!
commandsWhat is the meaning of life, the universe and everything?
' +
- 'Douglas Adams, the only person who knew what this question really was about is
' +
- 'now dead, unfortunately. So now you might wonder what the meaning of death
' +
- 'is...
options:help <F1>."
+ shortHelp: "Open help window"
}
));
addDefaultMap(new vimperator.Map(allModes, ["v to start its Visual mode."
- }
+ { shortHelp: "Start caret mode" }
));
addDefaultMap(new vimperator.Map(allModes, ["<Esc> and pass them to the next event handler.<Esc>. If you also need to pass <Esc>" +
- "in this mode to the web page, prepend it with <C-v>."
- }
+ { shortHelp: "Temporarily quit Vimperator mode" }
));
addDefaultMap(new vimperator.Map(allModes, ["<C-v>.<C-o> which are otherwise hidden in Vimperator.<C-q>, <C-v> will pass the next key to Vimperator instead of the web page."
- }
+ { shortHelp: "Pass through next key" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], [":map <C-n> <Nop> will prevent <C-n> from doing anything."
- }
+ { shortHelp: "Do nothing" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["]f"],
function (count) { vimperator.buffer.shiftFrameFocus(count > 1 ? count : 1, true); },
{
shortHelp: "Focus next frame",
- help: "Transfers keyboard focus to the [count]th next frame in order. The newly focused frame is briefly colored red. Does not wrap.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -474,23 +421,20 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.shiftFrameFocus(count > 1 ? count : 1, false); },
{
shortHelp: "Focus previous frame",
- help: "Transfers keyboard focus to the [count]th previous frame in order. The newly focused frame is briefly colored red. Does not wrap.",
flags: vimperator.Mappings.flags.COUNT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["]]"],
function (count) { vimperator.buffer.followDocumentRelationship("next"); },
{
- shortHelp: "go to 'next' or '>' if it exists. Beep otherwise.",
- help: "Opens link labeled with next or >. Useful when browsing forums or documentation. Change nextpattern to modify its behaviour. It follows relations between files too.",
+ shortHelp: "Follow a link labeled to 'next' or '>' if it exists",
flags: vimperator.Mappings.flags.COUNT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["[["],
function (count) { vimperator.buffer.followDocumentRelationship("previous"); },
{
- shortHelp: "go to 'prev', 'previous' or '<' if it exists. Beep otherwise.",
- help: "Opens link labeled with prev, previous or <. Useful when browsing forums or documentation. Change nextpattern to modify its behaviour. It follows relations between files too.",
+ shortHelp: "Follow a link labeled to 'prev', 'previous' or '<' if it exists",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -502,40 +446,24 @@ vimperator.Mappings = function () //{{{
title = " -title=\"" + vimperator.buffer.title + "\"";
vimperator.commandline.open(":", "bmark " + vimperator.buffer.URL + title, vimperator.modes.EX);
},
- {
- shortHelp: "Open a prompt to bookmark the current URL",
- help: "Look at :bmark for more information."
- }
+ { shortHelp: "Open a prompt to bookmark the current URL" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["A"],
function () { vimperator.bookmarks.toggle(vimperator.buffer.URL); },
- {
- shortHelp: "Toggle bookmarked state of current URL",
- help: "Add/remove a bookmark for the current location, depending if it already is bookmarked or not. " +
- "In contrast to the :bmark command, the bookmark is just 'starred' " +
- "which means it is placed in the 'Unfiled Bookmarks Folder' instead of the bookmarks menu."
- }
+ { shortHelp: "Toggle bookmarked state of current URL" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["b"],
function () { vimperator.commandline.open(":", "buffer! ", vimperator.modes.EX); },
- {
- shortHelp: "Open a prompt to switch buffers",
- help: "Typing the corresponding number switches to this buffer."
- }
+ { shortHelp: "Open a prompt to switch buffers" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["B"],
function () { vimperator.buffer.list(true); },
- {
- shortHelp: "Toggle buffer list",
- help: "Toggles the display of the buffer list which shows all opened tabs.gb but in the other direction.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -551,8 +478,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count, false, 0); },
{
shortHelp: "Delete current buffer (=tab)",
- help: "Count is supported, 2d removes the current and next tab and the one to the right is selected. " +
- "Does not wrap if [count] is larger than available tabs to the right.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -560,40 +485,24 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.tabs.remove(getBrowser().mCurrentTab, count, true, 0); },
{
shortHelp: "Delete current buffer (=tab)",
- help: "Count is supported, 2D removes the current and previous tab and the one to the left is selected. " +
- "Does not wrap if [count] is larger than available tabs to the left.",
flags: vimperator.Mappings.flags.COUNT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["~"],
function () { vimperator.open("~"); },
- {
- shortHelp: "Open home directory",
- help: "You can also use the hints to create the probably fastest file browser on earth."
- }
+ { shortHelp: "Open home directory" }
));
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 internal editor in the current tab."
- }
+ { shortHelp: "View source" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gF"],
function () { vimperator.commands.viewsource(null, true); },
- {
- shortHelp: "View source with an external editor",
- help: "Opens the source code of the current website with the external editor specified " +
- "by the 'editor' option. For now the external editor " +
- "must be able to download and open files from a remote URL."
- }
+ { shortHelp: "View source with an external editor" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gh"],
BrowserHome,
- {
- shortHelp: "Go home",
- help: "Opens the homepage in the current tab."
- }
+ { shortHelp: "Go home" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gH"],
function ()
@@ -602,11 +511,7 @@ vimperator.Mappings = function () //{{{
vimperator.open(homepages, /\bhomepage\b/.test(vimperator.options["activate"]) ?
vimperator.NEW_TAB : vimperator.NEW_BACKGROUND_TAB);
},
- {
- shortHelp: "Go home in a new tab",
- help: "Opens the homepage in a new tab. " +
- "Whether the new tab is activated or not depends on the 'activate' option.M{a-zA-Z0-9}. " +
- "These QuickMarks are persistent across browser sessions.",
flags: vimperator.Mappings.flags.ARGUMENT
}
));
@@ -647,10 +547,6 @@ vimperator.Mappings = function () //{{{
},
{
shortHelp: "Jump to a QuickMark in a new tab",
- usage: ["gn{a-zA-Z0-9}"],
- help: "Works like go{a-zA-Z0-9} but opens the QuickMark in a new tab. " +
- "Whether the new tab is activated or not depends on the 'activate' option.gt would make more sense but is already taken.",
flags: vimperator.Mappings.flags.ARGUMENT
}
));
@@ -661,10 +557,7 @@ vimperator.Mappings = function () //{{{
/\bpaste\b/.test(vimperator.options["activate"]) ?
vimperator.NEW_BACKGROUND_TAB : vimperator.NEW_TAB);
},
- {
- shortHelp: "Open (put) a URL based on the current clipboard contents in a new buffer",
- help: "Works like P, but inverts the 'activate' option."
- }
+ { shortHelp: "Open (put) a URL based on the current clipboard contents in a new buffer" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["g0", "g^"],
function (count) { vimperator.tabs.select(0); },
@@ -678,7 +571,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.tabs.select(count > 0 ? count - 1: "+1", count > 0 ? false : true); },
{
shortHelp: "Go to the next tab",
- help: "Cycles to the first tab, when the last is selected.3gt goes to the third tab.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -686,7 +578,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.tabs.select("-" + (count < 1 ? 1 : count), true); },
{
shortHelp: "Go {count} pages back",
- help: "Wraps around from the first tab to the last tab.3gT goes three tabs back.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -711,11 +602,7 @@ vimperator.Mappings = function () //{{{
else
vimperator.tabs.select(index);
},
- {
- shortHelp: "Select the alternate tab",
- usage: ["go{a-zA-Z0-9} or in a new tab with gn{a-zA-Z0-9}. " +
- "These QuickMarks are persistent across browser sessions.",
flags: vimperator.Mappings.flags.ARGUMENT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["o"],
function () { vimperator.commandline.open(":", "open ", vimperator.modes.EX); },
- {
- shortHelp: "Open one or more URLs in the current tab",
- help: "See :open for more details."
- }
+ { shortHelp: "Open one or more URLs in the current tab" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["O"],
function () { vimperator.commandline.open(":", "open " + vimperator.buffer.URL, vimperator.modes.EX); },
- {
- shortHelp: "Open one or more URLs in the current tab, based on current location",
- help: "Works like o, but preselects current URL in the :open query."
- }
+ { shortHelp: "Open one or more URLs in the current tab, based on current location" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["p", "'defsearch' option) with p."
- }
+ { shortHelp: "Open (put) a URL based on the current clipboard contents in the current buffer" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["P"],
function ()
@@ -791,63 +662,41 @@ vimperator.Mappings = function () //{{{
/\bpaste\b/.test(vimperator.options["activate"]) ?
vimperator.NEW_TAB : vimperator.NEW_BACKGROUND_TAB);
},
- {
- shortHelp: "Open (put) a URL based on the current clipboard contents in a new buffer",
- help: "Works like p, but opens a new tab.'activate' option."
- }
+ { shortHelp: "Open (put) a URL based on the current clipboard contents in a new buffer" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], [":redraw.",
flags: vimperator.Mappings.flags.COUNT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["r"],
function () { vimperator.tabs.reload(getBrowser().mCurrentTab, false); },
- {
- shortHelp: "Reload",
- help: "Forces reloading of the current page."
- }
+ { shortHelp: "Reload current page" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["R"],
function () { vimperator.tabs.reload(getBrowser().mCurrentTab, true); },
- {
- shortHelp: "Reload while skipping the cache",
- help: "Forces reloading of the current page skipping the cache."
- }
+ { shortHelp: "Reload while skipping the cache" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["t"],
function () { vimperator.commandline.open(":", "tabopen ", vimperator.modes.EX); },
- {
- shortHelp: "Open one or more URLs in a new tab",
- help: "Like o but open URLs in a new tab.:tabopen for more details."
- }
+ { shortHelp: "Open one or more URLs in a new tab" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["T"],
function () { vimperator.commandline.open(":", "tabopen " + vimperator.buffer.URL, vimperator.modes.EX); },
- {
- shortHelp: "Open one or more URLs in a new tab, based on current location",
- help: "Works like t, but preselects current URL in the :tabopen query."
- }
+ { shortHelp: "Open one or more URLs in a new tab, based on current location" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["u"],
function (count) { vimperator.commands.undo("", false, count); },
{
shortHelp: "Undo closing of a tab",
- help: "If a count is given, don't close the last but the [count]th last tab.",
flags: vimperator.Mappings.flags.COUNT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["y"],
function () { vimperator.copyToClipboard(vimperator.buffer.URL, true); },
- {
- shortHelp: "Yank current location to the clipboard",
- help: "When running in X11 the location is also put into the selection, which can be pasted with the middle mouse button."
- }
+ { shortHelp: "Yank current location to the clipboard" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL, vimperator.modes.VISUAL], ["Y"],
function ()
@@ -858,17 +707,13 @@ vimperator.Mappings = function () //{{{
else
vimperator.beep();
},
- {
- shortHelp: "Copy selected text",
- help: "The currently selected text is copied to the system clipboard."
- }
+ { shortHelp: "Copy selected text" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["zi", "+"],
function (count) { vimperator.buffer.zoomIn(count > 1 ? count : 1, false); },
{
shortHelp: "Enlarge text zoom of current web page",
- help: "Mnemonic: zoom in",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -876,7 +721,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.zoomIn((count > 1 ? count : 1) * 3, false); },
{
shortHelp: "Enlarge text zoom of current web page by a larger amount",
- help: "Mnemonic: zoom more",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -884,7 +728,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.zoomOut(count > 1 ? count : 1, false); },
{
shortHelp: "Reduce text zoom of current web page",
- help: "Mnemonic: zoom out",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -892,7 +735,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.zoomOut((count > 1 ? count : 1) * 3, false); },
{
shortHelp: "Reduce text zoom of current web page by a larger amount",
- help: "Mnemonic: zoom reduce",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -900,7 +742,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.textZoom = count > 1 ? count : 100; },
{
shortHelp: "Set text zoom value of current web page",
- help: "Zoom value can be between 1 and 2000%. If it is omitted, text zoom is reset to 100%.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -908,7 +749,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.zoomIn(count > 1 ? count : 1, true); },
{
shortHelp: "Enlarge full zoom of current web page",
- help: "Mnemonic: zoom in",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -916,7 +756,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.zoomIn((count > 1 ? count : 1) * 3, true); },
{
shortHelp: "Enlarge full zoom of current web page by a larger amount",
- help: "Mnemonic: zoom more",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -924,7 +763,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.zoomOut(count > 1 ? count : 1, true); },
{
shortHelp: "Reduce full zoom of current web page",
- help: "Mnemonic: zoom out",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -932,7 +770,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.zoomOut((count > 1 ? count : 1) * 3, true); },
{
shortHelp: "Reduce full zoom of current web page by a larger amount",
- help: "Mnemonic: zoom reduce",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -940,25 +777,17 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.fullZoom = count > 1 ? count : 100; },
{
shortHelp: "Set full zoom value of current web page",
- help: "Zoom value can be between 1 and 2000%. If it is omitted, full zoom is reset to 100%.",
flags: vimperator.Mappings.flags.COUNT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["ZQ"],
function () { vimperator.quit(false); },
- {
- shortHelp: "Quit and don't save the session",
- help: "Works like :qall."
- }
+ { shortHelp: "Quit and don't save the session" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["ZZ"],
function () { vimperator.quit(true); },
- {
- shortHelp: "Quit and save the session",
- help: "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.:xall."
- }
+ { shortHelp: "Quit and save the session" }
));
function incrementURL(count)
{
@@ -986,7 +815,6 @@ vimperator.Mappings = function () //{{{
function (count) { incrementURL(-(count > 1 ? count : 1)); },
{
shortHelp: "Decrement last number in URL",
- help: "Decrements the last number in URL by 1, or by count if given.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -994,7 +822,6 @@ vimperator.Mappings = function () //{{{
function (count) { incrementURL(count > 1 ? count : 1); },
{
shortHelp: "Increment last number in URL",
- help: "Increments the last number in URL by 1, or by count if given.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1002,22 +829,16 @@ vimperator.Mappings = function () //{{{
// scrolling commands
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["0", "^"],
function () { vimperator.buffer.scrollStart(); },
- {
- shortHelp: "Scroll to the absolute left of the document",
- help: "Unlike in Vim, 0 and ^ work exactly the same way."
- }
+ { shortHelp: "Scroll to the absolute left of the document" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["$"],
function () { vimperator.buffer.scrollEnd(); },
- {
- shortHelp: "Scroll to the absolute right of the document"
- }
+ { shortHelp: "Scroll to the absolute right of the document" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["gg", "[count] like in 35gg, it scrolls to 35% of the document.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1025,7 +846,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollToPercentile(count >= 0 ? count : 100); },
{
shortHelp: "Goto the end of the document",
- help: "When used with [count] like in 35G, it scrolls to 35% of the document.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1033,8 +853,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollColumns(-(count > 1 ? count : 1)); },
{
shortHelp: "Scroll document to the left",
- help: "Count is supported: 10h will move 10 times as much to the left.'visualbell' is set).",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1042,8 +860,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollLines(count > 1 ? count : 1); },
{
shortHelp: "Scroll document down",
- help: "Count is supported: 10j will move 10 times as much down.'visualbell' is set).",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1051,8 +867,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollLines(-(count > 1 ? count : 1)); },
{
shortHelp: "Scroll document up",
- help: "Count is supported: 10k will move 10 times as much up.'visualbell' is set).",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1060,8 +874,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollByScrollSize(count, 1); },
{
shortHelp: "Scroll window downwards in the buffer",
- help: "The number of lines is set by the 'scroll' option which defaults to half a page. " +
- "If [count] is given 'scroll' is first set to this value.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1069,8 +881,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollByScrollSize(count, -1); },
{
shortHelp: "Scroll window upwards in the buffer",
- help: "The number of lines is set by the 'scroll' option which defaults to half a page. " +
- "If [count] is given 'scroll' is first set to this value.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1078,8 +888,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollColumns(count > 1 ? count : 1); },
{
shortHelp: "Scroll document to the right",
- help: "Count is supported: 10l will move 10 times as much to the right.'visualbell' is set).",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1087,7 +895,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollPages(-(count > 1 ? count : 1)); },
{
shortHelp: "Scroll up a full page",
- help: "Scroll window [count] pages Backwards (upwards) in the buffer.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1095,7 +902,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.scrollPages(count > 1 ? count : 1); },
{
shortHelp: "Scroll down a full page",
- help: "Scroll window [count] pages Forwards (downwards) in the buffer.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1105,17 +911,12 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.buffer.showPageInfo(false); },
{
shortHelp: "Print the current file name",
- help: "Also shows some additional file information like file size or the last modified date. " +
- "If {count} is given print the current file name with full path.",
flags: vimperator.Mappings.flags.COUNT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["g:pa[geinfo]."
- }
+ { shortHelp: "Print file information" }
));
@@ -1124,7 +925,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.history.stepTo(-(count > 1 ? count : 1)); },
{
shortHelp: "Go to an older position in the jump list",
- help: "The jump list is just the browser history for now.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1132,7 +932,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.history.stepTo(count > 1 ? count : 1); },
{
shortHelp: "Go to a newer position in the jump list",
- help: "The jump list is just the browser history for now.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1140,7 +939,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.history.stepTo(-(count > 1 ? count : 1)); },
{
shortHelp: "Go back in the browser history",
- help: "Count is supported: 3H goes back 3 steps.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1148,7 +946,6 @@ vimperator.Mappings = function () //{{{
function (count) { vimperator.history.stepTo(count > 1 ? count : 1); },
{
shortHelp: "Go forward in the browser history",
- help: "Count is supported: 3L goes forward 3 steps.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1193,7 +990,6 @@ vimperator.Mappings = function () //{{{
},
{
shortHelp: "Go to parent directory",
- help: "Count is supported: 2gu on http://www.example.com/dir1/dir2/file.htm would open http://www.example.com/dir1/.",
flags: vimperator.Mappings.flags.COUNT
}
));
@@ -1208,44 +1004,18 @@ vimperator.Mappings = function () //{{{
}
vimperator.open(uri.protocol + "//" + (uri.host || "") + "/");
},
- {
- shortHelp: "Go to the root of the website",
- help: "gU on http://www.example.com/dir1/dir2/file.htm opens http://www.example.com/.'hinttags' XPath query) is assigned a unique number.<Esc> stops this mode at any time."
- }
+ { shortHelp: "Start QuickHint mode" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["F"],
function () { vimperator.hints.show(vimperator.modes.QUICK_HINT, "t"); },
- {
- shortHelp: "Start QuickHint mode, but open link in a new tab",
- usage: ["F{hint}"],
- help: "Like normal QuickHint mode (activated with f) but opens the link in a new tab."
- }
+ { shortHelp: "Start QuickHint mode, but open link in a new tab" }
));
-// addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["F"],
-// function () { vimperator.echo("Always HINT mode not available anymore"); },
-// {
-// shortHelp: "Start AlwaysHint mode (CURRENTLY DISABLED)",
-// help: "In AlwaysHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.<Esc> to stop this mode.Ctrl-prefixed shortcut keys are available in this mode for navigation."
-// }
-// ));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], [";"],
function (arg)
{
@@ -1258,33 +1028,6 @@ vimperator.Mappings = function () //{{{
},
{
shortHelp: "Start an extended hint mode",
- usage: [";{mode}{hint}"],
- help: "ExtendedHint mode is useful, since in this mode you can yank link locations, open them in a new window or save images.24, press ;y to start this hint mode. " +
- "Then press 24 to copy the hint location.{mode} can be either one of:; to focus a link and hover it with the mousea to save its destination (prompting for save location)s to save its destinationo to open its location in the current tabt to open its location in a new tabO to open its location in an :open queryT to open its location in a :tabopen queryv to view its destination sourcew to open its destination in a new windowW to open its location in a :winopen queryy to yank its destination locationY to yank its text description{mode}s, which will start an AlwaysHint mode:f to open its location in the current tabF to open its location in a new tabf or F mappings but will keep you in AlwaysHint mode. " +
- "This is useful if you want to open many links of one page without pressing f or F each time.'extendedhinttags' XPath string.",
flags: vimperator.Mappings.flags.ARGUMENT
}
));
@@ -1292,50 +1035,24 @@ vimperator.Mappings = function () //{{{
// search management
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["/"],
function () { vimperator.search.openSearchDialog(vimperator.modes.SEARCH_FORWARD); },
- {
- shortHelp: "Search forward for a pattern",
- usage: ["/{pattern}[/]{pattern}.'ignorecase' is on. " +
- "\"\\C\" forces case-sensitive matching for the whole pattern.'linksearch' is on. " +
- "\"\\L\" forces the entire page to be searched for a match."
- }
+ { shortHelp: "Search forward for a pattern" }
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["?"],
function () { vimperator.search.openSearchDialog(vimperator.modes.SEARCH_BACKWARD); },
- {
- shortHelp: "Search backwards for a pattern",
- usage: ["?{pattern}[?]{pattern}.'ignorecase' is on. " +
- "\"\\C\" forces case-sensitive matching for the whole pattern.'linksearch' is on. " +
- "\"\\L\" forces the entire page to be searched for a match.| --- Options --- |
|---|
| '' | Complete only the first match |
| 'full' | Complete the next full match. After the last, the original string is used. |
| 'longest' | Complete till the longest common string. |
| 'list' | When more than one match, list all matches. |
| 'list:full' | When more than one match, list all matches and complete first match. |
| 'list:longest' | When more than one match, list all matches and complete till the longest common string. |
| sort | Always sorts completion list, overriding the 'complete' option. |