〇、基础
1、emacs下载
官网 :
下载 :
文件 :
- emacs-26.1-x86_64.zip
- emacs-26.1-x86_64-no-deps.zip
2、安装emacs
- 解压并重命名 emacs-26.1-x86_64.zip 到所需安装位置,如:
D:\emacs-26.1
- 解压并拷贝 emacs-26.1-x86_64-no-deps.zip 到 D:\emacs-26.1
3、配置HOME目录
- 在注册表中添加 计算机\HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs 项
- 为Emacs项添加字符串值
名称 数据 HOME D:\emacs-26.1
4、emacs编辑环境
网址:https://www.ibm.com/developerworks/cn/education/aix/emacs1/index.html
5、elisp
网址:http://ergoemacs.org/emacs/elisp.html
一、颜色配置
1、molokai配色
- 下载地址:https://github.com/hbin/molokai-theme
- init.el配置:
(setq molokai-theme-kit t)
(add-to-list ‘custom-theme-load-path "your path")
(load-theme ‘molokai t) ;; 或在custom themes中选中molokai配色方案
2、solarized配色
- 下载地址:https://github.com/sellout/emacs-color-theme-solarized
- init.el配置:
(add-to-list ‘custom-theme-load-path "your path")
(load-theme ‘solarized t)
3、color-theme配色
- 下载地址 : http://www.nongnu.org/color-theme/
- init.el配置:
(add-to-list ‘load-path "your path")
(require ‘color-theme)
(color-theme-initialize)
(color-theme-xxx) ;;xxx适当主题
- 选择主题:
M-x color-theme-select
二、字体配置
0、dejavu-fonts下载地址:
https://dejavu-fonts.github.io/Download.html
1、默认设置
菜单栏 : Option->Set default font
init.el:
(set-default-font "-outline-consolas-normal-r-normal-normal-14-97-96-96-c-*-iso8859-1")
2、中英文等宽设置(解决emacs 26版本中遇中文卡顿问题):
(defun set-font (english chinese english-size chinese-size)
(set-face-attribute ‘default nil :font
(format "%s:pixelsize=%d" english english-size))
(dolist (charset ‘(kana han symbol cjk-misc bopomofo))
(set-fontset-font (frame-parameter nil ‘font) charset
(font-spec :family chinese :size chinese-size))))
(set-font "Dejavu Sans Mono" "WenQuanYi Zen Hei Mono" 14 14)
三、编码设置
(set-language-environment ‘UTF-8)
(set-locale-environment "UTF-8")
四、melpa安装
1、配置package
1)添加插件源
(add-to-list ‘package-archives ‘("melpa" . "http://melpa.org/packages/") t))
2)在init.el开始初始化package
(package-initialize)
3)源网址:
清华镜像 :https://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/
emacs-china :http://elpa.emacs-china.org/melpa/
melpa :http://melpa.org/packages/
2、安装插件(之后需按照purcell重新调节组织结构优化)
(defvar my/packages ‘(
;; packages
company
;;evil
) "Default packages")
(setq package-selected-packages my/packages)
(defun my/packages-installed-p ()
(loop for pkg in my/packages
when (not (package-installed-p pkg)) do (return nil)
finally (return t)))
(unless (my/packages-installed-p)
(message "%s" "Refreshing package database...")
(package-refresh-contents)
(dolist (pkg my/packages)
(when (not (package-installed-p pkg))
(package-install pkg))))
原文地址:https://www.cnblogs.com/eat-and-die/p/10048709.html
时间: 2024-11-13 13:09:30