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

move g_hint_mappings to mappings.js

This commit is contained in:
Doug Kearns
2007-07-03 05:41:55 +00:00
parent 9f88317a14
commit 47392e4f75
2 changed files with 12 additions and 51 deletions

View File

@@ -26,46 +26,6 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
/* [command, action, cancel_hint_mode, always_active] */
var g_hint_mappings = [ //{{{
/* hint action keys */
["o", "vimperator.hints.openHints(false, false);", true, false],
["t", "vimperator.hints.openHints(true, false);", true, false],
["<C-w>", "vimperator.hints.openHints(false, true );", true, false],
["s", "vimperator.echoerr('Saving of links not yet implemented');", true, false],
["y", "vimperator.hints.yankUrlHints();", true, false],
["Y", "vimperator.hints.yankTextHints();", true, false],
[",", "g_inputbuffer+=','; vimperator.hints.setCurrentState(0);", false, true],
[":", "vimperator.commandline.open(':', '', vimperator.modes.EX);", false, true],
/* movement keys */
["<C-e>", "scrollBufferRelative(0, 1);", false, true],
["<C-y>", "scrollBufferRelative(0, -1);", false, true],
["<Home>", "scrollBufferAbsolute(-1, 0);", false, true],
["<End>", "scrollBufferAbsolute(-1, 100);", false, true],
["<C-b>", "goDoCommand('cmd_scrollPageUp');", false, true],
["<PageUp>", "goDoCommand('cmd_scrollPageUp');", false, true],
["<C-f>", "goDoCommand('cmd_scrollPageDown');", false, true],
["<PageDown>", "goDoCommand('cmd_scrollPageDown');", false, true],
["<Left>", "scrollBufferRelative(-1, 0);", false, true],
["<Down>", "scrollBufferRelative(0, 1);", false, true],
["<Up>", "scrollBufferRelative(0, -1);", false, true],
["<Right>", "scrollBufferRelative(1, 0);", false, true],
/* tab managment */
["<C-n>", "vimperator.tabs.select('+1', true)", true, true], // same as gt, but no count supported
["<C-p>", "vimperator.tabs.select('-1', true)", true, true],
/* navigation */
["<C-o>", "vimperator.history.stepTo(g_count > 0 ? -1 * g_count : -1);", false, true],
["<C-i>", "vimperator.history.stepTo(g_count > 0 ? g_count : 1);", false, true],
["<C-h>", "vimperator.history.stepTo(g_count > 0 ? -1 * g_count : -1);", false, true],
["<C-l>", "vimperator.history.stepTo(g_count > 0 ? g_count : 1);", false, true],
["<C-d>", "vimperator.tabs.remove(getBrowser().mCurrentTab, g_count, false, 0);", true, true],
/* cancel hint mode keys */
["<C-c>", "", true, true],
["<C-g>", "", true, true],
["<C-[>", "", true, true],
["<Esc>", "", true, true]
]; //}}}
function Command(specs, action, extra_info) //{{{
{
if (!specs || !action)

View File

@@ -723,10 +723,12 @@ function Mappings() //{{{
"Also focuses the web page, in case a form field has focus and eats our key presses."
}
));
//}}}
//}}}
} //}}}
// TODO: Convert these to the new mappings model
var hint_maps = [ //{{{
// TODO: Convert these to the new mappings model
/* [command, action, cancel_hint_mode, always_active] */
var g_hint_mappings = [ //{{{
/* hint action keys */
["o", "vimperator.hints.openHints(false, false);", true, false],
["t", "vimperator.hints.openHints(true, false);", true, false],
@@ -734,7 +736,7 @@ function Mappings() //{{{
["s", "vimperator.echoerr('Saving of links not yet implemented');", true, false],
["y", "vimperator.hints.yankUrlHints();", true, false],
["Y", "vimperator.hints.yankTextHints();", true, false],
[",", "vimperator.input.count+=','; vimperator.hints.setCurrentState(0);", false, true],
[",", "g_inputbuffer+=','; vimperator.hints.setCurrentState(0);", false, true],
[":", "vimperator.commandline.open(':', '', vimperator.modes.EX);", false, true],
/* movement keys */
["<C-e>", "scrollBufferRelative(0, 1);", false, true],
@@ -753,17 +755,16 @@ function Mappings() //{{{
["<C-n>", "vimperator.tabs.select('+1', true)", true, true], // same as gt, but no count supported
["<C-p>", "vimperator.tabs.select('-1', true)", true, true],
/* navigation */
["<C-o>", "stepInHistory(vimperator.input.count > 0 ? -1 * vimperator.input.count : -1);", false, true],
["<C-i>", "stepInHistory(vimperator.input.count > 0 ? vimperator.input.count : 1);", false, true],
["<C-h>", "stepInHistory(vimperator.input.count > 0 ? -1 * vimperator.input.count : -1);", false, true],
["<C-l>", "stepInHistory(vimperator.input.count > 0 ? vimperator.input.count : 1);", false, true],
["<C-d>", "vimperator.tabs.remove(getBrowser().mCurrentTab, vimperator.input.count, false, 0);", true, true],
["<C-o>", "vimperator.history.stepTo(g_count > 0 ? -1 * g_count : -1);", false, true],
["<C-i>", "vimperator.history.stepTo(g_count > 0 ? g_count : 1);", false, true],
["<C-h>", "vimperator.history.stepTo(g_count > 0 ? -1 * g_count : -1);", false, true],
["<C-l>", "vimperator.history.stepTo(g_count > 0 ? g_count : 1);", false, true],
["<C-d>", "vimperator.tabs.remove(getBrowser().mCurrentTab, g_count, false, 0);", true, true],
/* cancel hint mode keys */
["<C-c>", "", true, true],
["<C-g>", "", true, true],
["<C-[>", "", true, true],
["<Esc>", "", true, true]
]; //}}}
} //}}}
]; //}}}
// vim: set fdm=marker sw=4 ts=4 et: