From 50e422659bb1533da2d5f04bbd17de062dcad84b Mon Sep 17 00:00:00 2001 From: Tim Allen Date: Thu, 15 Mar 2018 23:02:27 +1100 Subject: Add support for the shift modifier. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because keyboard layouts vary, the shift-modifier `` is only supported for special keys (like `` and ``) and for ASCII lowercase where we assume the shift-modifier just produces the matching uppercase character. Even that's not universally true, since in Turkish `i` and `I` are not an uppercase/lowercase pair, but Kakoune's default keyboard mappings already assume en-US mappings for mnemonic purposes. Mappings of the form `` are normalized to `` when `x` is an ASCII character. `` is removed, since we can now say ``. --- src/normal.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/normal.cc') diff --git a/src/normal.cc b/src/normal.cc index 4662a23d..3d4a266a 100644 --- a/src/normal.cc +++ b/src/normal.cc @@ -2062,6 +2062,11 @@ static const HashMap key { {'K'}, {"extend up", move} }, { {'L'}, {"extend right", move} }, + { shift(Key::Left), {"extend left", move} }, + { shift(Key::Down), {"extend down", move} }, + { shift(Key::Up), {"extend up", move} }, + { shift(Key::Right), {"extend right", move} }, + { {'t'}, {"select to next character", select_to_next_char} }, { {'f'}, {"select to next character included", select_to_next_char} }, { {'T'}, {"extend to next character", select_to_next_char} }, @@ -2140,9 +2145,11 @@ static const HashMap key { {alt('l')}, {"select to line end", repeated>>} }, { {Key::End}, {"select to line end", repeated>>} }, { {alt('L')}, {"extend to line end", repeated>>} }, + { shift(Key::End), {"extend to line end", repeated>>} }, { {alt('h')}, {"select to line begin", repeated>>} }, { {Key::Home}, {"select to line begin", repeated>>} }, { {alt('H')}, {"extend to line begin", repeated>>} }, + { shift(Key::Home), {"extend to line begin", repeated>>} }, { {'x'}, {"select line", repeated>} }, { {'X'}, {"extend line", repeated>} }, -- cgit v1.2.3