This is an alternative Elisp implementation of sdcv.el that does not require the sdcv CLI dependency. It is based on Chen Bin's code from here.
This version includes updates to support lookups across multiple dictionaries.
It can be installed using straight.el. To install, add the following to your Emacs configuration file:
(use-package sdcv-pure
:straight (:host github :repo "jsntn/sdcv-pure.el")
:config
;; set your dictionaries, see example below,
;; (defvar sdcv-simple-dict
;; `("~/.stardict/dic/stardict-lazyworm-ec-2.4.2")
;; "Dictionary to search")
;; (defvar sdcv-multiple-dicts
;; `(("~/.stardict/dic/stardict-lazyworm-ec-2.4.2")
;; ("~/.stardict/dic/stardict-langdao-ce-gb-2.4.2")
;; ("~/.stardict/dic/stardict-langdao-ec-gb-2.4.2")
;; ("~/.stardict/dic/stardict-cedict-gb-2.4.2")
;; ("~/.stardict/dic/stardict-DrEye4in1-2.4.2"))
;; "List of dictionaries to search.")
;; keybinding example,
;; (global-set-key (kbd "C-c d") 'sdcv-simple-definition)
;; (global-set-key (kbd "C-c D") 'sdcv-complete-definition)
)Use,
sdcv-simple-definitionfor simple popup lookupsdcv-complete-definitionfor the multiple dictionaries lookup
When using sdcv-complete-definition, you can quickly jump between different dictionaries in the results buffer using the following keybindings:
C-j- Jump to the next dictionary entryC-k- Jump to the previous dictionary entryq- Quit the sdcv window
These keybindings are also available in Evil normal mode if you use Evil.
sdcv.el is licensed under the GPL 3.0 License. See LICENSE for details.