diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-02-27 21:21:11 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-02-27 21:21:11 +0100 |
| commit | 9ea11394bccd515f7a1ac0718a7a97f5bd2e1be8 (patch) | |
| tree | 6d614da1ccaaefdfc6a2033f2b2d051c99a72ae0 /src | |
| parent | 771241ad977ac2e51b9b229d9167014eb9a0043d (diff) | |
reorganize keymap
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.cc | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/main.cc b/src/main.cc index fed68354..0bc2603e 100644 --- a/src/main.cc +++ b/src/main.cc @@ -626,19 +626,34 @@ std::unordered_map<Key, std::function<void (Context& context)>> keymap = { { Key::Modifiers::None, 'W' }, repeated(select<SelectMode::Extend>(select_to_next_word<false>)) }, { { Key::Modifiers::None, 'E' }, repeated(select<SelectMode::Extend>(select_to_next_word_end<false>)) }, { { Key::Modifiers::None, 'B' }, repeated(select<SelectMode::Extend>(select_to_previous_word<false>)) }, + + { { Key::Modifiers::Alt, 'w' }, repeated(select<SelectMode::Replace>(select_to_next_word<true>)) }, + { { Key::Modifiers::Alt, 'e' }, repeated(select<SelectMode::Replace>(select_to_next_word_end<true>)) }, + { { Key::Modifiers::Alt, 'b' }, repeated(select<SelectMode::Replace>(select_to_previous_word<true>)) }, + { { Key::Modifiers::Alt, 'W' }, repeated(select<SelectMode::Extend>(select_to_next_word<true>)) }, + { { Key::Modifiers::Alt, 'E' }, repeated(select<SelectMode::Extend>(select_to_next_word_end<true>)) }, + { { Key::Modifiers::Alt, 'B' }, repeated(select<SelectMode::Extend>(select_to_previous_word<true>)) }, + + { { Key::Modifiers::Alt, 'l' }, repeated(select<SelectMode::Replace>(select_to_eol)) }, + { { Key::Modifiers::Alt, 'L' }, repeated(select<SelectMode::Extend>(select_to_eol)) }, + { { Key::Modifiers::Alt, 'h' }, repeated(select<SelectMode::Replace>(select_to_eol_reverse)) }, + { { Key::Modifiers::Alt, 'H' }, repeated(select<SelectMode::Extend>(select_to_eol_reverse)) }, + { { Key::Modifiers::None, 'x' }, repeated(select<SelectMode::Replace>(select_line)) }, { { Key::Modifiers::None, 'X' }, repeated(select<SelectMode::Extend>(select_line)) }, + { { Key::Modifiers::Alt, 'x' }, select<SelectMode::Replace>(select_whole_lines) }, + { { Key::Modifiers::None, 'm' }, select<SelectMode::Replace>(select_matching) }, { { Key::Modifiers::None, 'M' }, select<SelectMode::Extend>(select_matching) }, { { Key::Modifiers::None, '/' }, do_search<SelectMode::Replace, true> }, { { Key::Modifiers::None, '?' }, do_search<SelectMode::Extend, true> }, - { { Key::Modifiers::Alt, '/' }, do_search<SelectMode::Replace, false> }, - { { Key::Modifiers::Alt, '?' }, do_search<SelectMode::Extend, false> }, - + { { Key::Modifiers::Alt, '/' }, do_search<SelectMode::Replace, false> }, + { { Key::Modifiers::Alt, '?' }, do_search<SelectMode::Extend, false> }, { { Key::Modifiers::None, 'n' }, do_search_next<SelectMode::Replace, true> }, { { Key::Modifiers::Alt, 'n' }, do_search_next<SelectMode::ReplaceLast, true> }, { { Key::Modifiers::None, 'N' }, do_search_next<SelectMode::Append, true> }, + { { Key::Modifiers::None, '*' }, use_selection_as_search_pattern }, { { Key::Modifiers::None, 'u' }, repeated([](Context& context) { if (not context.editor().undo()) { context.print_status("nothing left to undo"); } }) }, { { Key::Modifiers::None, 'U' }, repeated([](Context& context) { if (not context.editor().redo()) { context.print_status("nothing left to redo"); } }) }, @@ -648,26 +663,12 @@ std::unordered_map<Key, std::function<void (Context& context)>> keymap = { { Key::Modifiers::None, ']' }, do_select_object<SurroundFlags::ToEnd> }, { { Key::Modifiers::None, '[' }, do_select_object<SurroundFlags::ToBegin> }, - { { Key::Modifiers::Alt, 'w' }, repeated(select<SelectMode::Replace>(select_to_next_word<true>)) }, - { { Key::Modifiers::Alt, 'e' }, repeated(select<SelectMode::Replace>(select_to_next_word_end<true>)) }, - { { Key::Modifiers::Alt, 'b' }, repeated(select<SelectMode::Replace>(select_to_previous_word<true>)) }, - { { Key::Modifiers::Alt, 'W' }, repeated(select<SelectMode::Extend>(select_to_next_word<true>)) }, - { { Key::Modifiers::Alt, 'E' }, repeated(select<SelectMode::Extend>(select_to_next_word_end<true>)) }, - { { Key::Modifiers::Alt, 'B' }, repeated(select<SelectMode::Extend>(select_to_previous_word<true>)) }, - - { { Key::Modifiers::Alt, 'l' }, repeated(select<SelectMode::Replace>(select_to_eol)) }, - { { Key::Modifiers::Alt, 'L' }, repeated(select<SelectMode::Extend>(select_to_eol)) }, - { { Key::Modifiers::Alt, 'h' }, repeated(select<SelectMode::Replace>(select_to_eol_reverse)) }, - { { Key::Modifiers::Alt, 'H' }, repeated(select<SelectMode::Extend>(select_to_eol_reverse)) }, - - { { Key::Modifiers::Alt, 'j' }, do_join }, + { { Key::Modifiers::Alt, 'j' }, do_join }, { { Key::Modifiers::None, '<' }, do_deindent }, { { Key::Modifiers::None, '>' }, do_indent }, - { { Key::Modifiers::Alt, 'x' }, select<SelectMode::Replace>(select_whole_lines) }, - - { { Key::Modifiers::Alt, 'c' }, [](Context& context) { if (context.has_window()) context.window().center_selection(); } }, + { { Key::Modifiers::Alt, 'c' }, [](Context& context) { if (context.has_window()) context.window().center_selection(); } }, { { Key::Modifiers::None, Key::PageUp }, do_scroll<Key::PageUp> }, { { Key::Modifiers::None, Key::PageDown }, do_scroll<Key::PageDown> }, @@ -675,12 +676,10 @@ std::unordered_map<Key, std::function<void (Context& context)>> keymap = { { Key::Modifiers::Control, 'i' }, jump<JumpDirection::Forward> }, { { Key::Modifiers::Control, 'o' }, jump<JumpDirection::Backward> }, - { { Key::Modifiers::Alt, 'r' }, do_rotate_selections }, + { { Key::Modifiers::Alt, 'r' }, do_rotate_selections }, { { Key::Modifiers::None, 'q' }, start_or_end_macro_recording }, { { Key::Modifiers::None, 'Q' }, replay_macro }, - - { { Key::Modifiers::None, '*' }, use_selection_as_search_pattern }, }; } |
