diff --git a/src/main.cc b/src/main.cc index e42195153..1ae2da8fc 100644 --- a/src/main.cc +++ b/src/main.cc @@ -257,6 +257,15 @@ void do_yank(Context& context) RegisterManager::instance()['"'] = context.editor().selections_content(); } +void do_cat_yank(Context& context) +{ + auto sels = context.editor().selections_content(); + String str; + for (auto& sel : sels) + str += sel; + RegisterManager::instance()['"'] = memoryview(str); +} + void do_erase(Context& context) { RegisterManager::instance()['"'] = context.editor().selections_content(); @@ -647,6 +656,7 @@ std::unordered_map> keymap = { { Key::Modifiers::None, 'G' }, do_go }, { { Key::Modifiers::None, 'y' }, do_yank }, + { { Key::Modifiers::None, 'Y' }, do_cat_yank }, { { Key::Modifiers::None, 'p' }, repeated(do_paste) }, { { Key::Modifiers::None, 'P' }, repeated(do_paste) }, { { Key::Modifiers::Alt, 'p' }, do_paste },