reorganize keymap
This commit is contained in:
parent
771241ad97
commit
9ea11394bc
49
src/main.cc
49
src/main.cc
|
@ -626,27 +626,6 @@ 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, '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, '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::None, 'B' }, repeated(select<SelectMode::Extend>(select_to_previous_word<false>)) },
|
||||||
{ { Key::Modifiers::None, 'x' }, repeated(select<SelectMode::Replace>(select_line)) },
|
|
||||||
{ { Key::Modifiers::None, 'X' }, repeated(select<SelectMode::Extend>(select_line)) },
|
|
||||||
{ { 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::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, '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"); } }) },
|
|
||||||
|
|
||||||
{ { Key::Modifiers::Alt, 'i' }, do_select_object<SurroundFlags::ToBegin | SurroundFlags::ToEnd | SurroundFlags::Inner> },
|
|
||||||
{ { Key::Modifiers::Alt, 'a' }, do_select_object<SurroundFlags::ToBegin | SurroundFlags::ToEnd> },
|
|
||||||
{ { 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, '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, 'e' }, repeated(select<SelectMode::Replace>(select_to_next_word_end<true>)) },
|
||||||
|
@ -660,13 +639,35 @@ std::unordered_map<Key, std::function<void (Context& context)>> keymap =
|
||||||
{ { Key::Modifiers::Alt, 'h' }, repeated(select<SelectMode::Replace>(select_to_eol_reverse)) },
|
{ { 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, '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::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"); } }) },
|
||||||
|
|
||||||
|
{ { Key::Modifiers::Alt, 'i' }, do_select_object<SurroundFlags::ToBegin | SurroundFlags::ToEnd | SurroundFlags::Inner> },
|
||||||
|
{ { Key::Modifiers::Alt, 'a' }, do_select_object<SurroundFlags::ToBegin | SurroundFlags::ToEnd> },
|
||||||
|
{ { Key::Modifiers::None, ']' }, do_select_object<SurroundFlags::ToEnd> },
|
||||||
|
{ { Key::Modifiers::None, '[' }, do_select_object<SurroundFlags::ToBegin> },
|
||||||
|
|
||||||
{ { Key::Modifiers::Alt, 'j' }, do_join },
|
{ { Key::Modifiers::Alt, 'j' }, do_join },
|
||||||
|
|
||||||
{ { Key::Modifiers::None, '<' }, do_deindent },
|
{ { Key::Modifiers::None, '<' }, do_deindent },
|
||||||
{ { Key::Modifiers::None, '>' }, do_indent },
|
{ { 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::PageUp }, do_scroll<Key::PageUp> },
|
||||||
|
@ -679,8 +680,6 @@ std::unordered_map<Key, std::function<void (Context& context)>> keymap =
|
||||||
|
|
||||||
{ { Key::Modifiers::None, 'q' }, start_or_end_macro_recording },
|
{ { Key::Modifiers::None, 'q' }, start_or_end_macro_recording },
|
||||||
{ { Key::Modifiers::None, 'Q' }, replay_macro },
|
{ { Key::Modifiers::None, 'Q' }, replay_macro },
|
||||||
|
|
||||||
{ { Key::Modifiers::None, '*' }, use_selection_as_search_pattern },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user