Skip to content

Commit

Permalink
config emacs-rime
Browse files Browse the repository at this point in the history
  • Loading branch information
zilongshanren committed Sep 14, 2020
1 parent ea1d709 commit 812eb05
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'(org-pomodoro-play-sounds nil)
'(org-reverse-note-order t)
'(package-selected-packages
'(lsp-pyright treemacs-icons-dired posframe org-superstar lsp-ivy emr list-utils treemacs-persp magit-section pyim-basedict xr terminal-here flycheck-elsa leetcode aio ycmd request-deferred treemacs-magit vterm attrap hybrid-mode lispyville anki-editor pyim pangu-spacing find-by-pinyin-dired chinese-wbim chinese-conv ace-pinyin pinyinlib python unicode-escape company-tabnine plantuml-mode dap-mode bui tree-mode lsp-ui lsp-treemacs lsp-python-ms helm-lsp cquery company-lsp ccls forge closql emacsql-sqlite emacsql cpp-auto-include company-reftex parseedn lv parseclj a ox-hugo emojify emoji-cheat-sheet-plus company-emoji ob-typescript deadgrep org-cliplink devdocs ssh-agency org-projectile org-category-capture treemacs-projectile treemacs-evil treemacs pfuture transient osx-clipboard lsp-haskell lsp-mode flycheck-package package-lint evil-textobj-line blacken dante lcr company-ghc ghc helm-hoogle intero hlint-refactor hindent haskell-snippets flycheck-haskell company-ghci haskell-mode company-cabal cmm-mode imenu-list writeroom-mode visual-fill-column symbol-overlay treepy graphql sound-wav caps-lock doom-modeline eldoc-eval shrink-path ivy-rich prettier-js ivy-yasnippet gitignore-templates evil-goggles sesman dotenv-mode rjsx-mode magit-svn json-navigator hierarchy yasnippet-snippets spaceline-all-the-icons all-the-icons memoize pippel pipenv overseer org-mime nameless ivy-xref ivy-rtags importmagic epc concurrent google-c-style flycheck-rtags evil-cleverparens counsel-gtags counsel-css company-rtags rtags clojure-cheatsheet centered-cursor-mode font-lock+ ghub let-alist seq restclient-helm org-brain sayid evil-lion auctex-latexmk auctex password-generator realgud test-simple loc-changes load-relative company-lua blog-admin string-inflection opencl-mode cuda-mode symon rspec-mode fuzzy browse-at-remote winum helm-swoop unfill highlight-global marshal ht ob-restclient company-restclient know-your-http-well counsel-projectile lispy counsel swiper ivy-purpose hide-comnt helm-purpose window-purpose zoutline minitest glsl-mode pug-mode magithub editorconfig dockerfile-mode docker tablist docker-tramp helm-projectile xterm-color shell-pop eshell-z eshell-prompt-extras esh-help graphviz-dot-mode py-isort dumb-jump restclient racket-mode faceup projectile-rails ob-http helm-gtags feature-mode company-auctex rvm ruby-tools ruby-test-mode rubocop robe rbenv rake enh-ruby-mode chruby bundler inf-ruby yapfify sicp helm-mode-manager org origami tiny evil-unimpaired helm-pydoc unicode-whitespace github-search flycheck-clojure evil-escape mwim helm-github-stars fcitx solarized-theme tide typescript-mode spaceline powerline org-plus-contrib ivy-hydra helm-gitignore helm-flx helm-descbinds helm-css-scss helm-company helm-ag helm helm-core flyspell-correct-ivy color-identifiers-mode ag bracketed-paste paradox inflections cider names yaml-mode which-key wgrep uuidgen toc-org smex smeargle smartparens reveal-in-osx-finder restart-emacs ranger pytest py-yapf prodigy persp-mode pcre2el osx-trash org-pomodoro mmm-mode markdown-mode lua-mode live-py-mode link-hint launchctl js2-mode jade-mode info+ ibuffer-projectile projectile hy-mode htmlize hl-todo help-fns+ haml-mode gnuplot gitignore-mode github-clone popup git-gutter-fringe+ git-gutter+ flyspell-correct flycheck evil-visual-mark-mode evil-magit magit-popup git-commit with-editor evil-indent-plus iedit evil-ediff evil undo-tree diminish diff-hl ivy tern company column-enforce-mode cmake-mode clojure-snippets eval-sexp-fu pkg-info clojure-mode bind-map bind-key yasnippet auto-compile packed anaconda-mode pythonic ace-window ace-link avy quelpa package-build wrap-region visual-regexp-steroids visual-regexp peep-dired osx-dictionary nodejs-repl litable keyfreq gulpjs find-file-in-project etags-select ctags-update beacon 4clojure moe-theme edn paredit queue peg json-rpc dash-functional web-completion-data makey anzu highlight goto-chg flx gh logito pcache pos-tip guide-key request parent-mode simple-httpd json-snatcher json-reformat multiple-cursors moz ctable orglue epic alert log4e gntp spinner epl hydra async deferred f s chinese-word-at-point dash youdao-dictionary ws-butler web-mode web-beautify volatile-highlights vi-tilde-fringe use-package tagedit smooth-scrolling slim-mode scss-mode sass-mode rfringe reveal-in-finder rainbow-mode rainbow-identifiers rainbow-delimiters pyvenv pyenv-mode popwin pip-requirements persp-projectile pbcopy page-break-lines ox-reveal org-repo-todo org-present org-octopress org-mac-link org-download org-bullets open-junk-file neotree multi-term moz-controller move-text monokai-theme markdown-toc magit macrostep linum-relative leuven-theme less-css-mode json-mode js2-refactor js-doc indent-guide impatient-mode ido-vertical-mode hungry-delete hl-anything highlight-parentheses highlight-numbers highlight-indentation guide-key-tip google-translate golden-ratio github-browse-file gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link gist gh-md ggtags geiser fringe-helper flycheck-ycmd flycheck-pos-tip flx-ido fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-tutor evil-terminal-cursor-changer evil-surround evil-search-highlight-persist evil-org evil-numbers evil-nerd-commenter evil-matchit evil-lisp-state evil-jumper evil-indent-textobject evil-iedit-state evil-exchange evil-args evil-anzu engine-mode emmet-mode elisp-slime-nav elfeed discover-my-major deft dash-at-point cython-mode company-ycmd company-web company-tern company-statistics company-quickhelp company-c-headers company-anaconda command-log-mode coffee-mode cmake-font-lock clj-refactor clean-aindent-mode clang-format cider-eval-sexp-fu chinese-fonts-setup buffer-move auto-yasnippet auto-highlight-symbol auto-dictionary align-cljlet aggressive-indent adaptive-wrap ace-jump-mode ac-ispell 2048-game))
'(rime lsp-pyright treemacs-icons-dired posframe org-superstar lsp-ivy emr list-utils treemacs-persp magit-section pyim-basedict xr terminal-here flycheck-elsa leetcode aio ycmd request-deferred treemacs-magit vterm attrap hybrid-mode lispyville anki-editor pyim pangu-spacing find-by-pinyin-dired chinese-wbim chinese-conv ace-pinyin pinyinlib python unicode-escape company-tabnine plantuml-mode dap-mode bui tree-mode lsp-ui lsp-treemacs lsp-python-ms helm-lsp cquery company-lsp ccls forge closql emacsql-sqlite emacsql cpp-auto-include company-reftex parseedn lv parseclj a ox-hugo emojify emoji-cheat-sheet-plus company-emoji ob-typescript deadgrep org-cliplink devdocs ssh-agency org-projectile org-category-capture treemacs-projectile treemacs-evil treemacs pfuture transient osx-clipboard lsp-haskell lsp-mode flycheck-package package-lint evil-textobj-line blacken dante lcr company-ghc ghc helm-hoogle intero hlint-refactor hindent haskell-snippets flycheck-haskell company-ghci haskell-mode company-cabal cmm-mode imenu-list writeroom-mode visual-fill-column symbol-overlay treepy graphql sound-wav caps-lock doom-modeline eldoc-eval shrink-path ivy-rich prettier-js ivy-yasnippet gitignore-templates evil-goggles sesman dotenv-mode rjsx-mode magit-svn json-navigator hierarchy yasnippet-snippets spaceline-all-the-icons all-the-icons memoize pippel pipenv overseer org-mime nameless ivy-xref ivy-rtags importmagic epc concurrent google-c-style flycheck-rtags evil-cleverparens counsel-gtags counsel-css company-rtags rtags clojure-cheatsheet centered-cursor-mode font-lock+ ghub let-alist seq restclient-helm org-brain sayid evil-lion auctex-latexmk auctex password-generator realgud test-simple loc-changes load-relative company-lua blog-admin string-inflection opencl-mode cuda-mode symon rspec-mode fuzzy browse-at-remote winum helm-swoop unfill highlight-global marshal ht ob-restclient company-restclient know-your-http-well counsel-projectile lispy counsel swiper ivy-purpose hide-comnt helm-purpose window-purpose zoutline minitest glsl-mode pug-mode magithub editorconfig dockerfile-mode docker tablist docker-tramp helm-projectile xterm-color shell-pop eshell-z eshell-prompt-extras esh-help graphviz-dot-mode py-isort dumb-jump restclient racket-mode faceup projectile-rails ob-http helm-gtags feature-mode company-auctex rvm ruby-tools ruby-test-mode rubocop robe rbenv rake enh-ruby-mode chruby bundler inf-ruby yapfify sicp helm-mode-manager org origami tiny evil-unimpaired helm-pydoc unicode-whitespace github-search flycheck-clojure evil-escape mwim helm-github-stars fcitx solarized-theme tide typescript-mode spaceline powerline org-plus-contrib ivy-hydra helm-gitignore helm-flx helm-descbinds helm-css-scss helm-company helm-ag helm helm-core flyspell-correct-ivy color-identifiers-mode ag bracketed-paste paradox inflections cider names yaml-mode which-key wgrep uuidgen toc-org smex smeargle smartparens reveal-in-osx-finder restart-emacs ranger pytest py-yapf prodigy persp-mode pcre2el osx-trash org-pomodoro mmm-mode markdown-mode lua-mode live-py-mode link-hint launchctl js2-mode jade-mode info+ ibuffer-projectile projectile hy-mode htmlize hl-todo help-fns+ haml-mode gnuplot gitignore-mode github-clone popup git-gutter-fringe+ git-gutter+ flyspell-correct flycheck evil-visual-mark-mode evil-magit magit-popup git-commit with-editor evil-indent-plus iedit evil-ediff evil undo-tree diminish diff-hl ivy tern company column-enforce-mode cmake-mode clojure-snippets eval-sexp-fu pkg-info clojure-mode bind-map bind-key yasnippet auto-compile packed anaconda-mode pythonic ace-window ace-link avy quelpa package-build wrap-region visual-regexp-steroids visual-regexp peep-dired osx-dictionary nodejs-repl litable keyfreq gulpjs find-file-in-project etags-select ctags-update beacon 4clojure moe-theme edn paredit queue peg json-rpc dash-functional web-completion-data makey anzu highlight goto-chg flx gh logito pcache pos-tip guide-key request parent-mode simple-httpd json-snatcher json-reformat multiple-cursors moz ctable orglue epic alert log4e gntp spinner epl hydra async deferred f s chinese-word-at-point dash youdao-dictionary ws-butler web-mode web-beautify volatile-highlights vi-tilde-fringe use-package tagedit smooth-scrolling slim-mode scss-mode sass-mode rfringe reveal-in-finder rainbow-mode rainbow-identifiers rainbow-delimiters pyvenv pyenv-mode popwin pip-requirements persp-projectile pbcopy page-break-lines ox-reveal org-repo-todo org-present org-octopress org-mac-link org-download org-bullets open-junk-file neotree multi-term moz-controller move-text monokai-theme markdown-toc magit macrostep linum-relative leuven-theme less-css-mode json-mode js2-refactor js-doc indent-guide impatient-mode ido-vertical-mode hungry-delete hl-anything highlight-parentheses highlight-numbers highlight-indentation guide-key-tip google-translate golden-ratio github-browse-file gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link gist gh-md ggtags geiser fringe-helper flycheck-ycmd flycheck-pos-tip flx-ido fill-column-indicator fancy-battery eyebrowse expand-region exec-path-from-shell evil-visualstar evil-tutor evil-terminal-cursor-changer evil-surround evil-search-highlight-persist evil-org evil-numbers evil-nerd-commenter evil-matchit evil-lisp-state evil-jumper evil-indent-textobject evil-iedit-state evil-exchange evil-args evil-anzu engine-mode emmet-mode elisp-slime-nav elfeed discover-my-major deft dash-at-point cython-mode company-ycmd company-web company-tern company-statistics company-quickhelp company-c-headers company-anaconda command-log-mode coffee-mode cmake-font-lock clj-refactor clean-aindent-mode clang-format cider-eval-sexp-fu chinese-fonts-setup buffer-move auto-yasnippet auto-highlight-symbol auto-dictionary align-cljlet aggressive-indent adaptive-wrap ace-jump-mode ac-ispell 2048-game))
'(paradox-github-token t)
'(ring-bell-function 'ignore)
'(safe-local-variable-values
Expand Down
2 changes: 1 addition & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ This function should only modify configuration layer settings."
helm-flyspell flyspell-correct-helm clean-aindent-mode
helm-c-yasnippet ace-jump-helm-line helm-make magithub
helm-themes helm-swoop helm-spacemacs-help smeargle
ido-vertical-mode flx-ido company-quickhelp ivy-rich helm-purpose
ido-vertical-mode flx-ido company-quickhelp ivy-rich helm-purpose pyim
)
dotspacemacs-install-packages 'used-only
dotspacemacs-delete-orphan-packages t))
Expand Down
31 changes: 31 additions & 0 deletions layers/zilongshanren-misc/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
;; pyim
lispyville
popup
rime
))

(defun zilongshanren-misc/post-init-popup ()
Expand Down Expand Up @@ -969,6 +970,36 @@ Search for a search tool in the order provided by `dotspacemacs-search-tools'."
(find-file "~/zilongshanren.com/config.toml")))
)

(defun zilongshanren-misc/init-rime ()
(use-package rime
:custom
(rime-librime-root "~/.emacs.d/librime/dist")
:init
(progn
;; 在代码的字符中不临时禁用输入法
(defun +rime-predicate-in-code-string ()
(eq (plist-get (text-properties-at (point)) 'face) 'font-lock-string-face))


(setq default-input-method "rime"
rime-show-candidate 'posframe)

;; 在某些场景下不激活输入法
(setq rime-disable-predicates
'(rime-predicate-evil-mode-p
rime-predicate-after-alphabet-char-p
rime-predicate-punctuation-after-space-cc-p
rime-predicate-space-after-cc-p
rime-predicate-prog-in-code-p
+rime-predicate-in-code-string))

(setq rime-user-data-dir "~/Library/Rime/")
)
:config
(progn
(define-key rime-active-mode-map (kbd "s-j") 'rime-inline-ascii)
)))

(defun zilongshanren-misc/post-init-pyim ()
(progn
;; use librime as wubi input
Expand Down
1 change: 1 addition & 0 deletions layers/zilongshanren-org/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
(advice-add 'org-schedule :after 'org-save-all-org-buffers)
(advice-add 'org-deadline :after 'org-save-all-org-buffers)
(advice-add 'org-store-log-note :after 'org-save-all-org-buffers)
(advice-add 'org-pomodoro :after 'org-save-all-org-buffers)

;; (defun th/org-outline-context-p ()
;; (re-search-backward org-outline-regexp))
Expand Down
Binary file removed liberime.so
Binary file not shown.

0 comments on commit 812eb05

Please sign in to comment.