From c6262fc5e1aa9ca226cf0c6b6aeb86e519fa66e2 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 3 Apr 2013 19:14:38 +0200 Subject: [PATCH] use Y for concatenated yank --- src/main.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 },