$Emacs -q
(add-to-list 'load-path "~/.emacs.d/site-lisp/magit/lisp")
(require 'magit)
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/"))
(package-initialize)
Meta-x package-list-packages
來列出所有套件,要安裝套件時,只要游標移到那的套件,按 i (install) 然後 x (execute) 回覆 yes 即可安裝,要移除的話,一樣游標移到套件,按 d (delete) 然後 x (execute) 回覆 yes
Meta-x package-install
然後輸入套件名稱Meta-x package-delete
然後套件名稱;; 如果未安裝 use-package,安裝它
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package))
;; 使用 diminish (隱藏)及 bind-key 套件
(use-package diminish :ensure t)
(use-package bind-key :ensure t)
;; 使用自動更新套件
(use-package auto-package-update
:ensure t
:config
(setq auto-package-update-delete-old-versions t)
(setq auto-package-update-hide-results t)
(auto-package-update-maybe))
;; 關掉 menu-bar
menu-bar-mode -1)
;; 顯示配對的括號
(show-paren-mode t)
;; 使用 monoj-dark 主題
(load-theme 'manoj-dark t)
;; 自動加入右括號及右 '
(electric-pair-mode t)
(setq electric-pair-pairs '(
(?\' . ?\')
))
;; 不使用 tab
(setq-default indent-tabs-mode nil)
;; 移動視窗
(winner-mode t)
Meta-x customize-themes
,按下 Enter 鍵可以預覽效果
(setq custom-file "~/.emacs.d/custom-variables.el")
(when (file-exists-p custom-file)
(load custom-file))
(defconst emacs-tmp-dir (format "%s%s%s/" temporary-file-directory "emacs" (user-uid)))
(setq backup-directory-alist `((".*" . ,emacs-tmp-dir)))
(setq auto-save-file-name-transforms `((".*" ,emacs-tmp-dir t)))
(setq auto-save-list-file-prefix emacs-tmp-dir)
;;
;; hideshow
;;
(add-hook 'prog-mode-hook #'hs-minor-mode)
;;
;; multiple cursors
;;
(use-package multiple-cursors
:ensure t
:bind (
("M-3" . mc/mark-next-like-this)
("M-4" . mc/mark-previous-like-this)
:map ctl-x-map
("\C-m" . mc/mark-all-dwim)
("<return>" . mule-keymap)
))
相關簡報,請看 我的部落格