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> keymap = { { Key::Modifiers::None, 'W' }, repeated(select(select_to_next_word)) }, { { Key::Modifiers::None, 'E' }, repeated(select(select_to_next_word_end)) }, { { Key::Modifiers::None, 'B' }, repeated(select(select_to_previous_word)) }, + + { { Key::Modifiers::Alt, 'w' }, repeated(select(select_to_next_word)) }, + { { Key::Modifiers::Alt, 'e' }, repeated(select(select_to_next_word_end)) }, + { { Key::Modifiers::Alt, 'b' }, repeated(select(select_to_previous_word)) }, + { { Key::Modifiers::Alt, 'W' }, repeated(select(select_to_next_word)) }, + { { Key::Modifiers::Alt, 'E' }, repeated(select(select_to_next_word_end)) }, + { { Key::Modifiers::Alt, 'B' }, repeated(select(select_to_previous_word)) }, + + { { Key::Modifiers::Alt, 'l' }, repeated(select(select_to_eol)) }, + { { Key::Modifiers::Alt, 'L' }, repeated(select(select_to_eol)) }, + { { Key::Modifiers::Alt, 'h' }, repeated(select(select_to_eol_reverse)) }, + { { Key::Modifiers::Alt, 'H' }, repeated(select(select_to_eol_reverse)) }, + { { Key::Modifiers::None, 'x' }, repeated(select(select_line)) }, { { Key::Modifiers::None, 'X' }, repeated(select(select_line)) }, + { { Key::Modifiers::Alt, 'x' }, select(select_whole_lines) }, + { { Key::Modifiers::None, 'm' }, select(select_matching) }, { { Key::Modifiers::None, 'M' }, select(select_matching) }, { { Key::Modifiers::None, '/' }, do_search }, { { Key::Modifiers::None, '?' }, do_search }, - { { Key::Modifiers::Alt, '/' }, do_search }, - { { Key::Modifiers::Alt, '?' }, do_search }, - + { { Key::Modifiers::Alt, '/' }, do_search }, + { { Key::Modifiers::Alt, '?' }, do_search }, { { Key::Modifiers::None, 'n' }, do_search_next }, { { Key::Modifiers::Alt, 'n' }, do_search_next }, { { Key::Modifiers::None, 'N' }, do_search_next }, + { { 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> keymap = { { Key::Modifiers::None, ']' }, do_select_object }, { { Key::Modifiers::None, '[' }, do_select_object }, - { { Key::Modifiers::Alt, 'w' }, repeated(select(select_to_next_word)) }, - { { Key::Modifiers::Alt, 'e' }, repeated(select(select_to_next_word_end)) }, - { { Key::Modifiers::Alt, 'b' }, repeated(select(select_to_previous_word)) }, - { { Key::Modifiers::Alt, 'W' }, repeated(select(select_to_next_word)) }, - { { Key::Modifiers::Alt, 'E' }, repeated(select(select_to_next_word_end)) }, - { { Key::Modifiers::Alt, 'B' }, repeated(select(select_to_previous_word)) }, - - { { Key::Modifiers::Alt, 'l' }, repeated(select(select_to_eol)) }, - { { Key::Modifiers::Alt, 'L' }, repeated(select(select_to_eol)) }, - { { Key::Modifiers::Alt, 'h' }, repeated(select(select_to_eol_reverse)) }, - { { Key::Modifiers::Alt, 'H' }, repeated(select(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(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::Modifiers::None, Key::PageDown }, do_scroll }, @@ -675,12 +676,10 @@ std::unordered_map> keymap = { { Key::Modifiers::Control, 'i' }, jump }, { { Key::Modifiers::Control, 'o' }, jump }, - { { 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 }, }; }