Skip to content

Latest commit

 

History

History
176 lines (122 loc) · 4.65 KB

INSTALLATION_EN.org

File metadata and controls

176 lines (122 loc) · 4.65 KB

Emacs Rime Installation

Requirements

Emacs 26.1+ with dynamic modules support, gcc and make.

emacs-rime will build dynamic module automatically.

How to get Emacs with dynamic module support?

  • **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.

Install librime

Linux

ArchLinux/Manjaro

sudo pacman -S librime

Debian/Ubuntu

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

Fedora

sudo dnf install librime-devel emacs-devel

openSUSE

sudo zypper install librime-devel emacs-el

MacOS

  1. First of all, make sure you have installed Squirrel, the MacOS Rime client.
  2. Then download the librime release.
  3. 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

Windows

using scoop

Install dependencies via scoop.

scoop install gcc
scoop bucket add wsw0108 https://github.com/wsw0108/scoop-bucket.git
scoop install librime

using msys2

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.

Can’t find rime_api.h when compile?

You MUST specify rime-librime-root in this case.

Check Installation for how to set.

Can’t find emacs-module.h when compile?

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")

Minimal configuration

(use-package rime
  :custom
  (default-input-method "rime"))

Use Straight

(use-package rime
  :straight (rime :type git
                  :host github
                  :repo "DogLooksGood/emacs-rime"
                  :files ("*.el" "Makefile" "lib.c"))
  :custom
  (default-input-method "rime"))

Use Quelpa

(use-package rime
  :quelpa (rime :fetcher github
                :repo "DogLooksGood/emacs-rime"
                :files ("*.el" "Makefile" "lib.c"))
  :custom
  (default-input-method "rime"))

NOTICE (MacOS)

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")

Activate input method

To activate Rime, use command toggle-input-method which is bound to C-\ by default.