Add haskell mode, update ocaml mode
This commit is contained in:
parent
005fb4fcfb
commit
c169983db6
9 changed files with 74 additions and 18 deletions
|
|
@ -27,7 +27,7 @@
|
|||
(setq-local
|
||||
ctags/refresh-command
|
||||
(format
|
||||
"uctags -e -R --languages=C -f %sTAGS %s/*"
|
||||
"ctags -e -R --languages=C -f %sTAGS %s/*"
|
||||
(projectile-project-root) (projectile-project-root))))
|
||||
|
||||
(add-hook 'c-mode-hook 'activate-clang-mode)
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@
|
|||
(setq-local
|
||||
ctags/refresh-command
|
||||
(format
|
||||
"uctags -e -R --languages=erlang -f %sTAGS %ssrc %sdeps %sapps %s_build %stest %slib/stdlib-* %slib/kernel-*"
|
||||
"ctags -e -R --languages=erlang -f %sTAGS %ssrc %sdeps %sapps %s_build %stest %slib/stdlib-* %slib/kernel-*"
|
||||
(projectile-project-root) (projectile-project-root)
|
||||
(projectile-project-root) (projectile-project-root)
|
||||
(projectile-project-root) (projectile-project-root)
|
||||
|
|
|
|||
39
languages/haskell.el
Normal file
39
languages/haskell.el
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
;;; haskell.el --- summary
|
||||
|
||||
;; Author: Maciej Szlosarczyk
|
||||
;; Maintainer: Maciej Szlosarczyk
|
||||
;; Version: 0.1-snapshot
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; haskell does a thing.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require '05prog-mode "$HOME/.emacs.d/05prog-mode.el")
|
||||
(require '05flycheck "$HOME/.emacs.d/05flycheck.el")
|
||||
(require '05hydra "$HOME/.emacs.d/05hydra.el")
|
||||
|
||||
(use-package haskell-mode
|
||||
:ensure t
|
||||
:defer t)
|
||||
|
||||
(use-package dante
|
||||
:ensure t
|
||||
:defer t
|
||||
:requires (haskell-mode))
|
||||
|
||||
(defun activate-haskell-mode ()
|
||||
"Run this in haskell-mode."
|
||||
(set-indent 2)
|
||||
(column-enforce-n 80)
|
||||
|
||||
;; Company list override
|
||||
(add-to-list (make-local-variable 'company-backends)
|
||||
'(dante-company company-yasnippet)))
|
||||
|
||||
(add-hook 'haskell-mode-hook 'dante-mode)
|
||||
(add-hook 'haskell-mode-hook 'activate-haskell-mode)
|
||||
|
||||
(provide 'languages/haskell)
|
||||
;;; haskell.el ends here
|
||||
|
|
@ -3,10 +3,10 @@
|
|||
;;; Code:
|
||||
|
||||
(use-package tuareg
|
||||
:defer t
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'tuareg-mode-hook 'merlin-mode))
|
||||
:defer t
|
||||
:ensure t
|
||||
:config
|
||||
(add-hook 'tuareg-mode-hook 'merlin-mode))
|
||||
|
||||
(use-package merlin
|
||||
:defer t
|
||||
|
|
@ -17,16 +17,27 @@
|
|||
:ensure t
|
||||
:config (setq refmt-command 'opam))
|
||||
|
||||
(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share")))))
|
||||
(when (and opam-share (file-directory-p opam-share))
|
||||
;; Register Merlin
|
||||
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
||||
(autoload 'merlin-mode "merlin" nil t nil)
|
||||
;; Use opam switch to lookup ocamlmerlin binary
|
||||
(setq merlin-command 'opam)))
|
||||
(use-package dune
|
||||
:defer t
|
||||
:ensure t)
|
||||
|
||||
(defun load-ocaml-site-packages ()
|
||||
"Generate ocaml config."
|
||||
(let ((opam-share (ignore-errors (car (process-lines "opam" "config" "var" "share")))))
|
||||
(when (and opam-share (file-directory-p opam-share))
|
||||
;; Register Merlin
|
||||
(add-to-list 'load-path (expand-file-name "emacs/site-lisp" opam-share))
|
||||
(autoload 'merlin-mode "merlin" nil t nil)
|
||||
(autoload 'ocamlformat "ocamlformat" nil t nil)
|
||||
(autoload 'utop "utop" nil t nil)
|
||||
(autoload 'dune "dune" nil t nil)
|
||||
|
||||
;; Use opam switch to lookup ocamlmerlin binary
|
||||
(setq merlin-command 'opam))))
|
||||
|
||||
;; OCaml setup
|
||||
(add-hook 'tuareg-mode-hook 'merlin-mode)
|
||||
(add-hook 'tuareg-mode-hook 'load-ocaml-site-packages)
|
||||
|
||||
;; Reason setup
|
||||
(add-hook 'reason-mode-hook
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
;; Set specific ctags command
|
||||
(setq-local ctags/refresh-command
|
||||
(format "uctags -e -R --languages=ruby -f %sTAGS %s. $(bundle list --paths)"
|
||||
(format "ctags -e -R --languages=ruby -f %sTAGS %s. $(bundle list --paths)"
|
||||
(projectile-project-root) (projectile-project-root))))
|
||||
|
||||
(add-hook 'ruby-mode-hook 'enh-ruby-mode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue