Skip to content

Instantly share code, notes, and snippets.

@skoba
Created February 4, 2013 17:21
Show Gist options
  • Save skoba/4708129 to your computer and use it in GitHub Desktop.
Save skoba/4708129 to your computer and use it in GitHub Desktop.
Emacs configuration
(add-to-list 'load-path "~/.emacs.d/site-lisp")
(global-set-key "\C-?" (quote delete-char))
(global-set-key "\C-h" (quote delete-backward-char))
(set-language-environment 'japanese)
(set-terminal-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(setq c-site-default-style "k&r")
(require 'mozc)
(setq default-input-method "japanese-mozc")
(global-set-key (kbd "C-o") 'toggle-input-method)
(autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
(autoload 'run-ruby "inf-ruby" "Run an inferior Ruby process")
(autoload 'inf-ruby-keys "inf-ruby" "Set local key defs for inf-ruby in ruby-mode")
(add-hook 'ruby-mode-hook '(lambda () (inf-ruby-keys)))
(autoload 'markdown-mode "markdown-mode.el"
"Major mode for editing Markdown files" t)
(setq auto-mode-alist
(cons '("\\.md" . markdown-mode) auto-mode-alist))
(require 'flymake)
;; I don't like the default colors :)
;(set-face-background 'flymake-errline "red4")
;(set-face-background 'flymake-warnline "dark slate blue")
;; Invoke ruby with '-c' to get syntax checking
(defun flymake-ruby-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 "ruby" (list "-c" local-file))))
(push '(".+\\.rb$" flymake-ruby-init) flymake-allowed-file-name-masks)
(push '("Rakefile$" flymake-ruby-init) flymake-allowed-file-name-masks)
(push '("^\\(.*\\):\\([0-9]+\\): \\(.*\\)$" 1 2 nil 3) flymake-err-line-patterns)
(add-hook 'ruby-mode-hook
'(lambda ()
;; Don't want flymake mode for ruby regions in rhtml files and also on read only files
(if (and (not (null buffer-file-name)) (file-writable-p buffer-file-name))
(flymake-mode))
))
(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.
)
(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 "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :antialias nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "adobe" :family "Source Code Pro")))))
(require 'magit)
; yatex
(require 'yatex-startup)
(setq tex-command "uplatex")
(setq dvi2-command "pxdvi")
(add-to-list 'load-path
"~/.emacs.d/site-lisp/yasnippet")
(require 'yasnippet)
(yas/global-mode 1)
(yas/load-directory "~/.emacs.d/site-lisp/yasnippet/snippets")
(require 'feature-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment