emacs on MacOS 初步配置

0x00 本文做了些啥?

記錄了在MacOS系統中 安裝,配置Emacs的基礎使用.

0x01 安裝Emacs

brew install --cask emacs

0x02 配置文件

vim ~/.emacs
  • 初始配置

增加melpa 插件庫管理配置,以及 meta 鍵切換, 還有GUI基礎配置

(require 'package)
(add-to-list'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

;;防止反覆調用 package-refresh-contents 會影響加載速度
(when (not package-archive-contents)
  (package-refresh-contents))


;; Mac 綁定 Command to Meta
(setq mac-command-modifier 'meta)
(setq mac-option-modifier 'none)

;; GUI 配置
(setq inhibit-startup-message t)
(setq visible-bell nil)
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(global-display-line-numbers-mode 1)
  • 啓動後, 刷新一下插件列表:
M-x package-refresh-contents
  • 查看插件列表
M-x package-list-packages

0x03 安裝主題 exotica-theme

M-x package-install <RET> exotica-theme <RET>
  • 啓用主題:
M-x customize-themes <RET>

選擇 exotica , 然後點選上面的保存選項

0x04 安裝目錄管理器 treemacs

M-x package install <RET> treemacs <RET>

具體使用方法,參考這裏
簡單使用:

# 打開目錄
M-x treemacs <RET>

# 切換目錄
M-x treemacs-select-directory <RET>

啓動 emacs後, M-x treemacs 進入目錄模式, 支持鼠標操作

後面, 不定期更新 ~

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章