Emacs23 (Cocoa Emacs) 入門から中毒までを参考にした。
/.emacs.d/init.elを編集する。(2012.8.17現在伊藤使用中のinit.el)
/.emacs.d/にshell-command.elを配置(ファイルはここからダウンロード)
;;言語設定 (set-locale-environment "utf-8") ;;;GUI関連 (setq inhibit-startup-message t) ;; スタートアップページを表示しない (setq visible-bell t) ;; 警告音を消す (require 'saveplace) ;; 前回のカーソル位置を記憶 (setq-default save-place t) ;; 前回のカーソル位置を記憶 (setq scroll-conservatively 35 scroll-margin 0 scroll-step 1) ;;1行ずつスクロールする (global-set-key "\M-n" 'linum-mode);;行番号 (line-number-mode t);;行番号表示 (column-number-mode 1);;桁番号表示 (setq inhibit-startup-message t) ;;Message Bufferを表示させない (show-paren-mode 1);; 括弧を目立たせる ;;Color (if window-system (progn (setq initial-frame-alist '((width . 140)(height . 30)(top . 50)(left . 30))) (set-frame-parameter nil 'alpha 80) (set-background-color "black") (set-foreground-color "LightGray") (set-cursor-color "SeaGreen1") )) ;;カーソル行ハイライト (defface hlline-face '((((class color) (background dark)) (:background "grey20")) (((class color) (background light)) (:background "OliveDrab1")) (t ())) "*Face used by hl-line.") (setq hl-line-face 'hlline-face) (global-hl-line-mode) ;;;Tex関連 (setenv "PATH" (concat (getenv "PATH") ":/usr/local/texlive/2015/bin/x86_64-darwin")) (setq auto-mode-alist (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist)) (autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t) (setq load-path (cons (expand-file-name "~/.emacs.d/yatex") load-path)) ;(setq tex-command "~/.emacs.d/tex.sh" dvi2-command "open -a Preview") (setq tex-command "/usr/local/texlive/2015/bin/x86_64-darwin/ptex2pdf -u -l -ot '-synctex=1' '-d 5' -od '-f uptex-hiragino.map'") ;(setq tex-command "pdflatex -synctex=1") ;(setq tex-command "~/Library/TeXShop/bin/platex2pdf-utf8" dvi2-command "open -a Preview") ;(setq YaTeX-dvipdf-command "dvipdfmx -d") (dolist (dir (list "/sbin" "/usr/sbin" "/bin" "/usr/bin" "/opt/local/bin" "/sw/bin" "/usr/local/bin" "/usr/texbin" (expand-file-name "~/bin") (expand-file-name "~/.emacs.d/bin") )) ;; PATH と exec-path に同じ物を追加します (when (and (file-exists-p dir) (not (member dir exec-path))) (setenv "PATH" (concat dir ":" (getenv "PATH"))) (setq exec-path (append (list dir) exec-path)))) ;; Carbon Emacsの設定で入れられた. メニューを隠す。 (custom-set-variables '(display-time-mode t) '(tool-bar-mode nil) '(transient-mark-mode t)) (custom-set-faces ) ;;Key bind関連 ;;Shift + カーソルキーで領域を選選択 (setq pc-select-selection-keys-only t) (pc-selection-mode 1) ;; Display Line Number (global-set-key "\M-n" 'linum-mode) ;;Mac key mode ;;(mac-key-mode 1) ;; ¥の代わりにバックスラッシュを入力する (define-key global-map [?¥] [?\\]) ;;mouse scrool (global-set-key [wheel-up] '(lambda () "" (interactive) (scroll-down 1))) (global-set-key [wheel-down] '(lambda () "" (interactive) (scroll-up 1))) (global-set-key [double-wheel-up] '(lambda () "" (interactive) (scroll-down 1))) (global-set-key [double-wheel-down] '(lambda () "" (interactive) (scroll-up 1))) (global-set-key [triple-wheel-up] '(lambda () "" (interactive) (scroll-down 2))) (global-set-key [triple-wheel-down] '(lambda () "" (interactive) (scroll-up 2))) ;;Font (when (= emacs-major-version 23) (create-fontset-from-ascii-font "-apple-monaco-medium-normal-normal-*-12-*" nil "hirakaku12") (set-default-font "fontset-hirakaku12") (add-to-list 'default-frame-alist '(font . "fontset-hirakaku12")) (set-fontset-font "fontset-hirakaku12" 'japanese-jisx0208 "-apple-hiragino_kaku_gothic_pro-medium-normal-normal-*-14-*-iso10646-1") (set-fontset-font "fontset-hirakaku12" 'jisx0201 "-apple-hiragino_kaku_gothic_pro-medium-normal-normal-*-14-*-iso10646-1") (set-fontset-font "fontset-hirakaku12" 'japanese-jisx0212 "-apple-hiragino_kaku_gothic_pro-medium-normal-normal-*-14-*-iso10646-1") (set-fontset-font "fontset-hirakaku12" 'katakana-jisx0201 "-apple-hiragino_kaku_gothic_pro-medium-normal-normal-*-14-*-iso10646-1") ) ;; バッファ末尾に余計な改行コードを防ぐための設定 (setq next-line-add-newlines nil) ;; #のバックアップファイルを作成しない (setq make-backup-files nil) ;;ビープ音を消す (setq ring-bell-function 'ignore) ;;ペースト時に画像をペーストしない (setq yank-excluded-properties t) ;; 初回の set-goal-column (C-x C-n) で選択画面を出さない (put 'set-goal-column 'disabled nil) ;;自動改行しない (setq text-mode-hook 'turn-off-auto-fill) ;;Recent fileを表示 (when (require 'recentf nil t) (setq recentf-max-saved-items 2000) (setq recentf-exclude '(".recentf")) (setq recentf-auto-cleanup 10) (setq recentf-auto-save-timer (run-with-idle-timer 30 t 'recentf-save-list)) (recentf-mode 1)) ;;scratchでメッセージを出さない (setq initial-scratch-message "") (put 'upcase-region 'disabled nil)