diff --git a/NEWS b/NEWS index 8556ce33..b43f5766 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ ~/.vimperatorrc file instead for persistent options * IMPORTANT! Major hints rewrite 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 * 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 diff --git a/content/buffers.js b/content/buffers.js index 92517573..95a78da0 100644 --- a/content/buffers.js +++ b/content/buffers.js @@ -531,7 +531,7 @@ vimperator.Buffer = function() //{{{ 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); return; @@ -548,13 +548,12 @@ vimperator.Buffer = function() //{{{ pageGeneral.push(["Mime-Type", window.content.document.contentType]); pageGeneral.push(["Encoding", window.content.document.characterSet]); - - - if (cacheEntryDescriptor) { + if (cacheEntryDescriptor) + { var pageSize = cacheEntryDescriptor.dataSize; var bytes = pageSize + ''; 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)"]); } diff --git a/content/mappings.js b/content/mappings.js index 8c1d085d..868a211a 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -937,6 +937,25 @@ vimperator.Mappings = function() //{{{ } )); + // page info + addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], [""], + 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 {count} is given print the current file name with full path.", + flags: vimperator.Mappings.flags.COUNT + } + )); + addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["g"], + function(count) { vimperator.buffer.pageInfo(true); }, + { + short_help: "Print file information", + help: "Same as :pa[geinfo]." + } + )); + + // history manipulation and jumplist addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], [""], function(count) { vimperator.history.stepTo(-(count > 1 ? count : 1)); },