mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 22:42:26 +01:00
slightly updated tutorial
This commit is contained in:
@@ -289,36 +289,6 @@ liberator.Completion = function () //{{{
|
|||||||
return [0, buildLongestStartingSubstring(mapped, filter)];
|
return [0, buildLongestStartingSubstring(mapped, filter)];
|
||||||
},
|
},
|
||||||
|
|
||||||
help: function (filter)
|
|
||||||
{
|
|
||||||
var res = [];
|
|
||||||
// they are sorted by relevance, not alphabetically
|
|
||||||
var files = ["intro.html", "starting.html", "browsing.html", "buffer.html",
|
|
||||||
"options.html", "tabs.html", "marks.html", "repeat.html",
|
|
||||||
"autocommands.html", "developer.html", "various.html"];
|
|
||||||
|
|
||||||
for (var file in files)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var xmlhttp = new XMLHttpRequest();
|
|
||||||
xmlhttp.open("GET", "chrome://" + liberator.config.name.toLowerCase() + "/locale/" + files[file], false);
|
|
||||||
xmlhttp.send(null);
|
|
||||||
}
|
|
||||||
catch (e)
|
|
||||||
{
|
|
||||||
liberator.log("Error opening chrome://" + liberator.config.name.toLowerCase() + "/locale/" + files[file], 1);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var doc = xmlhttp.responseXML;
|
|
||||||
var elems = doc.getElementsByClassName("tag");
|
|
||||||
for (var i = 0; i < elems.length; i++)
|
|
||||||
res.push([elems[i].textContent, files[file]]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return [0, this.filter(res, filter)];
|
|
||||||
},
|
|
||||||
|
|
||||||
command: function (filter)
|
command: function (filter)
|
||||||
{
|
{
|
||||||
var completions = [];
|
var completions = [];
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ const liberator = (function () //{{{
|
|||||||
"Display help",
|
"Display help",
|
||||||
function (args) { liberator.help(args); },
|
function (args) { liberator.help(args); },
|
||||||
{
|
{
|
||||||
completer: function (filter) { return liberator.completion.help(filter); }
|
completer: function (filter) { return getHelpCompletions(filter); }
|
||||||
});
|
});
|
||||||
|
|
||||||
liberator.commands.add(["javas[cript]", "js"],
|
liberator.commands.add(["javas[cript]", "js"],
|
||||||
@@ -390,6 +390,36 @@ const liberator = (function () //{{{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getHelpCompletions(filter)
|
||||||
|
{
|
||||||
|
var res = [];
|
||||||
|
// they are sorted by relevance, not alphabetically
|
||||||
|
var files = ["intro.html", "tutorial.html", "starting.html", "browsing.html", "buffer.html",
|
||||||
|
"options.html", "tabs.html", "marks.html", "repeat.html",
|
||||||
|
"autocommands.html", "developer.html", "various.html"];
|
||||||
|
|
||||||
|
for (var file in files)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var xmlhttp = new XMLHttpRequest();
|
||||||
|
xmlhttp.open("GET", "chrome://" + liberator.config.name.toLowerCase() + "/locale/" + files[file], false);
|
||||||
|
xmlhttp.send(null);
|
||||||
|
}
|
||||||
|
catch (e)
|
||||||
|
{
|
||||||
|
liberator.log("Error opening chrome://" + liberator.config.name.toLowerCase() + "/locale/" + files[file], 1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var doc = xmlhttp.responseXML;
|
||||||
|
var elems = doc.getElementsByClassName("tag");
|
||||||
|
for (var i = 0; i < elems.length; i++)
|
||||||
|
res.push([elems[i].textContent, files[file]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [0, liberator.completion.filter(res, filter)];
|
||||||
|
}
|
||||||
|
|
||||||
// initially hide all GUI, it is later restored unless the user has :set go= or something
|
// initially hide all GUI, it is later restored unless the user has :set go= or something
|
||||||
// similar in his config
|
// similar in his config
|
||||||
function hideGUI()
|
function hideGUI()
|
||||||
@@ -636,6 +666,7 @@ const liberator = (function () //{{{
|
|||||||
function jumpToTag(file, tag)
|
function jumpToTag(file, tag)
|
||||||
{
|
{
|
||||||
liberator.open("chrome://" + liberator.config.name.toLowerCase() + "/locale/" + file, where);
|
liberator.open("chrome://" + liberator.config.name.toLowerCase() + "/locale/" + file, where);
|
||||||
|
// TODO: it would be better wo wait for pageLoad
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
var elem = liberator.buffer.getElement('@class="tag" and text()="' + tag + '"');
|
var elem = liberator.buffer.getElement('@class="tag" and text()="' + tag + '"');
|
||||||
if (elem)
|
if (elem)
|
||||||
@@ -651,7 +682,7 @@ const liberator = (function () //{{{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var [, items] = liberator.completion.help(topic);
|
var [, items] = getHelpCompletions(topic);
|
||||||
var partialMatch = -1;
|
var partialMatch = -1;
|
||||||
for (var i = 0; i < items.length; i++)
|
for (var i = 0; i < items.length; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,16 +18,14 @@ Add {cmd} to the list of commands Vimperator will execute on {event}:
|
|||||||
* [c]:autocmd[!][c] * {pat}: list/remove autocommands matching {pat}
|
* [c]:autocmd[!][c] * {pat}: list/remove autocommands matching {pat}
|
||||||
* [c]:autocmd[!][c]: list/remove all autocommands
|
* [c]:autocmd[!][c]: list/remove all autocommands
|
||||||
|
|
||||||
|
Available {events}:
|
||||||
|
|
||||||
|
* Startup
|
||||||
|
* Quit
|
||||||
|
* PageLoad
|
||||||
|
|
||||||
|
{pat} is a regular expression, use .* if you want to match all events.
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
____
|
|
||||||
Available events:
|
|
||||||
|
|
||||||
* BrowserExit
|
|
||||||
* BrowserRestart
|
|
||||||
* PageLoad
|
|
||||||
|
|
||||||
____
|
|
||||||
|
|
||||||
// vim: set syntax=asciidoc:
|
// vim: set syntax=asciidoc:
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ how Vimperator challenges this preconception.
|
|||||||
|
|
||||||
section:Scrolling[keyboard_scrolling]
|
section:Scrolling[keyboard_scrolling]
|
||||||
|
|
||||||
____
|
|
||||||
Scrolling the browser window is done with simple keystrokes:
|
Scrolling the browser window is done with simple keystrokes:
|
||||||
|
|
||||||
* [m]j[m]/[m]k[m] --
|
* [m]j[m]/[m]k[m] --
|
||||||
@@ -94,12 +93,10 @@ Scrolling the browser window is done with simple keystrokes:
|
|||||||
|
|
||||||
Your standard buttons ([m]<Up>[m]/[m]<Down>[m]/[m]<PgUp>[m]/[m]<PgDn>[m]) will
|
Your standard buttons ([m]<Up>[m]/[m]<Down>[m]/[m]<PgUp>[m]/[m]<PgDn>[m]) will
|
||||||
also work as expected.
|
also work as expected.
|
||||||
____
|
|
||||||
|
|
||||||
|
|
||||||
section:History{nbsp}and{nbsp}Tabs[history_navigation,tab_navigation]
|
section:History{nbsp}and{nbsp}Tabs[history_navigation,tab_navigation]
|
||||||
|
|
||||||
____
|
|
||||||
History navigation (e.g., ``Back'', ``Forward'') are done similarly to
|
History navigation (e.g., ``Back'', ``Forward'') are done similarly to
|
||||||
scrolling.
|
scrolling.
|
||||||
|
|
||||||
@@ -127,12 +124,10 @@ following pairs sequences are equivalent:
|
|||||||
:tabopen vimperator.mozdev.org<cr>
|
:tabopen vimperator.mozdev.org<cr>
|
||||||
tvimperator.mozdev.org<cr>
|
tvimperator.mozdev.org<cr>
|
||||||
|
|
||||||
____
|
|
||||||
|
|
||||||
|
|
||||||
section:Common{nbsp}Issues[common_issues]
|
section:Common{nbsp}Issues[common_issues]
|
||||||
|
|
||||||
____
|
|
||||||
Say you get half-way down typing in a new URL, only to remember that you've
|
Say you get half-way down typing in a new URL, only to remember that you've
|
||||||
already got that page open in the previous tab. Your command-line might look
|
already got that page open in the previous tab. Your command-line might look
|
||||||
something like this:
|
something like this:
|
||||||
@@ -144,12 +139,10 @@ following:
|
|||||||
|
|
||||||
<Esc>gT
|
<Esc>gT
|
||||||
|
|
||||||
____
|
|
||||||
|
|
||||||
|
|
||||||
section:Find{nbsp}the{nbsp}Exit{nbsp}Nearest{nbsp}You[quitting_without_menus]
|
section:Find{nbsp}the{nbsp}Exit{nbsp}Nearest{nbsp}You[quitting_without_menus]
|
||||||
|
|
||||||
____
|
|
||||||
Vimperator supports all of Vim's classing methods of exitting.
|
Vimperator supports all of Vim's classing methods of exitting.
|
||||||
|
|
||||||
* [c]:xall[c] -- command to quit and save the current browsing
|
* [c]:xall[c] -- command to quit and save the current browsing
|
||||||
@@ -158,12 +151,10 @@ Vimperator supports all of Vim's classing methods of exitting.
|
|||||||
* [m]ZZ[m] -- normal mode mapping equivalent to [c]:xall[c]
|
* [m]ZZ[m] -- normal mode mapping equivalent to [c]:xall[c]
|
||||||
* [m]ZQ[m] -- normal mode mapping equivalent to [c]:qall[c]
|
* [m]ZQ[m] -- normal mode mapping equivalent to [c]:qall[c]
|
||||||
|
|
||||||
____
|
|
||||||
|
|
||||||
|
|
||||||
section:Where{nbsp}did{nbsp}Firefox{nbsp}go?[whither_firefox]
|
section:Where{nbsp}did{nbsp}Firefox{nbsp}go?[whither_firefox]
|
||||||
|
|
||||||
____
|
|
||||||
You might feel pretty disoriented now. Don't worry. This is still Firefox
|
You might feel pretty disoriented now. Don't worry. This is still Firefox
|
||||||
underneath. Here are some ways Vimperator allows Firefox to shine through.
|
underneath. Here are some ways Vimperator allows Firefox to shine through.
|
||||||
See the [c]:help[c] for these commands and mappings for more information on
|
See the [c]:help[c] for these commands and mappings for more information on
|
||||||
@@ -183,8 +174,6 @@ how to make the best use of them.
|
|||||||
Finally, in addition to the help system itself, [c]:exusage[c] and
|
Finally, in addition to the help system itself, [c]:exusage[c] and
|
||||||
[c]:viusage[c] are useful quick-reference commands.
|
[c]:viusage[c] are useful quick-reference commands.
|
||||||
|
|
||||||
____
|
|
||||||
|
|
||||||
|
|
||||||
Feel free to explore at this point. If you use the [c]:tabopen[c] command,
|
Feel free to explore at this point. If you use the [c]:tabopen[c] command,
|
||||||
remember to use the [m]gt[m]/[m]gT[m] mappings to get back to this page. If
|
remember to use the [m]gt[m]/[m]gT[m] mappings to get back to this page. If
|
||||||
@@ -198,7 +187,7 @@ If you get hopelessly lost, just type [c]:help<cr>[c] and click the
|
|||||||
|
|
||||||
section:Get{nbsp}me{nbsp}out{nbsp}of{nbsp}here![removal]
|
section:Get{nbsp}me{nbsp}out{nbsp}of{nbsp}here![removal]
|
||||||
|
|
||||||
If you've given it a fair shot and determined
|
If you've given it a fair shot and determined ... TODO
|
||||||
|
|
||||||
The Vimperator way to do this is with the command [c]:addons[c]. Issuing this
|
The Vimperator way to do this is with the command [c]:addons[c]. Issuing this
|
||||||
command brings up the Firefox Add-ons dialog window; you can then remove it as
|
command brings up the Firefox Add-ons dialog window; you can then remove it as
|
||||||
@@ -223,5 +212,4 @@ we are neither infinite nor omnipotent; please bear with us. If you can't
|
|||||||
wait for us to get around to it, rest assured patches are welcome! See
|
wait for us to get around to it, rest assured patches are welcome! See
|
||||||
the help:Developer[developer.html] page for more information.
|
the help:Developer[developer.html] page for more information.
|
||||||
|
|
||||||
|
|
||||||
// vim: set syntax=asciidoc:
|
// vim: set syntax=asciidoc:
|
||||||
|
|||||||
Reference in New Issue
Block a user