2

I have fcitx installed on a Linux environment. According the to fcitx-diagnose it is correctly installed.

I am using the us-alt-intl keyboard to access diacritics in other language as a default keyboard. But it imposes extra-typing in standard vim or evil mode. Typically,accessing registers or moving to marks adds an extra space, which on extensive usage is somewhat a burden.

I'd like to switch back to a standard us keyboard when not in insert mode. As it turns out that is a common issue for CJK users.

The Chinese layer and the mozc package relies on fcitx to do that job. First, I have not been able to make them work on my installation.

I have attempted to create a layer to that intent.

Being new to layer creation, I have followed the is my packages.el:

(setq fcitx-packages
          '((fcitx :toggle fcitx-enable-fcitx)
            org))  

(defun fcitx/init-fcitx ()
      (use-package fcitx
        :init (fcitx-evil-turn-on)
        :config
        (progn
          (setq fcitx-active-evil-states '(insert emacs hybrid))
          (fcitx-default-setup)
          (fcitx-prefix-keys-add "M-m" "C-M-m")
          (when fcitx-fcitx-use-dbus
            (setq fcitx-use-dbus t)))))

This is probably overkill as adding the fcitx package to the .spacemacs file could perhaps be enough

dotspacemacs-additional-packages '(fcitx
                                      mozc
                                      mozc-im
                                      mozc-popup)

How can I add the keyboards in that code (which is faulty anyway).

1

If your purpose is to input Chinese, you could use https://github.com/tumashu/pyim

A native Emacs input method written in pure Emacs Lisp. I just add a new backend pyim-dregcache to pyim. So it requires much less resource and is still fast enough.

The setup is minimum,

(eval-after-load 'pyim
  '(progn
      (setq pyim-dcache-backend 'pyim-dregcache) ; use memory efficient pyim engine
      ;; common setup for pyim ...
      ))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.