|
|
| (9 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| == basic ==
| | 已全面采用 github 管理。 |
| <syntaxhighlight lang="elisp" line>
| |
| ;; (set-face-attribute 'default nil :font "DejaVu Serif:pixelsize=30")
| |
| ;; (set-fontset-font t 'han "TW-MOE-Std-Kai:pixelsize=30")
| |
| ;; (set-fontset-font t 'han "WenQuanYi Zen Hei:pixelsize=25" nil 'append)
| |
| ;; DejaVu Serif, TW-MOE-Std-Kai, WenQuanYi Micro Hei
| |
| (set-face-attribute 'default nil :height 160)
| |
| (set-fontset-font t 'han "WenQuanYi Micro Hei:pixelsize=20")
| |
| </syntaxhighlight>
| |
| | |
| == onoff ==
| |
| <syntaxhighlight lang="elisp" line>
| |
| (load-theme 'adwaita t)
| |
| </syntaxhighlight>
| |
| | |
| == packages ==
| |
| <syntaxhighlight lang="elisp" line>
| |
| ;; List the packages want to install
| |
| (setq package-list '(
| |
| benchmark-init
| |
| use-package
| |
| which-key
| |
| company
| |
| magit
| |
| yaml-mode
| |
| yasnippet
| |
| smart-compile
| |
| markdown-mode
| |
| lsp-mode
| |
| sdcv
| |
| | |
| ;; auctex
| |
| ;; let-alist ;; for pdf-tools
| |
| ;; tablist ;; for pdf-tools
| |
| ;; cask ;; for pdf-tools
| |
| ;; pdf-tools
| |
| ;; youdao-dictionary
| |
| | |
| ;; Opt
| |
| ;; ace-window
| |
| web-mode
| |
| projectile
| |
| htmlize
| |
| edit-server
| |
| mediawiki
| |
| ))
| |
| | |
| (unless package-archive-contents
| |
| (package-refresh-contents))
| |
| | |
| ;; Install the missing packages
| |
| (dolist (package package-list)
| |
| (unless (package-installed-p package)
| |
| (package-install package)))
| |
| | |
| ;; (pdf-tools-install)
| |
| </syntaxhighlight>
| |
| | |
| == defun ==
| |
| === say-ok-after-server-edit ===
| |
| <syntaxhighlight lang="elisp" line>
| |
| ;; 抄自 https://www.emacswiki.org/emacs/YesOrNoP,负作用不详,symbol-function 不懂
| |
| ;; 作用为:建议server-edit函数执行后的询问是否保存,一概选是
| |
| ;; (defadvice server-edit (around auto-confirm compile activate)
| |
| ;; (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest args) t))
| |
| ;; ((symbol-function 'y-or-n-p) (lambda (&rest args) t)))
| |
| ;; ad-do-it)
| |
| ;; (sanityinc/maybe-suspend-frame))
| |
| | |
| (defadvice kill-current-buffer (around auto-confirm compile activate)
| |
| (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest args) t))
| |
| ((symbol-function 'y-or-n-p) (lambda (&rest args) t)))
| |
| ad-do-it)
| |
| (sanityinc/maybe-suspend-frame))
| |
| </syntaxhighlight>
| |
| | |
| === t-mw-define ===
| |
| <syntaxhighlight lang="elisp" line>
| |
| (defun t-mw-define ()
| |
| (interactive)
| |
| "give mediawiki define element a :"
| |
| (replace-regexp "^ ?" ": " nil))
| |
| </syntaxhighlight>
| |
| | |
| == hooks ==
| |
| <syntaxhighlight lang="elisp" line>
| |
| (add-hook 'after-init-hook 'benchmark-init/activate)
| |
| (add-hook 'dired-mode-hook 'dired-hide-details-mode t)
| |
| | |
| ;; (add-hook 'after-init-hook #'auto-save-visited-mode)
| |
| ;; (setq auto-save-visited-interval 1)
| |
| ;; (add-hook 'pdf-view-mode-hook 'pdf-view-auto-slice-minor-mode)
| |
| </syntaxhighlight>
| |
| | |
| == tranlate ==
| |
| === sdcv ===
| |
| <syntaxhighlight lang="elisp" line>
| |
| ;; 直接按 f1 即可用
| |
| ;; 需 sudo apt install stardict sdcv,待验证
| |
| ;; 需 posframe
| |
| | |
| (require 'sdcv)
| |
| ;; (require 'company-english-helper) ;; 似乎存在字体 bug,对硬件要求很高,也不实用,暂且搁置
| |
| | |
| (setq sdcv-say-word-p t)
| |
| (setq sdcv-dictionary-data-dir "/home/qlzq/Documents/En") ;setup directory of stardict dictionary
| |
| (setq sdcv-dictionary-simple-list ;setup dictionary list for simple search
| |
| '("简明英汉字典增强版"))
| |
| (setq sdcv-dictionary-complete-list ;setup dictionary list for complete search Etymonline
| |
| '("简明英汉字典增强版"))
| |
| | |
| (global-set-key (kbd "C-x t C-d") 'sdcv-search-input)
| |
| (global-set-key (kbd "C-x t d") 'sdcv-search-pointer+)
| |
| (global-set-key (kbd "<f1>") 'sdcv-search-pointer+)
| |
| </syntaxhighlight>
| |
| | |
| === goldendict ===
| |
| <syntaxhighlight lang="elisp" line>
| |
| ;; 直接输命令 +dict- 即可用
| |
| ;; 无需额外依赖
| |
| (defun +dict-word-at-point ()
| |
| "Search word in goldendict"
| |
| (interactive)
| |
| (call-process-shell-command (concat "goldendict " (current-word) " &") nil 0))
| |
| </syntaxhighlight>
| |
| | |
| === fanyi ===
| |
| <syntaxhighlight lang="elisp" line>
| |
| ;; 直接输入命令 fanyi- 即可用
| |
| ;; 依赖 fanyi.el
| |
| ;; M-x package-install RET fanyi RET 即可
| |
| (custom-set-variables
| |
| '(fanyi-providers '(fanyi-haici-provider
| |
| fanyi-youdao-thesaurus-provider
| |
| fanyi-etymon-provider
| |
| fanyi-longman-provider)))
| |
| </syntaxhighlight>
| |
| | |
| == mediawiki ==
| |
| <syntaxhighlight lang="elisp" line>
| |
| '(mediawiki-site-alist
| |
| '(("name" "http://n.n.n.n/mediawiki/" "user" "passwd" nil "Main Page")
| |
| ("name" "https://someplace.com/mediawiki/" "user" "passwd" nil "Main Page")))
| |
| </syntaxhighlight>
| |
| | |
| == end ==
| |
| <syntaxhighlight lang="elisp" line>
| |
| | |
| ;; (setq markdown-command "/usr/bin/pandoc")
| |
| | |
| (provide 'init-local)
| |
| ;; init-local.el ends here.
| |
| </syntaxhighlight>
| |