diff --git a/NEWS b/NEWS index 4aa8882b..437c7476 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ special versions for the old behavior * IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and VimperatorLeave respectively + * add N% normal mode command * add interpolation for items such as to autocommands * add -nargs, -bang, and -count attribute support to :command * much improved completion support, including javascript, option, and search keyword diff --git a/content/buffer.js b/content/buffer.js index 3f2ee3e6..bcef0fbf 100644 --- a/content/buffer.js +++ b/content/buffer.js @@ -517,15 +517,26 @@ liberator.Buffer = function () //{{{ function () { liberator.buffer.scrollEnd(); }); liberator.mappings.add(modes, ["gg", ""], - "Goto the top of the document", + "Go to the top of the document", function (count) { liberator.buffer.scrollToPercentile(count > 0 ? count : 0); }, { flags: liberator.Mappings.flags.COUNT }); liberator.mappings.add(modes, ["G", ""], - "Goto the end of the document", + "Go to the end of the document", function (count) { liberator.buffer.scrollToPercentile(count >= 0 ? count : 100); }, { flags: liberator.Mappings.flags.COUNT }); + liberator.mappings.add(modes, ["%"], + "Scroll to {count} percent of the document", + function (count) + { + if (count > 0 && count <= 100) + liberator.buffer.scrollToPercentile(count); + else + liberator.beep(); + }, + { flags: liberator.Mappings.flags.COUNT }); + liberator.mappings.add(modes, [""], "Scroll window downwards in the buffer", function (count) { liberator.buffer.scrollByScrollSize(count, 1); }, diff --git a/locale/en-US/buffer.txt b/locale/en-US/buffer.txt index cc3d7b03..08b3f035 100644 --- a/locale/en-US/buffer.txt +++ b/locale/en-US/buffer.txt @@ -73,7 +73,7 @@ ________________________________________________________________________________ || |gg| + ||[count]gg|| ________________________________________________________________________________ -Goto the top of the document. When used with [count] like in [m]35gg[m], it +Go to the top of the document. When used with [count] like in [m]35gg[m], it scrolls to 35% of the document. ________________________________________________________________________________ @@ -81,11 +81,18 @@ ________________________________________________________________________________ || |G| + ||[count]G|| ________________________________________________________________________________ -Goto the end of the document. When used with [count] like in [m]35G[m], it +Go to the end of the document. When used with [count] like in [m]35G[m], it scrolls to 35% of the document. ________________________________________________________________________________ +|N%| + +||{count}%|| +________________________________________________________________________________ +Scroll to {count} percent of the document. +________________________________________________________________________________ + + || |h| + ||[count]h|| ________________________________________________________________________________ diff --git a/locale/en-US/index.txt b/locale/en-US/index.txt index 4e40f5d4..30f7a2bd 100644 --- a/locale/en-US/index.txt +++ b/locale/en-US/index.txt @@ -35,7 +35,7 @@ section:Normal{nbsp}mode[normal-index] ||B|| Show buffer list + ||D|| Delete current buffer, focus tab to the left + ||F|| Start QuickHint mode, but open link in a new tab + -||G|| Goto the end of the document + +||G|| Go to the end of the document + ||H|| Go back in the browser history + ||L|| Go forward in the browser history + ||M|| Add new QuickMark for current URL + @@ -76,6 +76,8 @@ section:Normal{nbsp}mode[normal-index] ||*|| Find word under cursor + ||#|| Find word under cursor backwards + +||N%|| Scroll to {count} percent of the document + + ||'|| Jump to the mark in the current buffer + ||@|| Play a macro + @@ -96,7 +98,7 @@ section:Normal{nbsp}mode[normal-index] ||gU|| Go to the root of the website + ||gb|| Repeat last :buffer[!] command + ||gf|| View source + -||gg|| Goto the top of the document + +||gg|| Go to the top of the document + ||gh|| Open homepage + ||gi|| Focus last used input field + ||gn|| Jump to a QuickMark in a new tab +