To install this package, run in Emacs:
M-x package-install RET subed RET
subed is an Emacs major mode for editing subtitles while playing the
corresponding video with mpv. At the moment, the only supported formats are
.srt), WebVTT (
.vtt ), and Advanced SubStation Alpha (
.ass, experimental ).
M-n) and previous (
M-p) subtitle text.
C-M-a) and end (
C-M-e) of the current subtitle's text.
M-i) or right next the current subtitle (
C-M-i). A prefix argument controls how many subtitles to insert and whether they are inserted before or after the current subtitle.
M-]) and stop (
M-}) time. A prefix argument sets the number of milliseconds for the current session (e.g.
C-u 1000 M-[ M-[ M-[decreases start time by 3 seconds).
C-M-n) or backward (
C-M-p) in time without changing subtitle duration. A prefix argument sets the number of milliseconds for the current session (e.g.
C-u 500 C-M-n C-M-nmoves the current subtitle 1 second forward).
C-M-f) or backward (
C-M-b) together with all following subtitles. This is basically a convenience shortcut for
C-SPC M-> C-M-n/p.
C-M-x) or backward (
C-M-S-x) in time without changing subtitle duration. A prefix argument sets the number of milliseconds for the current session (e.g.
C-u 500 C-M-xmoves the last [or last marked] subtitle forward 500ms and proportionally scales all [or all marked] subtitles based on this time extension. Similarly,
C-u 500 C-M-S-xmoves the last [or last marked] subtitle backward 500ms and proportionally scales all [or all marked] subtitles based on this time contraction). This can be extremely useful to correct synchronization issues in existing subtitle files. First, adjust the starting time if necessary (e.g.
C-M-f), then adjust the ending and scale constituent subtitles (e.g.
C-c C-t C-t, with an optional attribute when prefixed by
C-u), in particular italics (
C-c C-t C-i) or boldface (
C-c C-t C-b).
M-s). This is done automatically every time the buffer is saved.
M-x subed-trim-overlaps. By default, this adjusts the stop time of overlapping subtitles to
subed-subtitle-spacingmilliseconds before the next subtitle starts. Use
subedto configure trimming to happen automatically when buffers are loaded or saved, which time is adjusted, and how much time to leave between subtitles.
C-c C-vor automatically when entering subed-mode if the video file is named like the subtitle file but with a video extension (e.g.
C-c [) or stop (
C-c ]) time of the current subtitle.
C-c C-f .and
C-c C-f ,; pressing
.afterwards moves by frames until any other key is pressed).
subed is now on NonGNU ELPA. On Emacs 28 and later, you can install it with
To install it on Emacs 27 or earlier, add the following to your Emacs configuration file:
(with-eval-after-load 'package (add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/")))
M-x eval-buffer to run the code, and then use
If that doesn't work, you can install it manually. For example, copy
$HOME/.emacs.d/elisp/ and add
$HOME/.emacs.d/elisp/ to your
Here's some sample code for manual installation:
(add-to-list 'load-path "~/.emacs.d/elisp") (require 'subed)
Here's an example setup if you use use-package:
(use-package subed :ensure t :config ;; Disable automatic movement of point by default (add-hook 'subed-mode-hook 'subed-disable-sync-point-to-player) ;; Remember cursor position between sessions (add-hook 'subed-mode-hook 'save-place-local-mode) ;; Break lines automatically while typing (add-hook 'subed-mode-hook 'turn-on-auto-fill) ;; Break lines at 40 characters (add-hook 'subed-mode-hook (lambda () (setq-local fill-column 40))))
C-h f subed-mode should get you started.
Contributions would be really appreciated! subed conforms to the REUSE
Specification; this means that every file has copyright and license
information. If you modify a file, please update the year shown after
SPDX-FileCopyrightText. Thank you!
There's a list of authors in the file
AUTHORS.org. If you have at any point
contributed to subed, you are most welcome to add your name (and email
address if you like) to the list.
subed is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.