diff options
| author | Tim Allen <screwtape@froup.com> | 2018-03-15 23:02:27 +1100 |
|---|---|---|
| committer | Tim Allen <screwtape@froup.com> | 2018-04-11 15:15:45 +1000 |
| commit | 50e422659bb1533da2d5f04bbd17de062dcad84b (patch) | |
| tree | 2c3c7fba8ec46a5491c0e27c6ea311952e2c0460 /src/normal.cc | |
| parent | d846400279a1831d3d29a4dd179fbf799b4ee541 (diff) | |
Add support for the shift modifier.
Because keyboard layouts vary, the shift-modifier `<s-…>` is only supported
for special keys (like `<up>` and `<home>`) 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 `<s-x>` are normalized to `<X>` when `x` is an ASCII
character. `<backtab>` is removed, since we can now say `<s-tab>`.
Diffstat (limited to 'src/normal.cc')
| -rw-r--r-- | src/normal.cc | 7 |
1 files changed, 7 insertions, 0 deletions
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, NormalCmd, MemoryDomain::Undefined, KeymapBackend> key { {'K'}, {"extend up", move<LineCount, Backward, SelectMode::Extend>} }, { {'L'}, {"extend right", move<CharCount, Forward, SelectMode::Extend>} }, + { shift(Key::Left), {"extend left", move<CharCount, Backward, SelectMode::Extend>} }, + { shift(Key::Down), {"extend down", move<LineCount, Forward, SelectMode::Extend>} }, + { shift(Key::Up), {"extend up", move<LineCount, Backward, SelectMode::Extend>} }, + { shift(Key::Right), {"extend right", move<CharCount, Forward, SelectMode::Extend>} }, + { {'t'}, {"select to next character", select_to_next_char<SelectFlags::None>} }, { {'f'}, {"select to next character included", select_to_next_char<SelectFlags::Inclusive>} }, { {'T'}, {"extend to next character", select_to_next_char<SelectFlags::Extend>} }, @@ -2140,9 +2145,11 @@ static const HashMap<Key, NormalCmd, MemoryDomain::Undefined, KeymapBackend> key { {alt('l')}, {"select to line end", repeated<select<SelectMode::Replace, select_to_line_end<false>>>} }, { {Key::End}, {"select to line end", repeated<select<SelectMode::Replace, select_to_line_end<false>>>} }, { {alt('L')}, {"extend to line end", repeated<select<SelectMode::Extend, select_to_line_end<false>>>} }, + { shift(Key::End), {"extend to line end", repeated<select<SelectMode::Extend, select_to_line_end<false>>>} }, { {alt('h')}, {"select to line begin", repeated<select<SelectMode::Replace, select_to_line_begin<false>>>} }, { {Key::Home}, {"select to line begin", repeated<select<SelectMode::Replace, select_to_line_begin<false>>>} }, { {alt('H')}, {"extend to line begin", repeated<select<SelectMode::Extend, select_to_line_begin<false>>>} }, + { shift(Key::Home), {"extend to line begin", repeated<select<SelectMode::Extend, select_to_line_begin<false>>>} }, { {'x'}, {"select line", repeated<select<SelectMode::Replace, select_line>>} }, { {'X'}, {"extend line", repeated<select<SelectMode::Extend, select_line>>} }, |
