1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 22:08:00 +01:00

new ctrl-g and g,ctrl-g commands

This commit is contained in:
Martin Stubenschrott
2007-10-27 14:38:52 +00:00
parent 961a1bdad3
commit c01abea9e7
3 changed files with 24 additions and 5 deletions

1
NEWS
View File

@@ -8,6 +8,7 @@
~/.vimperatorrc file instead for persistent options ~/.vimperatorrc file instead for persistent options
* IMPORTANT! Major hints rewrite * IMPORTANT! Major hints rewrite
read up the new help for the f, F and ; commands for details read up the new help for the f, F and ; commands for details
* new :pa[geinfo] command, and ctrl-g and g,ctrl-g mappgins (thanks Marco Candrian)
* added new :mkvimperatorrc command * added new :mkvimperatorrc command
* you can edit textfields with Ctrl-i now using an external editor (thanks to Joseph Xu) * you can edit textfields with Ctrl-i now using an external editor (thanks to Joseph Xu)
* :open, :bmarks, etc. filter on space separated tokens now, so you can * :open, :bmarks, etc. filter on space separated tokens now, so you can

View File

@@ -531,7 +531,7 @@ vimperator.Buffer = function() //{{{
var lastmod = window.content.document.lastModified.slice(0, -3); var lastmod = window.content.document.lastModified.slice(0, -3);
var pageInfoText = '"' + file + '" (' + pageSize + ", " + lastmod + ") " + title; var pageInfoText = '"' + file + '" [' + pageSize + ", " + lastmod + "] " + title;
vimperator.echo(pageInfoText, vimperator.commandline.FORCE_SINGLELINE); vimperator.echo(pageInfoText, vimperator.commandline.FORCE_SINGLELINE);
return; return;
@@ -548,13 +548,12 @@ vimperator.Buffer = function() //{{{
pageGeneral.push(["Mime-Type", window.content.document.contentType]); pageGeneral.push(["Mime-Type", window.content.document.contentType]);
pageGeneral.push(["Encoding", window.content.document.characterSet]); pageGeneral.push(["Encoding", window.content.document.characterSet]);
if (cacheEntryDescriptor)
{
if (cacheEntryDescriptor) {
var pageSize = cacheEntryDescriptor.dataSize; var pageSize = cacheEntryDescriptor.dataSize;
var bytes = pageSize + ''; var bytes = pageSize + '';
for (var u = bytes.length - 3; u > 0; u -= 3) // make a 1400 -> 1'400 for (var u = bytes.length - 3; u > 0; u -= 3) // make a 1400 -> 1'400
bytes = bytes.slice(0, u) + "'" + bytes.slice(u, bytes.length); bytes = bytes.slice(0, u) + "," + bytes.slice(u, bytes.length);
pageGeneral.push(["File Size", (Math.round(pageSize / 1024 * 100) / 100) + "KB (" + bytes + " bytes)"]); pageGeneral.push(["File Size", (Math.round(pageSize / 1024 * 100) / 100) + "KB (" + bytes + " bytes)"]);
} }

View File

@@ -937,6 +937,25 @@ vimperator.Mappings = function() //{{{
} }
)); ));
// page info
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["<C-g>"],
function(count) { vimperator.buffer.pageInfo(false); },
{
short_help: "Print the current file name",
help: "Also shows some additional file information like file size or the last modified date. " +
"If <code class='argument'>{count}</code> is given print the current file name with full path.",
flags: vimperator.Mappings.flags.COUNT
}
));
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["g<C-g>"],
function(count) { vimperator.buffer.pageInfo(true); },
{
short_help: "Print file information",
help: "Same as <code class='command'>:pa[geinfo]</code>."
}
));
// history manipulation and jumplist // history manipulation and jumplist
addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["<C-o>"], addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["<C-o>"],
function(count) { vimperator.history.stepTo(-(count > 1 ? count : 1)); }, function(count) { vimperator.history.stepTo(-(count > 1 ? count : 1)); },