From 45164ddc0cd4f91f486583f12006739edc0f5cb7 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Tue, 3 Feb 2026 10:06:14 -0500 Subject: [PATCH] Add quick-sdcv --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 36e694f..753c896 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ Please share your configuration. It could serve as inspiration for other users. - [Enhancing the Elisp development experience](#enhancing-the-elisp-development-experience) - [Tree-sitter Integration (Better Syntax Highlighting)](#tree-sitter-integration-better-syntax-highlighting) - [Showing the tab-bar](#showing-the-tab-bar) + - [Offline Dictionary](#offline-dictionary) - [Changing the Default Font](#changing-the-default-font) - [Persisting Text Scale](#persisting-text-scale) - [Loading the custom.el file](#loading-the-customel-file) @@ -1605,6 +1606,32 @@ Configure the `tab-bar-show` variable to 1 to display the tab bar exclusively wh (setopt tab-bar-show 1) ``` +### Offline Dictionary + +The [quick-sdcv.el](https://github.com/jamescherti/quick-sdcv.el) package serves as a lightweight Emacs interface for the `sdcv` command-line interface, which is the console version of the StarDict dictionary application. + +This package enables Emacs to function as an offline dictionary. + +To enable *quick-sdcv*, add the following to your `~/.emacs.d/post-init.el`: + +```emacs-lisp +(use-package quick-sdcv + :ensure t + :custom + (quick-sdcv-unique-buffers t) + (quick-sdcv-dictionary-prefix-symbol "►") + (quick-sdcv-ellipsis " ▼")) +``` + +Here are the main interactive functions: +- `M-x quick-sdcv-search-at-point`: Searches the word around the cursor and displays the result in a buffer. +- `M-x quick-sdcv-search-input`: Searches the input word and displays the result in a buffer. + +Prerequisite: + +- The [sdcv](https://github.com/Dushistov/sdcv) command. (It can usually be installed by installing the `sdcv` package.) +- Download dictionaries from: http://download.huzheng.org/ . Once the dictionaries are downloaded, extract them into `/usr/share/stardict/dic/`, or configure the variable `quick-sdcv-dictionary-data-dir` in the Emacs configuration to specify an alternative dictionary path. + ### Changing the Default Font To customize the default font, add the following expression to your `~/.emacs.d/post-init.el`: