From b5a2901f8d71c580a1b25662d31a983213bf90a9 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 11 Sep 2012 14:01:41 +0200 Subject: [PATCH] add 'r' for replacing selection with next typed char --- src/main.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.cc b/src/main.cc index b19ddd588..f420114f1 100644 --- a/src/main.cc +++ b/src/main.cc @@ -86,6 +86,13 @@ void do_go(Context& context) }); } +void do_replace_with_char(Context& context) +{ + context.client().on_next_key([](const Key& key, Context& context) { + context.editor().replace(String() + key.key); + }); +} + void do_command(Context& context) { context.client().prompt( @@ -353,6 +360,7 @@ std::unordered_map> keymap = { { Key::Modifiers::None, 'A' }, do_insert }, { { Key::Modifiers::None, 'o' }, do_insert }, { { Key::Modifiers::None, 'O' }, do_insert }, + { { Key::Modifiers::None, 'r' }, do_replace_with_char }, { { Key::Modifiers::None, 'g' }, do_go }, { { Key::Modifiers::None, 'G' }, do_go },