sdcv is a simple, cross-platform, text-based utility for working with dictionaries in StarDict format.
StarDict dictionaries can be downloaded from https://stardict.nchrs.xyz/ or https://kdr2.com/resource/stardict.html.
The quick-sdcv package serves as a lightweight Emacs interface for the sdcv command-line interface, which is the console version of the StarDict dictionary application.
(use-package quick-sdcv
:ensure t
:commands (quick-sdcv-search-input quick-sdcv-search-at-point)
:config
(setq quick-sdcv-program "/path/to/sdcv"
quick-sdcv-dictionary-data-dir "/path/to/sdcv/dict/")
(add-to-list 'process-coding-system-alist '("sdcv" utf-8 . gbk))
(add-hook 'quick-sdcv-mode-hook #'visual-line-mode)
(keymap-set quick-sdcv-mode-map "b" #'backward-page)
(keymap-set quick-sdcv-mode-map "f" #'forward-page)
(keymap-set quick-sdcv-mode-map "n" #'next-line)
(keymap-set quick-sdcv-mode-map "p" #'previous-line)
(keymap-set quick-sdcv-mode-map "q" #'quit-window))
Related
Safe Local Variable Directories
This variable is a list of directories where local variables are always enabled.
Build Emacs On Windows
We can build Emacs with MSYS2 and MinGW-W64 on Windows.
Build Emacs From Source
A guide to build emacs from source on Linux.