diff options
Diffstat (limited to 'rime-conf.el')
-rw-r--r-- | rime-conf.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/rime-conf.el b/rime-conf.el index 8bb25fd..d3afae3 100644 --- a/rime-conf.el +++ b/rime-conf.el @@ -12,7 +12,8 @@ (use-package "dash.el" 'dash) (use-package "emacs-rime" 'rime - (define-key global-map (vector ?\s-i) #'toggle-input-method) + (define-key global-map (vector ?\s-i) #'durand-set-input-method) + (define-key minibuffer-local-map (vector ?\s-i) #'durand-set-input-method) (setq rime-librime-root "~/elisp_packages/librime/dist") (add-to-list 'rime-translate-keybindings "RET") (add-to-list 'rime-translate-keybindings "[") @@ -21,6 +22,14 @@ ;; rime-show-candidate 'posframe rime-user-data-dir (expand-file-name "rime" load-file-directory)) +;;;###autoload + (defun durand-set-input-method () + "Set the input method to \"rime\" or nil." + (interactive) + (cond + ((string= current-input-method "rime") (set-input-method nil)) + ((set-input-method "rime")))) + ;;; HACK: Fix a function (defun durand-rime-send-keybinding-a () "Fix a weird function." |