| 2448 | } |
| 2449 | |
| 2450 | void ZepMode::AddNavigationKeyMaps(bool allowInVisualMode) |
| 2451 | { |
| 2452 | std::vector<KeyMap*> navigationMaps = { &m_normalMap }; |
| 2453 | if (allowInVisualMode) |
| 2454 | { |
| 2455 | navigationMaps.push_back(&m_visualMap); |
| 2456 | } |
| 2457 | |
| 2458 | // Up/Down/Left/Right |
| 2459 | AddKeyMapWithCountRegisters(navigationMaps, { "j", "<Down>" }, id_MotionDown); |
| 2460 | AddKeyMapWithCountRegisters(navigationMaps, { "k", "<Up>" }, id_MotionUp); |
| 2461 | AddKeyMapWithCountRegisters(navigationMaps, { "l", "<Right>" }, id_MotionRight); |
| 2462 | AddKeyMapWithCountRegisters(navigationMaps, { "h", "<Left>" }, id_MotionLeft); |
| 2463 | |
| 2464 | // Page Motions |
| 2465 | AddKeyMapWithCountRegisters(navigationMaps, { "<C-f>", "<PageDown>" }, id_MotionPageForward); |
| 2466 | AddKeyMapWithCountRegisters(navigationMaps, { "<C-b>", "<PageUp>" }, id_MotionPageBackward); |
| 2467 | AddKeyMapWithCountRegisters(navigationMaps, { "<C-d>" }, id_MotionHalfPageForward); |
| 2468 | AddKeyMapWithCountRegisters(navigationMaps, { "<C-u>" }, id_MotionHalfPageBackward); |
| 2469 | AddKeyMapWithCountRegisters(navigationMaps, { "G" }, id_MotionGotoLine); |
| 2470 | |
| 2471 | // Line Motions |
| 2472 | AddKeyMapWithCountRegisters(navigationMaps, { "$" }, id_MotionLineEnd); |
| 2473 | AddKeyMapWithCountRegisters(navigationMaps, { "^" }, id_MotionLineFirstChar); |
| 2474 | keymap_add(navigationMaps, { "0" }, id_MotionLineBegin); |
| 2475 | |
| 2476 | // Word motions |
| 2477 | AddKeyMapWithCountRegisters(navigationMaps, { "w" }, id_MotionWord); |
| 2478 | AddKeyMapWithCountRegisters(navigationMaps, { "b" }, id_MotionBackWord); |
| 2479 | AddKeyMapWithCountRegisters(navigationMaps, { "W" }, id_MotionWORD); |
| 2480 | AddKeyMapWithCountRegisters(navigationMaps, { "B" }, id_MotionBackWORD); |
| 2481 | AddKeyMapWithCountRegisters(navigationMaps, { "e" }, id_MotionEndWord); |
| 2482 | AddKeyMapWithCountRegisters(navigationMaps, { "E" }, id_MotionEndWORD); |
| 2483 | AddKeyMapWithCountRegisters(navigationMaps, { "ge" }, id_MotionBackEndWord); |
| 2484 | AddKeyMapWithCountRegisters(navigationMaps, { "gE" }, id_MotionBackEndWORD); |
| 2485 | AddKeyMapWithCountRegisters(navigationMaps, { "gg" }, id_MotionGotoBeginning); |
| 2486 | |
| 2487 | // Navigate between splits |
| 2488 | keymap_add(navigationMaps, { "<C-j>" }, id_MotionDownSplit); |
| 2489 | keymap_add(navigationMaps, { "<C-l>" }, id_MotionRightSplit); |
| 2490 | keymap_add(navigationMaps, { "<C-k>" }, id_MotionUpSplit); |
| 2491 | keymap_add(navigationMaps, { "<C-h>" }, id_MotionLeftSplit); |
| 2492 | |
| 2493 | // Arrows always navigate in insert mode |
| 2494 | keymap_add({ &m_insertMap }, { "<Down>" }, id_MotionDown); |
| 2495 | keymap_add({ &m_insertMap }, { "<Up>" }, id_MotionUp); |
| 2496 | keymap_add({ &m_insertMap }, { "<Right>" }, id_MotionRight); |
| 2497 | keymap_add({ &m_insertMap }, { "<Left>" }, id_MotionLeft); |
| 2498 | } |
| 2499 | |
| 2500 | void ZepMode::AddSearchKeyMaps() |
| 2501 | { |
nothing calls this directly
no test coverage detected