Emacs 26.1+ with dynamic modules support, gcc
and make
.
emacs-rime will build dynamic module automatically.
- **Linux**
Emacs included in major linux distributions has dynamic module support enabled by default.
- **MacOS**
emacs-plus
enables dynamic modules support by default. homebrew installation:
brew tap d12frosted/emacs-plus
brew install emacs-plus
When installing emacs-mac
, you need to add --with-modules
option. homebrew installation:
brew tap railwaycat/emacsmacport
brew install emacs-mac --with-modules
- **Compile Emacs 26 manually**
Use --with-modules
option.
sudo pacman -S librime
sudo apt install librime-dev
Check the version of librime-dev
in repositiory, if it’s older than 1.5.3, you need compile it from source.
sudo apt install git build-essential cmake libboost-all-dev libgoogle-glog-dev libleveldb-dev libmarisa-dev libopencc-dev libyaml-cpp-dev libgtest-dev
git clone https://github.com/rime/librime.git ~/.emacs.d/librime
cd ~/.emacs.d/librime
make
sudo make install
sudo dnf install librime-devel emacs-devel
sudo zypper install librime-devel emacs-el
- First of all, make sure you have installed Squirrel, the MacOS Rime client.
- Then download the librime release.
- If you upgrade Squirrel in future, please check its CHANGELOG and upgrade librime to a matching version.
curl -L -O https://github.com/rime/librime/releases/download/1.7.1/rime-1.7.1-osx.zip
unzip rime-1.7.1-osx.zip -d ~/.emacs.d/librime
rm -rf rime-1.7.1-osx.zip
If the MacOS Gatekeeper blocks the librime executable, you can disable it temporarily with:
sudo spctl --master-disable
# later: sudo spctl --master-enable
Install dependencies via scoop.
scoop install gcc
scoop bucket add wsw0108 https://github.com/wsw0108/scoop-bucket.git
scoop install librime
Install dependencies via msys2.
pacman -S pactoys base-devel
pacboy -S librime:x librime-data:x emacs:x toolchain:x
ln -s /mingw64/share/opencc/* /mingw64/share/rime-data/opencc # Fix the Simplified Chinese input
Start emacs from mingw64’s environment to get the correct SHELL
environment variable for building librime-emacs inside Emacs and MSYSTEM_PREFIX
for specifying the rime-share-data-dir
variable.
You MUST specify rime-librime-root
in this case.
Check Installation for how to set.
If you build Emacs by yourself and does not install to standard location,
you MUST specify rime-emacs-module-header-root
.
Put following in the :custom
section.
(Assuming you install Emacs to ~/emacs)
(rime-emacs-module-header-root "~/emacs/include")
(use-package rime
:custom
(default-input-method "rime"))
(use-package rime
:straight (rime :type git
:host github
:repo "DogLooksGood/emacs-rime"
:files ("*.el" "Makefile" "lib.c"))
:custom
(default-input-method "rime"))
(use-package rime
:quelpa (rime :fetcher github
:repo "DogLooksGood/emacs-rime"
:files ("*.el" "Makefile" "lib.c"))
:custom
(default-input-method "rime"))
If you are on MacOS or don’t have librime in standard path,
you MUST specify rime-librime-root
.
Put following in the :custom
section.
(Assuming you unzip librime to ~/.emacs.d/librime)
(rime-librime-root "~/.emacs.d/librime/dist")
To activate Rime, use command toggle-input-method
which is bound to C-\
by default.