zoukankan      html  css  js  c++  java
  • emacs配置笔记(windows10)

    1.安装

    1、 emacs官网获取安装程序:

    http://www.gnu.org/software/emacs/

    2.、GNU Emacs for Windows can be downloaded from a nearby GNU mirror; or the main GNU FTP server.
    Unzip the zip file preserving the directory structure, and run bin unemacs.exe. Alternatively, create a desktop shortcut to bin unemacs.exe, and start Emacs by double-clicking on that shortcut's icon

    3、配置文件路径配置

    官方说明:

    On Windows, the .emacs file may be called _emacs for backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name, because Explorer cannot create a file with a name starting with a dot, even though the filesystem and most other programs can handle it. In Emacs 22 and later, the init file may also be called.emacs.d/init.el. Many of the other files that are created by lisp packages are now stored in the.emacs.ddirectory too, so this keeps all your Emacs related files in one place.

    All the files mentioned above should go in your HOME directory. The HOME directory is determined by following the steps below:

    1. If the environment variableHOME is set, use the directory it indicates.
    2. If the registry entry HKCUSOFTWAREGNUEmacsHOME is set, use the directory it indicates.
    3. If the registry entry HKLMSOFTWAREGNUEmacsHOME is set, use the directory it indicates. Not recommended, as it results in users sharing the same HOME directory.
    4. If C:.emacs exists, then use C:/. This is for backward compatibility, as previous versions defaulted to C:/if HOME was not set.
    5. Use the user's AppData directory, usually a directory called Application Data under the user's profile directory, the location of which varies according to Windows version and whether the computer is part of a domain.

    参考:https://blog.csdn.net/lihenair/article/details/19050479

    方法一:原文:https://blog.csdn.net/zhuxiaoyang2000/article/details/8819601

      默认情况下,Windows系统中Emacs的配置文件.emacs在C:Users<username>AppDataRoaming。这个目录很深,而且默认状态下AppData目录是隐藏的。最最关键的是:如果系统盘一旦出问题,之前的.emacs配置文件和.el的扩展都得重新配置和下载。可以用如下方式重新配置Emacs默认目录。
    启动emacs,在 Option 菜单中随便更改一下设置,如 取消Ignore Case for Search,之后点 Save Options。这一步不是多余的哦,因为默认情况下emacs不会在一启动的时候就生成 .emacs 配置文件和 .emacs.d目录的。这步生成的 .emacs 目录还是在 C:Users<username>AppDataRoaming 下,因为我们并没有做别的设置移动它嘛~
    下面就进入关键步骤了,打开 C:Users<username>AppDataRoaming.emacs 配置文件,修改内容为
    (load-file "D:/OpenSource/emacs-24.3/.emacs")
    (注意用“/”而非“”,否则Emacs不能正确识别)这个配置意思很明显了,emacs在启动的时候会加载 C:/Users/<username>/AppData/Roaming/.emacs 这个配置文件,而该文件又加载另一个 D:/OpenSource/emacs-24.3/.emacs 配置文件。这样,自然就成功实现了配置的转移喽~好了,从现在起就不用进入 C:/Users/<username>/AppData/Roaming/.emacs 这个冗的路径喽!
    上一步,我们把emacs的配置文件用 (load-file ...) 配置已经指向到 D:/OpenSource/emacs-24.3/.emacs 了,那就拷贝 .emacs 文件放到 D:/OpenSource/emacs-24.3/ 里吧(Windows下好像不能建立以 . 开头的文件吧)。然后,打开D:/OpenSource/emacs-23.2/.emacs,在开头添加如下配置:
    (setenv "HOME" "D:/OpenSource/emacs-24.3")
    (setenv "PATH" "D:/OpenSource/emacs-24.3")
    ;;set the default file path
    (setq default-directory "~/")
    恩,是的,这里重新给 HOME PATH 等定义了新的路径~~~写到这里大家该明白了,就是把配置转移了一下而已。
    好了,现在就可以了把 D:/OpenSource/emacs-24.3 当成emacs的 HOME了。

    方法二:

      打开注册表,找到HKEY_LOCAL_MACHINESOFTWAREGNUEmacs(如果没有则手动添加项), 在此项下添加字符串值,名称为HOME,值为D:Emacs23.2。这样做的目的是让D:Emacs23.2成为Emacs的home路径(传说中 的home path,以后你将会经常看到“home目录”、“home directory”等等)。


    4、创建配置文件.emacs.d目录和.emacs文件(.emacs文件的优先级更高)

      相信.emacs.d目录和.emacs文件是困扰大家很久的问题了,其实有个简单的办法 可以解决此问题。启动emacs(注:win7系统需要右键“以管理员身份运行”),用鼠标点击Options菜单,随便点击一两个选项,比如点击一下Active Region  Highlighting,然后点击Save  Options。先不要担心你会破坏了什么东西,这样做的目的是让emacs自动创建.emacs.d目录以及.emacs文件!观察你的Emacs窗口 最后一行,是否显示“Wrote D:/Emacs23.2/.emacs”?如果是的话就对了,当你选择Save  Options的时候,Emacs会在home路径下产生.emacs文件,并把配置信息写进这个文件。D:Emacs23.2目录下将会产生这两个文件。


     

  • 相关阅读:
    Android 6.0权限
    从最简单的HelloWorld理解MVP模式
    DataSet、DataTable和DataGridView知识备忘
    Windows 窗体启动和关闭的事件顺序
    VB二进制文件读写
    C#操作符的重载
    虚方法(virtual)和抽象方法(abstract)的区别
    我的前端页面开发js简易有效环境
    css properties
    css属性值语法解读
  • 原文地址:https://www.cnblogs.com/x-police/p/10826138.html
Copyright © 2011-2022 走看看