Emacs安装及使用
-
下载
环境:Window8.1;64位
官网:http://ftp.gnu.org/gnu/emacs/windows/
下载emacs-26.2-x86_64.zip
解压路径 D:\software\emacs-26.1 -
安装
不用安装,解压后就能用
D:\software\emacs-26.1\bin\ runemacs.exe -
配置
3.1 修改注册表;
a) 键盘上的windows+r调出运行命令
b) 输入“regedit”
c)找到HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs(如果没有则手动添加项)
d)添加字符串值,名称为HOME,值为D:\software\emacs-26.1
3.2 看.emacs配置文件路径是否改好了
a) 启动emacs,点击Options菜单,随便点击一两个选项,比如点击一下Active Region Highlighting,
b) 然后点击Save Options。
c) 观察你的Emacs窗口 最后一行,是否显示“Wrote D:/software/emacs-26.1/.emacs”。 -
Verilog-mode
下载.el文件——放入elisp文件夹——配置.emacs文件
a) 在https://www.veripool.org/projects/verilog-mode/wiki/Installing下载verilog-mode.el
b) 在D:/software/emacs-26.1下建立elisp文件夹
c)在D:/software/emacs-26.1.emacs中添加以下内容
(defun prepend-path ( my-path )
(setq load-path (cons (expand-file-name my-path) load-path)))
(defun append-path ( my-path )
(setq load-path (append load-path (list (expand-file-name my-path)))))
;; Look first in the directory ~/elisp for elisp files
;; 以下路径要修改为如: c:\\Users\\your_user_name\\AppData\\Roaming\\elisp,注意使用双斜杠
(prepend-path "D:\\software\\emacs-26.1\\elisp")
;; Load verilog mode only when needed
(autoload 'verilog-mode "verilog-mode" "Verilog mode" t )
;; Any files that end in .v, .dv or .sv should be in verilog mode
(add-to-list 'auto-mode-alist '("\\.[ds]?v\\'" . verilog-mode))
;; Any files in verilog mode should have their keywords colorized
(add-hook 'verilog-mode-hook '(lambda () (font-lock-mode 1)))
- 其他
a) 更改背景色
.emacs中添加
(set-background-color "gray")
b) 左侧加行号
.emacs中添加
(global-linum-mode 1)
(setq linum-format "%d| ")