diff --git a/README.md b/README.md index 8dd8d61..57f0093 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,7 @@ Ctrl+t script-binding toggle-sub-autocopy ## Usage ### Global bindings These bindings work everywhere, even if the menu (covered later) is closed. +* `Shift+h` and `Shift+l` - Seek to the next or the previous subtitle. * `Ctrl+e` - Export a card with the currently visible subtitle line on the front. Use this when your subs are perfectly timed and the target sentence doesn't span multiple subs. * `Ctrl+h` - Seek to the start of the currently visible subtitle. Use it if you missed something. diff --git a/subs2srs.lua b/subs2srs.lua index 7f86094..2a5146f 100644 --- a/subs2srs.lua +++ b/subs2srs.lua @@ -1040,10 +1040,18 @@ end validate_config() ankiconnect.create_deck_if_doesnt_exist(config.deck_name) + +-- Key bindings mp.add_forced_key_binding("ctrl+e", "anki-export-note", export_to_anki) mp.add_forced_key_binding("ctrl+c", "copy-sub-to-clipboard", copy_sub_to_clipboard) mp.add_key_binding('a', 'mpvacious-menu-open', menu.open) -- a for advanced mp.add_key_binding("ctrl+h", "sub-rewind", sub_rewind) + +-- Vim-like seeking between subtitle lines +mp.add_key_binding("H", "mpvacious-sub-seek-back", function() mp.commandv("sub_seek", "-1") end) +mp.add_key_binding("L", "mpvacious-sub-seek-forward", function() mp.commandv("sub_seek", "1") end) + +-- Unset by default mp.add_key_binding(nil, "set-starting-line", subs.set_starting_line) mp.add_key_binding(nil, "reset-timings", subs.reset_timings) mp.add_key_binding(nil, "toggle-sub-autocopy", clip_autocopy.toggle)