From e652d53e5d0c0bcc1063ed8d57d2157882f6fdaa Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Wed, 13 Feb 2008 05:02:49 +0000 Subject: [PATCH] moved search mappings to find.js --- content/find.js | 35 +++++++++++++++++++++++++++++++++++ content/mappings.js | 35 +---------------------------------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/content/find.js b/content/find.js index c4040e76..fb379d58 100644 --- a/content/find.js +++ b/content/find.js @@ -141,6 +141,41 @@ vimperator.Search = function () //{{{ "Override the 'ignorecase' option if the pattern contains uppercase characters", "boolean", true); + /////////////////////////////////////////////////////////////////////////////}}} + ////////////////////// MAPPINGS //////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////{{{ + vimperator.mappings.add([vimperator.modes.NORMAL], ["/"], + "Search forward for a pattern", + function () { vimperator.search.openSearchDialog(vimperator.modes.SEARCH_FORWARD); }); + + vimperator.mappings.add([vimperator.modes.NORMAL], ["?"], + "Search backwards for a pattern", + function () { vimperator.search.openSearchDialog(vimperator.modes.SEARCH_BACKWARD); }); + + vimperator.mappings.add([vimperator.modes.NORMAL], ["n"], + "Find next", + function () { vimperator.search.findAgain(false); }); + + vimperator.mappings.add([vimperator.modes.NORMAL], ["N"], + "Find previous", + function () { vimperator.search.findAgain(true); }); + + vimperator.mappings.add([vimperator.modes.NORMAL, vimperator.modes.CARET, vimperator.modes.TEXTAREA], ["*"], + "Find word under cursor", + function () + { + vimperator.search.searchSubmitted(vimperator.buffer.getCurrentWord(), false); + vimperator.search.findAgain(); + }); + + vimperator.mappings.add([vimperator.modes.NORMAL, vimperator.modes.CARET, vimperator.modes.TEXTAREA], ["#"], + "Find word under cursor backwards", + function () + { + vimperator.search.searchSubmitted(vimperator.buffer.getCurrentWord(), true); + vimperator.search.findAgain(); + }); + /////////////////////////////////////////////////////////////////////////////}}} ////////////////////// PUBLIC SECTION ////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////{{{ diff --git a/content/mappings.js b/content/mappings.js index 9bec9220..d446af7a 100644 --- a/content/mappings.js +++ b/content/mappings.js @@ -938,23 +938,7 @@ vimperator.Mappings = function () //{{{ } )); - // search management - addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["/"], - function () { vimperator.search.openSearchDialog(vimperator.modes.SEARCH_FORWARD); }, - { shortHelp: "Search forward for a pattern" } - )); - addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["?"], - function () { vimperator.search.openSearchDialog(vimperator.modes.SEARCH_BACKWARD); }, - { shortHelp: "Search backwards for a pattern" } - )); - addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["n"], - function () { vimperator.search.findAgain(false); }, - { shortHelp: "Find next" } - )); - addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["N"], - function () { vimperator.search.findAgain(true); }, - { shortHelp: "Find previous" } - )); + // macros addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL], ["q"], function (arg) { vimperator.events.startRecording(arg); }, { @@ -1084,23 +1068,6 @@ vimperator.Mappings = function () //{{{ )); - addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL, vimperator.modes.CARET, vimperator.modes.TEXTAREA], ["*"], - function (count) - { - vimperator.search.searchSubmitted(vimperator.buffer.getCurrentWord(), false); - vimperator.search.findAgain(); - }, - { } - )); - addDefaultMap(new vimperator.Map([vimperator.modes.NORMAL, vimperator.modes.CARET, vimperator.modes.TEXTAREA], ["#"], - function (count) - { - vimperator.search.searchSubmitted(vimperator.buffer.getCurrentWord(), true); - vimperator.search.findAgain(); - }, - { } - )); - // }}} // VISUAL mode // {{{