(require 'cl)

(require 'package)
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(add-to-list 'package-archives
'("gnu" . "http://elpa.gnu.org/packages/"))
(package-initialize) ;; -- Tweaks for OS X -------------------------------------
;; Tweak for problem on OS X where Emacs.app doesn't run the right
;; init scripts when invoking a sub-shell
(cond
((eq window-system 'ns) ; macosx
;; Invoke login shells, so that .profile or .bash_profile is read
(setq shell-command-switch "-lc"))) ;; mouse
(require 'xt-mouse)
(xterm-mouse-mode)
(require 'mouse)
(xterm-mouse-mode t)
(defun track-mouse (e))
(global-set-key [mouse-4] (lambda () (interactive) (scroll-down 1)))
(global-set-key [mouse-5] (lambda () (interactive) (scroll-up 1))) ;; disable splash screens
(setq inhibit-splash-screen t)
(setq inhibit-startup-message t)
(setq inhibit-startup-echo-area-message t)
(setq initial-scratch-message nil) (load "/Users/louyx/.opam/system/share/emacs/site-lisp/tuareg-site-file") ;; -- opam and utop setup --------------------------------
;; update emacs PATH so it can find opam executable
(add-to-list 'exec-path "/usr/local/bin/")
(add-to-list 'exec-path "/usr/louyx/.opam/system/bin/")
(add-to-list 'load-path
(replace-regexp-in-string "\n" "/share/emacs/site-lisp"
(shell-command-to-string "/usr/local/bin/opam config var prefix"))) ;; Automatically load utop.el
(autoload 'utop-minor-mode "utop" "Minor mode for utop" t)
(add-hook 'tuareg-mode-hook 'utop-minor-mode)
(setq tuareg-indent-align-with-first-arg nil)
(setq utop-command "/usr/local/bin/opam config exec -- utop -emacs") ;; auto complete
(require 'auto-complete)
(ac-config-default)
(global-auto-complete-mode t) ;; -- merlin setup -----------------------------------------
(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share")))))
(when (and opam-share (file-directory-p opam-share))
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
(autoload 'merlin-mode "merlin" nil t nil)
(add-hook 'tuareg-mode-hook 'merlin-mode t)
(add-hook 'caml-mode-hook 'merlin-mode t)))
(setq merlin-ac-setup t)

emacs for OCaml的更多相关文章

  1. 在Emacs中使用GNU Global

    背景 在我平时用Emacs编写C代码时,经常需要进行代码的跳转,主要需求为函数定义的跳转,某个具体函数的调用查找,某个结构体的定义跳转以及结构体中具体某一项的跳转等,GNU Global就能完全满足我 ...

  2. 的vim和emacs常用配置记录

    因为经常改变工作环境,所以在这里记录一下我的.vimrc文件和.emacs文件的内容. vimrc的配置文件,主要是设置语法高亮,和tab键的宽度,个人喜欢设置为4个空格的分量. " set ...

  3. IntelliJ添加Emacs编辑器

    Intellij只支持emacs as a external tool: https://www.jetbrains.com/help/idea/2016.2/tutorial-using-emacs ...

  4. ubuntu 下emacs 配置

    (set-language-environment 'Chinese-GB) (set-keyboard-coding-system 'utf-8) (set-clipboard-coding-sys ...

  5. 我的emacs配置

    我的emacs配置文件 ;; .emacs ;; ============================== Basic Configure START ====================== ...

  6. Emacs 配置文件

    以下是我整理的 emacs 配置文件,供刚开始玩 emacs 的同学参考.网上有人说:emacs 是神的编辑器,如果能够用到这样的编辑器,那这个人就是神了.从我个人的经验来看,emacs 是一把利器, ...

  7. [emacs] 使用ggtags浏览代码

    [emacs] 使用ggtags浏览代码 // */ // ]]>   [emacs] 使用ggtags浏览代码 Table of Contents 1 相关的连接 2 global简介 2.1 ...

  8. Emacs学习心得之 LaTeX编辑

    目录 1. 前言 2. texlive的安装 3. AUCTEX的安装和配置 4. RefTEX的安装和配置 一.前言 本篇博文记录了Emacs下LaTeX编辑环境的搭建,参考一下文章: http:/ ...

  9. 创建.emacs.d目录和.emacs文件

    1.双击bin下的addpm.exe 2.HKEY_CURRENT_USER->Software->GNU->Emacs 新建字符串值HOME,数值数据为emacs的安装路径 3.创 ...

随机推荐

  1. HTML--2图片热点,网页划区,拼接,表单

    图片热点: 规划出图片上的一个区域,可以做出超链接,直接点击图片区域就可以完成跳转的效果. 示例: 网页划区: 在一个网页里,规划出一个区域用来展示另一个网页的内容. 示例: 网页的拼接: 在一个网络 ...

  2. [URAL-1517][求两个字符串的最长公共子串]

    Freedom of Choice URAL - 1517 Background Before Albanian people could bear with the freedom of speec ...

  3. python文件读写方式

    window下换行\r\n linux.unix.mac下都是\n - 以二进制的形式wb写入,同样以二进制的方式读取rb ``` f = open('file name','wb') f.write ...

  4. pycharm注册码地址

    (1)地址:http://idea.lanyus.com/ (2)注意,在破解的时候,是先修改hosts文件所在路径:“C:\Windows\System32\drivers\etc\hosts”,修 ...

  5. 九度OJ 1168:字符串的查找删除 (查找)

    时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:4276 解决:1699 题目描述: 给定一个短字符串(不含空格),再给定若干字符串,在这些字符串中删除所含有的短字符串. 输入: 输入只有1 ...

  6. ABAP 性能优化001

    红方框里那一步之行很慢,lt_iflos这个内表才200多条数据 1.关键是你from那个表有多少数据.... 注意点: 1.不要用 CORRESPONDING FIELDS OF 2.LT_IFLO ...

  7. ABAP 程序运行时间记录表

    自建表记录程序运行时间,测试程序效率,可作为系统优化工具.

  8. 利用wxpython显示OpenCV图像

    核心代码 import wx, cv2 import numpy as np # Start with a numpy array style image I'll call "source ...

  9. 【windows】更改最大动态端口数

    最近业务遇到一个奇怪的问题,一台iis服务器,居然报端口不足的错误,分析应该是服务器可用的动态端口数不够了,windows默认的动态端口范围为:1024-5000,也就是最多3977个动态端口可用,如 ...

  10. Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class

    查阅了资料原始JDK的问题.解决方法 1.重新安装JDK为1.7版本 2.修改配置 1.webx的依赖改为3.1.6版: <dependency> <groupId>com.a ...