emacs settings 2016
;; package
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(package-initialize)
;; basic settings
(tool-bar-mode 0)
;;(menu-bar-mode 0)
(scroll-bar-mode 0)
(show-paren-mode 0)
(transient-mark-mode 0)
(setq-default line-spacing 4)
(setq make-backup-files nil)
(setq auto-save-default nil)
;;(setq inhibit-startup-message t)
;;(setq initial-scratch-message nil)
(setq initial-frame-alist '((top . 20) (left . 0) (width . 100) (height . 48)))
;; set margin
(fringe-mode '(0 . 0))
(add-hook 'window-configuration-change-hook
(lambda ()
(set-window-margins
(car (get-buffer-window-list (current-buffer) nil t)) 4 4)))
;; background alpha
;;(defun set-alpha (alpha-num) "set frame parameter 'alpha"
;; (interactive "nAlpha: ")
;; (set-frame-parameter nil 'alpha (cons alpha-num '(100))))
;;(add-to-list 'default-frame-alist '(alpha . (95 . 95)))
;; font
(set-face-attribute 'default nil :family "SF Mono" :height 160)
(set-fontset-font "fontset-default" 'japanese-jisx0208 '("Hiragino Sans"))
;; color-theme
;; https://github.com/emacs-jp/replace-colorthemes
;;(load-theme 'dark-laptop t)
;;(load-theme 'blue-gnus t)
;;(load-theme 'simple-1 t)
;;(load-theme 'desert t)
;;(load-theme 'subdued t)
;;(load-theme 'railscast t)
;;(load-theme 'tty-dark t)
;; set input method
(setq default-input-method "japanese-skk")
;; auto-complete
(require 'auto-complete)
(require 'auto-complete-config)
(global-auto-complete-mode t)
;; yasnippet
(add-to-list 'load-path
(expand-file-name "~/.emacs.d/elpa/yasnippet-20161109.1847/"))
;; 自分用・追加用テンプレート -> mysnippetに作成したテンプレートが格納される
(require 'yasnippet)
(setq yas-snippet-dirs
'("~/.emacs.d/mysnippets"
"~/.emacs.d/yasnippets"
))
(yas-global-mode 1)
;; markdown
(setq markdown-command "/usr/local/bin/multimarkdown")
;; processing
(setq processing-location "/usr/local/bin/processing-java")
(setq processing-application-dir "/Applications/Processing.app")
(setq processing-sketchbook-dir "~/Documents/Processing")
(setq processing-output-dir "/tmp")
(defun processing-mode-init ()
(make-local-variable 'ac-sources)
(setq ac-sources '(ac-source-dictionary ac-source-yasnippet))
(make-local-variable 'ac-user-dictionary)
(setq ac-user-dictionary (append processing-functions
processing-builtins
processing-constants)))
(add-to-list 'ac-modes 'processing-mode)
(add-hook 'processing-mode-hook 'processing-mode-init)
;; Haskell mode
(add-to-list 'load-path "~/.emacs.d/haskell-mode/")
(add-to-list 'Info-default-directory-list "~/.emacs.d/haskell-mode/")
(autoload 'haskell-mode "haskell-mode")
(autoload 'haskell-cabal "haskell-cabal")
(add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
(add-to-list 'interpreter-mode-alist '("runghc" . haskell-mode))
(add-to-list 'interpreter-mode-alist '("runhaskell" . haskell-mode))
(setq haskell-program-name "/usr/locl/bin/ghci")
;; ghc-mod
(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))
;; Tidal
(add-to-list 'load-path "~/.emacs.d/tidal/")
(require 'tidal)
(setq tidal-interpreter "/usr/local/bin/ghci")
;; C++ indent
(defun my-c-c++-mode-init () (setq c-basic-offset 4))
(add-hook 'c-mode-hook 'my-c-c++-mode-init)
(add-hook 'c++-mode-hook 'my-c-c++-mode-init)
;;extempore
;;(package-install-file "~/.emacs.d/extempore/extempore-mode.el")