Skip to content

Commit

Permalink
include seeking bindings in the add-on
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsumoto-ren committed Oct 25, 2020
1 parent 591594e commit a181c35
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions subs2srs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit a181c35

Please sign in to comment.