diff options
author | cflip <cflip@cflip.net> | 2023-01-16 10:48:09 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-16 10:48:09 -0700 |
commit | 617db1d87703e929390a3ea04d189a25c4aaa026 (patch) | |
tree | a768632f80a8c5b4d9b1192eaa553c4cb2505278 /input.c | |
parent | 24232e191a16015509b444fcee771b2f0cb1478b (diff) |
Implement some more commands from vim
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -62,6 +62,20 @@ void editor_process_keypress(struct editor_state *editor, SDL_Keysym *keysym) case SDLK_i: editor->mode = EDITOR_MODE_INSERT; break; + case SDLK_a: + if (keysym->mod & KMOD_SHIFT) + editor->cursor_x = editor->rows[editor->cursor_y].size; + else + editor_move_right(editor); + editor->mode = EDITOR_MODE_INSERT; + break; + case SDLK_o: + if (keysym->mod & KMOD_SHIFT) + editor_add_line_above(editor); + else + editor_add_line_below(editor); + editor->mode = EDITOR_MODE_INSERT; + break; case SDLK_k: editor_move_up(editor); break; |