Commit: a181c35525da03b84d99900d0ecad1f0cba97264
Parent: 591594ea321591cfc841602b1f68ff9ccc8fc310
Author: Ren Tatsumoto
Date: Sun, 25 Oct 2020 22:44:08 +0300
include seeking bindings in the add-on
Diffstat:
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git 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
@@ -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)