更新.emacs
(add-to-list 'load-path "~/.emacs.d/lisp/")
(load "key.el")
然后在.emacs.d中新建文件夹lisp,并新建文档key.el,接下来的代码默认插入在文件key.el中。
透明度
单纯有配色还是不够有感觉,接下来的代码设置F7为透明度切换按键。(这里是代码出处)
(global-set-key [(f7)] 'loop-alpha)
(setq alpha-list '((85 55) (65 35) (100 100)))
(defun loop-alpha ()(interactive)(let ((h (car alpha-list)))(set-frame-parameter (selected-frame) 'alpha h)(add-to-list 'default-frame-alist (cons 'alpha h))(setq alpha-list (cdr (append alpha-list (list h))))))
(loop-alpha)
原代码有些地方比较重复,稍作了一些修改,并且把透明情况减为三种了,按F7可切换。如果要理解代码意思必须懂得lisp语言的队列概念。
一些方便的按键
(global-set-key (kbd "M-n")(lambda () (interactive) (next-line 5)))
(global-set-key (kbd "M-p")(lambda () (interactive) (previous-line 5)))
(global-set-key "\C-j"'newline-and-indent)
(global-set-key (kbd "C-")(kbd "C-x "))
(global-set-key (kbd "C-")(kbd "C-x "))