读书人

Emacs中配置文件管理跟添加日期

发布时间: 2012-07-08 17:43:43 作者: rapoo

Emacs中配置文件管理和添加日期
在.emacs中添加配置加载目录:
(mapc 'load(directory-files "d:/doc/emacs-conf" t "\\.el$"))


在目录:d:/doc/emacs-conf下面放入以.el结尾的elisp配置文件:

例如:.emacs.el

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(inhibit-startup-screen t)
'(make-backup-files nil))


.insert-date-and-time.el

(defvar current-date-time-format "%A %D %r")
(defvar current-time-format "%a %H:%M:%S")
(defun insert-current-date-time ()
(interactive)
(insert (format-time-string current-date-time-format (current-time)))
(insert "\n")
)
(defun insert-current-time ()
(interactive)
(insert (format-time-string current-time-format (current-time)))
(insert "\n")
)
(global-set-key "\C-c\C-d" 'insert-current-date-time)
(global-set-key "\C-c\C-t" 'insert-current-time)
1 楼 7-11 2011-10-27 windows上面获取emacs:
http://mirror.bjtu.edu.cn/gnu/emacs/windows/

读书人网 >开源软件

热点推荐