Emacs配置记录

来源:互联网 发布:电脑便签软件 编辑:程序博客网 时间:2024/06/07 22:07

Emacs配置记录

Table of Contents

  • 1 前言
  • 2 去掉启动画面
  • 3 配色方案
  • 4 emacs写perl程序
  • 5 org模式
    • 5.1 org模式导出pdf问题
      • 5.1.1 导出tex格式
      • 5.1.2 导出html,然后打印
      • 5.1.3 修改org的配置
  • 6 emacs自动补全

1 前言

以前用传说中的大神的配置,也折腾了好多会了,里面有很多有用的东西,但是 对emacs的配置,并没有太多的进步,出了问题,也不知道怎么解决,所以我觉 得我们要的不是emacs大神的配置,而是他的思想,在以后的过程中会通过查看 大神的配置而模仿其精华,当然有可能都是精华。比如说自动补全括号这方面, 还是会遇到很多问题,如果你设置了小于号的补全,那么当你要输入程序的时候 <s +tab就不管用了。所以还要即使总结和更新

2 去掉启动画面

在.emacs.d里新建init.el文件,然后在里面添加一行

;;隐藏开始的启动画面(setq inhibit-startup-message t)

3 配色方案

下载color-theme然后解压,将其中的文件color-theme和theme文件夹复制到~/。emacsd 的文件夹内。然后打开init.el,添加

(add-to-list 'load-path' "~./.emacs.d/")(require 'color-theme)(color-theme-initialize)(color-theme-matrix)

打开emacs后,tools下会有一个color themes,点击后会出现很多的主题,名字,Enter会显示 效果。找到合适的主题后,修改上面配置中的最后一行。然后重新打开emacs就可以看到效果了 注意:主题的名称如果有空格那么用连字符代替,用小写字母就可以。

4 emacs写perl程序

在一下网址,我们找到这篇文章,摘录如下: www.khngai.com/emacs/perl.php

;;Using Emacs for Perl Programming ;;There is a default perl-mode for Emacs. However, ;;there is a better one hidden within Emacs. ;;The following lisp statements will activate cperl-mode.;;Emacs中的perl-mode虽好,但是还有一个更好的内置mode,cperl-mode;; Use cperl-mode instead of the default perl-mode;; 用cpel-mode来代替默认的perl-mode(add-to-list 'auto-mode-alist '("\\.\\([pP][Llm]\\|al\\)\\'" . cperl-mode))(add-to-list 'interpreter-mode-alist '("perl" . cperl-mode))(add-to-list 'interpreter-mode-alist '("perl5" . cperl-mode))(add-to-list 'interpreter-mode-alist '("miniperl" . cperl-mode));;Since I do not like the default indentations, I have the followings:;;但是我太喜欢默认的perl-mode中的缩进了,所以我按照下面这样做(add-hook 'cperl-mode-hook 'n-cperl-mode-hook t)(defun n-cperl-mode-hook ()  (setq cperl-indent-level 4)  (setq cperl-continued-statement-offset 0)  (setq cperl-extra-newline-before-brace t)  (set-face-background 'cperl-array-face "wheat")  (set-face-background 'cperl-hash-face "wheat")  );;Using Emacs for Perl Scripts ;;If you have perl installed on your computer,;; you may debug a perl script by simply typing "alt-x perldb" "perl -d myscript.pl". ;;Once the command is entered, you will see 2 buffers in Emacs,;; the top buffer is the debugger, the bottom buffer is your perl script.

5 org模式

5.1 org模式导出pdf问题

因为有中文的存在,所有如果不加配置直接是不能导出的,导出的PDF也是 不含中文的,没办法看,所以我们这里来提供几种思考的方案。

5.1.1 导出tex格式

我们在导出tex的格式是没有任何的问题的,然后我们打开tex的文件,进行 修改,也就是开始的语句改成:
\documentclass[UTF8,adobefonts]{ctexart}
然后再在命令行中用xelatex命令导出pdf。这个方法经过实践是可行的。

5.1.2 导出html,然后打印

自然这种方法是可行的

5.1.3 修改org的配置

这个难度较大,以后再学习。

6 emacs自动补全

Date: 2013-06-30T19:32+0800

Author: grc

Org version 7.9.3f with Emacs version 24

Validate XHTML 1.0
原创粉丝点击