Skip to content

Instantly share code, notes, and snippets.

@nyuichi
Created April 25, 2012 11:38
Show Gist options
  • Save nyuichi/2489100 to your computer and use it in GitHub Desktop.
Save nyuichi/2489100 to your computer and use it in GitHub Desktop.
(global-set-key "\C-h" 'delete-backward-char)
(tool-bar-mode 0)
(show-paren-mode 1)
(menu-bar-mode 0)
(set-scroll-bar-mode 'right)
(setq column-number-mode t)
(setq make-backup-files nil)
(setq auto-save-default nil)
(setq x-select-enable-clipboard t)
(setq inhibit-startup-message t)
(add-to-list 'default-frame-alist '(height . 48))
(add-to-list 'default-frame-alist '(width . 80))
;; Font
(add-to-list 'default-frame-alist '(font . "-unknown-Inconsolata-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1"))
(set-fontset-font (frame-parameter nil 'font)
'japanese-jisx0208
'("VL Gothic" . "unicode-bmp"))
(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
(require 'color-theme)
;(color-theme-initialize)
;(color-theme-classic)
;; anything
(add-to-list 'load-path "~/opt/anything-config")
(add-to-list 'load-path "~/opt/anything-config/extensions")
(require 'anything-startup)
(global-set-key (kbd "C-;") 'anything)
(setq anything-sources
(list anything-c-source-buffers
anything-c-source-recentf
anything-c-source-locate
anything-c-source-files-in-current-dir))
(setq anything-idle-delay 0.3)
(setq anything-input-idle-delay 0)
(setq anything-candidate-number-limit 50)
;; clojure-mode
(add-to-list 'load-path "~/opt/clojure-mode")
(require 'clojure-mode)
;; paredit
(add-to-list 'load-path "~/opt/paredit")
(require 'paredit)
(add-hook 'clojure-mode-hook 'enable-paredit-mode)
(add-hook 'lisp-mode-hook 'enable-paredit-mode)
;; slime
(eval-after-load "slime"
'(progn (slime-setup '(slime-repl))
(add-hook 'slime-mode-hook 'enable-paredit-mode)
(add-hook 'slime-repl-mode-hook 'enable-paredit-mode)
(setq slime-protocol-version 'ignore)))
(add-to-list 'load-path "~/opt/slime")
(require 'slime)
(slime-setup)
;;; Haskell-mode
(add-to-list 'load-path "/usr/share/emacs/site-lisp/haskell-mode")
(load "haskell-site-file")
(add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
(add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
(add-hook 'haskell-mode-hook 'font-lock-mode)
(add-hook 'haskell-mode-hook 'imenu-add-menubar-index)
;;; Flymake
(require 'flymake)
(defun flymake-cc-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "g++" (list "-Wall" "-Wextra" "-fsyntax-only" local-file))))
(push '("\\.cpp$" flymake-cc-init) flymake-allowed-file-name-masks)
(push '("\\.cc$" flymake-cc-init) flymake-allowed-file-name-masks)
(defun flymake-c-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "gcc" (list "-Wall" "-Wextra" "-fsyntax-only" local-file))))
(push '("\\.c$" flymake-c-init) flymake-allowed-file-name-masks)
(add-hook 'c-mode-common-hook
'(lambda ()
(flymake-mode t)))
(defun credmp/flymake-display-err-minibuf ()
"Displays the error/warning for the current line in the minibuffer"
(interactive)
(let* ((line-no (flymake-current-line-no))
(line-err-info-list (nth 0 (flymake-find-err-info flymake-err-info line-no)))
(count (length line-err-info-list))
)
(while (> count 0)
(when line-err-info-list
(let* ((file (flymake-ler-file (nth (1- count) line-err-info-list)))
(full-file (flymake-ler-full-file (nth (1- count) line-err-info-list)))
(text (flymake-ler-text (nth (1- count) line-err-info-list)))
(line (flymake-ler-line (nth (1- count) line-err-info-list))))
(message "[%s] %s" line text)
)
)
(setq count (1- count)))))
(global-set-key "\C-xm" 'credmp/flymake-display-err-minibuf)
(setq c-default-style "k&r")
(add-hook 'c-mode-common-hook
'(lambda ()
(progn
(c-toggle-hungry-state 1)
(setq c-basic-offset 4 indent-tabs-mode nil))))
;;; Scheme
(setq scheme-program-name "gosh -i")
(add-hook 'scheme-mode-hook 'enable-paredit-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment