1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 18:07:58 +01:00

Add @: mapping.

This commit is contained in:
Doug Kearns
2009-05-22 12:47:57 +10:00
parent 72e13d9e9d
commit da89552a1e
6 changed files with 49 additions and 9 deletions

View File

@@ -462,6 +462,9 @@ function Commands() //{{{
return util.Array.itervalues(sorted); return util.Array.itervalues(sorted);
}, },
/** @property {string} The last executed Ex command line. */
repeat: null,
/** /**
* Adds a new default command. * Adds a new default command.
* *
@@ -957,6 +960,27 @@ function Commands() //{{{
} }
}; };
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// MAPPINGS ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_mappings", function ()
{
mappings.add([m for ([,m] in Iterator(modes.all)) if (m != modes.INSERT)],
["@:"], "Repeat the last Ex command",
function (count)
{
if (commands.repeat)
{
for (let i in util.interruptibleRange(0, Math.max(count, 1), 100))
liberator.execute(commands.repeat);
}
else
liberator.echoerr("E30: No previous command line");
},
{ flags: Mappings.flags.COUNT });
});
/////////////////////////////////////////////////////////////////////////////}}} /////////////////////////////////////////////////////////////////////////////}}}
////////////////////// COMMANDS //////////////////////////////////////////////// ////////////////////// COMMANDS ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////////////{{{

View File

@@ -896,6 +896,7 @@ const liberator = (function () //{{{
return void liberator.echoerr(err); return void liberator.echoerr(err);
if (!silent) if (!silent)
commandline.command = str.replace(/^\s*:\s*/, ""); commandline.command = str.replace(/^\s*:\s*/, "");
command.execute(args, special, count, modifiers); command.execute(args, special, count, modifiers);
}, },

View File

@@ -525,6 +525,7 @@ function CommandLine() //{{{
var input = {}; var input = {};
liberator.registerCallback("submit", modes.EX, function (command) { liberator.registerCallback("submit", modes.EX, function (command) {
commands.repeat = command;
liberator.execute(command); liberator.execute(command);
}); });
liberator.registerCallback("complete", modes.EX, function (context) { liberator.registerCallback("complete", modes.EX, function (context) {

View File

@@ -1,3 +1,7 @@
2009-XX-XX:
* version 2.2a1pre
* add @: mapping
2009-05-21: 2009-05-21:
* version 2.1 * version 2.1
* IMPORTANT: Default value of 'complete' has been changed from 'sfl' to 'slf' * IMPORTANT: Default value of 'complete' has been changed from 'sfl' to 'slf'

View File

@@ -90,6 +90,7 @@ section:Normal{nbsp}mode[normal-index]
||[m]@[m]|| Play a macro + ||[m]@[m]|| Play a macro +
||[m].[m]|| Repeat the last keyboard command + ||[m].[m]|| Repeat the last keyboard command +
||[m]@:[m]|| Repeat the last Ex command [count] times +
||[m]]f[m]|| Focus next frame + ||[m]]f[m]|| Focus next frame +
||[m][f[m]|| Focus previous frame + ||[m][f[m]|| Focus previous frame +

View File

@@ -4,6 +4,24 @@ HEADER
Vimperator can repeat a number of commands and record macros. Vimperator can repeat a number of commands and record macros.
section:Single{nbsp}repates[single-repeat]
|.|
||[count].||
____________________________________________________________________________
Repeat the last keyboard mapping [count] times. Note that, unlike in Vim, this
does not apply solely to editing commands, mainly because Vimperator doesn't
have them.
____________________________________________________________________________
|@:|
||[count]@:||
____________________________________________________________________________
Repeat the last Ex command [count] times.
____________________________________________________________________________
section:Macros[macros,complex-repeat] section:Macros[macros,complex-repeat]
|q| |q|
@@ -48,15 +66,6 @@ Replay the last executed macro [count] times.
____________________________________________________________________________ ____________________________________________________________________________
|.|
||[count].||
____________________________________________________________________________
Repeat the last keyboard mapping [count] times. Note that, unlike in Vim, this
does not apply solely to editing commands, mainly because Vimperator doesn't
have them.
____________________________________________________________________________
section:Using{nbsp}scripts[using-scripts] section:Using{nbsp}scripts[using-scripts]
|:so| |:source| |:so| |:source|