Skip to content

Instantly share code, notes, and snippets.

@sinelaw
Created February 10, 2015 16:36
Show Gist options
  • Select an option

  • Save sinelaw/e642d043b9b1d838d1e3 to your computer and use it in GitHub Desktop.

Select an option

Save sinelaw/e642d043b9b1d838d1e3 to your computer and use it in GitHub Desktop.
;;(load "/local-home/user18/repos/thirdparty/emacs-haskell-config/init.el")
(add-to-list 'load-path "~/repos/thirdparty/emacs-haskell-config/packages/haskell-mode/")
(require 'haskell-mode-autoloads)
(add-to-list 'Info-default-directory-list "~/repos/thirdparty/emacs-haskell-config/packages/haskell-mode/")
(require 'cl)
(add-to-list 'load-path "~/.emacs.d/lisp")
(require 'cask "~/.cask/cask.el")
(cask-initialize)
(global-linum-mode t)
(ido-mode t)
(require 'package)
(column-number-mode t)
(delete-selection-mode t)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
(global-undo-tree-mode t)
(global-auto-revert-mode t)
;; ----------------------------------------------------------------------
(require 'eclim)
(global-eclim-mode t)
(require 'eclimd)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(company-backends (quote (company-clang company-emacs-eclim company-elisp company-bbdb company-css company-semantic company-clang company-xcode company-ropemacs company-cmake company-capf (company-dabbrev-code company-gtags company-etags company-keywords) company-oddmuse company-files company-dabbrev)))
'(custom-enabled-themes (quote (wombat)))
'(eclim-eclipse-dirs (quote ("~/Downloads/eclipse")))
'(eclim-executable "~/Downloads/eclipse/eclim")
'(fill-column 100)
'(haskell-complete-module-preferred (quote ("Data.ByteString" "Data.ByteString.Lazy" "Data.Conduit" "Data.Function" "Data.List" "Data.Map" "Data.Maybe" "Data.Monoid" "Data.Ord")))
'(haskell-indent-spaces 4)
'(haskell-indentation-ifte-offset 4)
'(haskell-indentation-layout-offset 4)
'(haskell-indentation-left-offset 4)
'(haskell-indentation-starter-offset 4)
'(haskell-indentation-where-post-offset 4)
'(haskell-indentation-where-pre-offset 4)
'(haskell-interactive-mode-eval-mode (quote haskell-mode))
'(haskell-interactive-mode-eval-pretty nil)
'(haskell-interactive-mode-include-file-name nil)
'(haskell-mode-hook (quote (turn-on-haskell-decl-scan turn-on-haskell-doc turn-on-haskell-indentation interactive-haskell-mode)))
'(haskell-notify-p t)
'(haskell-process-args-cabal-repl (quote ("--ghc-option=-ferror-spans" "--with-ghc=ghci-ng")))
'(haskell-process-args-ghci (quote ("-ferror-spans")))
'(haskell-process-auto-import-loaded-modules t)
'(haskell-process-generate-tags nil)
'(haskell-process-log t)
'(haskell-process-path-ghci "ghci-ng")
'(haskell-process-reload-with-fbytecode nil)
'(haskell-process-suggest-haskell-docs-imports t)
'(haskell-process-suggest-remove-import-lines t)
'(haskell-process-type (quote cabal-repl))
'(haskell-process-use-presentation-mode t)
'(haskell-stylish-on-save nil)
'(haskell-tags-on-save nil)
'(hindent-style "chris-done")
'(indent-tabs-mode nil)
'(inhibit-startup-screen t)
'(safe-local-variable-values (quote ((include-header-prefix . "ELFS__") (eval setq dir-local-curdir (file-name-directory (let ((d (dir-locals-find-file "."))) (if (stringp d) d (car d))))))))
'(shm-auto-insert-bangs t)
'(shm-auto-insert-skeletons t)
'(shm-use-presentation-mode t)
'(show-paren-mode t)
'(show-paren-style (quote expression)))
(setq help-at-pt-display-when-idle t)
(setq help-at-pt-timer-delay 0.1)
(help-at-pt-set-timer)
(require 'company-emacs-eclim)
(company-emacs-eclim-setup)
(global-company-mode t)
(global-git-gutter+-mode +1)
;; ----------------------------------------------------------------------
(smex-initialize)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:inherit nil :stipple nil :background "#121212" :foreground "#f6f3e8" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 128 :width normal :foundry "unknown" :family "Ubuntu Mono"))))
'(shm-current-face ((t (:background "#303030"))) t)
'(shm-quarantine-face ((t (:inherit font-lock-error))) t)
'(show-paren-match ((t (:background "medium blue")))))
(require 'speedbar)
;; (add-hook 'haskell-mode-hook (quote (define-key haskell-mode-map (kbd "C-x C-s") 'haskell-mode-save-buffer)))
(speedbar-add-supported-extension ".hs")
;; (setq haskell-tags-on-save t)
;; (eval-after-load 'flycheck
;; '(add-hook 'flycheck-mode-hook #'flycheck-haskell-setup))
(global-set-key (kbd "<C-f8>") 'flycheck-next-error)
(global-set-key (kbd "<f8>") 'next-error)
(global-set-key (kbd "<S-f8>") 'previous-error)
(global-set-key (kbd "<C-tab>") 'next-buffer)
(global-set-key (kbd "<C-S-iso-lefttab>") 'previous-buffer)
(global-set-key (kbd "<M-down>") 'scroll-up-line)
(global-set-key (kbd "<M-up>") 'scroll-down-line)
(global-set-key (kbd "<S-f11>") 'start-kbd-macro)
(global-set-key (kbd "<S-f12>") 'end-kbd-macro)
(global-set-key (kbd "<f12>") 'call-last-kbd-macro)
(global-set-key (kbd "M-.") 'company-filter-candidates)
(require 'indent-region)
(global-set-key [(meta super right)] 'my-indent-region)
(global-set-key [(meta super left)] 'my-unindent-region)
(require 'dockerfile-mode)
(add-to-list 'auto-mode-alist '("Dockerfile\\'" . dockerfile-mode))
;; (require 'flymake-sass)
;; (add-hook 'sass-mode-hook 'flymake-sass-load)
;; (add-hook 'scss-mode-hook 'flymake-sass-load)
;; (require 'flymake-ruby)
;; (add-hook 'ruby-mode-hook 'flymake-ruby-load)
;;(add-to-list 'auto-mode-alist '("*.jbuilder" . ruby-mode))
(defun ruby-mode-hook ()
(autoload 'ruby-mode "ruby-mode" nil t)
(add-to-list 'auto-mode-alist '("Capfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile" . ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rb\\'" . ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru\\'" . ruby-mode))
(add-hook 'ruby-mode-hook '(lambda ()
(setq ruby-deep-arglist t)
(setq ruby-deep-indent-paren nil)
(setq c-tab-always-indent nil)
(require 'inf-ruby)
(require 'ruby-compilation))))
(ruby-mode-hook)
;;(require 'flymake-json)
;;(require 'flymake-jslint)
;;(add-hook 'js-mode-hook 'flymake-jslint-load)
(setq exec-path (cons (expand-file-name "~/.rvm/gems/ruby-2.1.2/bin") exec-path))
(require 'js-comint)
(setq inferior-js-program-command "/usr/bin/node")
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
(add-to-list 'auto-mode-alist '("\\.jbuilder\\'" . ruby-mode))
;; Write backups to ~/.emacs.d/backup/
(setq backup-directory-alist '(("." . "~/.emacs.d/backup"))
backup-by-copying t ; Don't de-link hard links
version-control t ; Use version numbers on backups
delete-old-versions t ; Automatically delete excess backups:
kept-new-versions 20 ; how many of the newest versions to keep
kept-old-versions 5) ; and how many of the old
;; (eval-after-load "haskell-mode"
;; '(define-key haskell-mode-map (kbd "C-c C-c") 'haskell-compile))
;; (eval-after-load "haskell-cabal"
;; '(define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-compile))
;; (autoload 'ghc-init "ghc" nil t)
;; (autoload 'ghc-debug "ghc" nil t)
;; (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
(let ((my-cabal-path (expand-file-name "~/.cabal/bin")))
(setenv "PATH" (concat my-cabal-path ":" (getenv "PATH")))
(add-to-list 'exec-path my-cabal-path))
(define-key haskell-mode-map (kbd "M-.") 'haskell-mode-goto-loc)
(define-key haskell-mode-map (kbd "C-c C-t") 'haskell-mode-show-type-at)
(define-key haskell-mode-map [return] 'newline-and-indent)
(global-set-key [(meta left)] 'backward-sexp)
(global-set-key [(meta right)] 'forward-sexp)
(global-set-key [(control ?b)] 'switch-to-buffer)
(global-set-key [(control ?z)] 'undo)
(global-set-key [(control ?y)] 'undo-tree-redo)
(global-set-key [(meta ?3)] 'comment-region)
(global-set-key [(meta ?4)] 'uncomment-region)
(global-set-key [(control tab)] 'other-window)
(global-set-key [(meta ?*)] 'pop-tag-mark)
(defun gitk-on-current-file (arg)
(interactive "sExtra argument: \n")
(start-process "*gitk*" nil "gitk" arg "--" (buffer-file-name)))
;; smex
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
;; This is your old M-x.
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)
;; ----------------------------------------------------------------------
;; (eval-after-load 'haskell-mode '(progn
;; (define-key haskell-mode-map (kbd "C-c C-l") 'haskell-process-load-or-reload)
;; (define-key haskell-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
;; (define-key haskell-mode-map (kbd "C-c C-n C-t") 'haskell-process-do-type)
;; (define-key haskell-mode-map (kbd "C-c C-n C-i") 'haskell-process-do-info)
;; (define-key haskell-mode-map (kbd "C-c C-n C-c") 'haskell-process-cabal-build)
;; (define-key haskell-mode-map (kbd "C-c C-n c") 'haskell-process-cabal)
;; (define-key haskell-mode-map (kbd "SPC") 'haskell-mode-contextual-space)))
;; (eval-after-load 'haskell-cabal '(progn
;; (define-key haskell-cabal-mode-map (kbd "C-c C-z") 'haskell-interactive-switch)
;; (define-key haskell-cabal-mode-map (kbd "C-c C-k") 'haskell-interactive-mode-clear)
;; (define-key haskell-cabal-mode-map (kbd "C-c C-c") 'haskell-process-cabal-build)
;; (define-key haskell-cabal-mode-map (kbd "C-c c") 'haskell-process-cabal)))
(defun resolve-trivial-conflicts ()
(interactive)
(let ((compilation-buffer-name-function (lambda (mode) "*resolve-trivial-conflicts*")))
(compile "resolve-trivial-conflicts -d -C")))
(global-set-key [(shift f10)] 'resolve-trivial-conflicts)
(define-key haskell-mode-map (kbd "C-`") 'haskell-interactive-bring)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment