Emacs的简单配置

初识Emacs,被网上的众多“最强”的配置文件(~/.emacs)弄得云山雾罩,找不着北。在不知所措时,硬着头皮,读了Emacs、org-mode和color-theme的文档,并做了简单的配置,觉得作为文档编辑、HTML编辑和日常应用已经足够,日后只有在战争中学习战争,完善其功能。


现将最简单的配置晒晒,请各位老鸟多指教。

;;author: 一意孤行
;;e-mail: zz55109@gmail.com


;;------------------环境设置-------------------------------
;;color-theme设置
(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0/")
(require 'color-theme)
(eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-deep-blue)))

;;关闭开机画面
(setq inhibit-startup-message t)  

;; 在标题栏提示你目前在什么位置
(setq frame-title-format "一意孤行@%b")

;;显示行号
(global-linum-mode 1)  

;;高亮当前行:hi-line.el,emacs自己带的
(require 'hl-line)
(global-hl-line-mode t)

;;设置sentence-end可以识别中文标点
(setq sentence-end "\\([。!?]\\|……\\|[.?!][]\"')}]*\\($\\|[ \t]\\)\\)[ \t\n]*")
(setq sentence-end-double-space nil)

;;让emacs可以直接打开和显示图片
(auto-image-file-mode)

;;显示时间设置
(setq display-time-24hr-format t)
(setq display-time-day-and-date t)
(display-time)

;;以 y/n代表 yes/no
(fset 'yes-or-no-p 'y-or-n-p)

;;iimage mode
(autoload 'iimage-mode "iimage" "Support Inline image minor mode." t)
(autoload 'turn-on-iimage-mode "iimage" "Turn on Inline image minor mode." t)


;;org-mode配置
(require 'org-install)
(require 'org-publish)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(add-hook 'org-mode-hook 'turn-on-font-lock)
(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)
(setq org-publish-project-alist
      '(("note-org"
         :base-directory "/home/org/org"
         :publishing-directory "/home/org/publish"
         :base-extension "org"
         :recursive t
         :publishing-function org-publish-org-to-html
         :auto-index nil
         :index-filename "index.org"
         :index-title "index"
         :link-home "index.html"
         :section-numbers nil
         :style "<link rel=\"stylesheet\"
    href=\"./style/emacs.css\"
    type=\"text/css\"/>")
        ("note-static"
         :base-directory "/home/org/org"
         :publishing-directory "/home/org/publish"
         :recursive t
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|swf\\|zip\\|gz\\|txt\\|el"
         :publishing-function org-publish-attachment)
        ("note"
         :components ("note-org" "note-static")
         :author "zz55109@gmail.com"
         )))
;;org-mode自动换行
(add-hook 'org-mode-hook
(lambda () (setq truncate-lines nil)))



(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.
 '(display-time-mode t))
(custom-set-faces
 ;; custom-set-faces 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.
 '(default ((t (:family "文泉驿正黑" :foundry "unknown" :slant normal :weight normal :height 143 :width normal)))))

各位和我一样的初学者,Emacs24对于新手的亲和力,其内置了org-mode,默认就能够正常工作,所要做的配置并不多。

color-theme是对Emacs应用风格显示的一些设定,按照其文档说明做一些简单的设置即可。PATH路径,得准确。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值