zoukankan      html  css  js  c++  java
  • emacs for OCaml

    
    
    (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 "
    " "/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)
    
    
  • 相关阅读:
    input在输入后回车会刷新当前页面解决
    JS生成当前页面URL二维码
    页面点击特效
    Datetime 使用详解
    三元运算符
    获取checkbox所选中的值
    获取select中所选中option值
    ashx
    python flask 如何读取数据库数据并返回到html
    python3.5+installer 将.py 打包成.exe
  • 原文地址:https://www.cnblogs.com/qsort/p/6683012.html
Copyright © 2011-2022 走看看