個人的なメモ

めもめも.

emacs_init.el

;(setq load-path (cons "~/site-lisp/" load-path))

; 言語を日本語にする
(set-language-environment 'Japanese)

; 極力UTF-8とする
(prefer-coding-system 'utf-8)

; 行番号表示
(global-linum-mode t)

; 起動時の大きさ
;(setq initial-frame-alist
;      '((top . 1) (left . 100) (width . 80) (height . 85)))

;; ウィンドウシステム上で動作しているかどうかの判定
(if window-system (progn

  ;;ビープ音を消す
  (setq ring-bell-function 'ignore)

  ;; 行間
  (setq-default line-spacing 0.1)

  ;; 背景の不透明度(アクティブウィンドウが90%,非アクティブが80%)
  (add-to-list 'default-frame-alist '(alpha . (90 80)))
  
  ;; 文字の色を設定します。
  (add-to-list 'default-frame-alist '(foreground-color . "white"))
  ;; 背景色を設定します。
  (add-to-list 'default-frame-alist '(background-color . "black"))
  ;; カーソルの色を設定します。
  ;;(add-to-list 'default-frame-alist '(cursor-color . "SlateBlue2"))
  (add-to-list 'default-frame-alist '(cursor-color . "ghost white"))  
  
  ;; マウスポインタの色を設定します。
  (add-to-list 'default-frame-alist '(mouse-color . "SlateBlue2"))

  ;; モードラインの文字の色を設定します。
  ;; (set-face-foreground 'modeline "white")
  ;; モードラインの背景色を設定します。
  ;; (set-face-background 'modeline "MediumPurple2")
  ;; 選択中のリージョンの色を設定します。
  (set-face-background 'region "blue")
  ;; モードライン(アクティブでないバッファ)の文字色を設定します。
  (set-face-foreground 'mode-line-inactive "gray30")
  ;; モードライン(アクティブでないバッファ)の背景色を設定します。
  (set-face-background 'mode-line-inactive "gray85")
  
  ;; コメントアウト
  (set-face-foreground 'font-lock-comment-face "Red")
  ;; 文字列 <stdio.h>なども
  (set-face-foreground 'font-lock-string-face  "green")
  ;; 予約語
  (set-face-foreground 'font-lock-keyword-face "cyan")
  ;; 関数の名前
  ;;(set-face-foreground 'font-lock-function-name-face "MediumSlateBlue")
  (set-face-foreground 'font-lock-function-name-face "LightSlateBlue")  
  ;; 太字
  (set-face-bold-p 'font-lock-function-name-face t)
  ;; 変数名
  (set-face-foreground 'font-lock-variable-name-face "yellow")
  ;; 型 double int
  (set-face-foreground 'font-lock-type-face "Green")
  ;; #includeの部分
  ;;(set-face-foreground 'font-lock-builtin-face "MediumSlateBlue")
  (set-face-foreground 'font-lock-builtin-face "LightSlateBlue")  
  ;; ラベル
  (set-face-foreground 'font-lock-constant-face "DeepPINK")
  ;; ?
  (set-face-foreground 'font-lock-warning-face "pink")
  ;; ボールドが無効になって普通の字体に戻る?
  (set-face-bold-p 'font-lock-warning-face nil)

  (eval-after-load "color-theme"
  '(progn
     (color-theme-initialize)
     (color-theme-gnome2)))

  ;; ツールバーを表示
  (tool-bar-mode t)

  ;; '¥'キーで '\' を入力する
  (progn
    (define-key global-map [?¥] [?\\])
    (define-key global-map [?\C-¥] [?\C-\\])
    (define-key global-map [?\M-¥] [?\M-\\])
    (define-key global-map [?\C-\M-¥] [?\C-\M-\\]))

  ;; フォント設定
  ;; フォント設定
(set-face-attribute 'default nil
                   :family "Ricty"
                   :height 140)
(set-fontset-font
 nil 'japanese-jisx0208
 (font-spec :family "Ricty"))
  ))


;; 下の方に (行番号,列番号) を表示
(line-number-mode t)
(column-number-mode t)

;; Octave mode
;(autoload 'octave-mode "octave-mod" nil t)
;(setq auto-mode-alist
;      (cons '("\\.m$" . octave-mode) auto-mode-alist))

;; Macでの印刷のための設定
;(when (require 'mac-print-mode nil t)
;  (mac-print-mode 1)
  ;; (global-set-key (kbd "M-p") 'mac-print-buffer)
;  )

;; 全角括弧「(」などを入力できるようにする
;;(mac-add-key-passed-to-system 'shift)
(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.
 '(inhibit-startup-screen t))
(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.
 )

;; ハイライト
(defface hlline-face
  '((((class color)
      (background dark))
     ;;(:background "blue"))
     ;;(:background "blue3"))
     (:background "dark slate gray"))
    (((class color)
      (background light))
     (:background "ForestGreen"))
    (t
     ()))
  "*Face used by hl-line.")
(setq hl-line-face 'hlline-face)
;; (setq hl-line-face 'underline) ; 下線
(global-hl-line-mode)

;; key bind define
;;(define-key global-map (kbd "C-m") 'forward-paragraph) ; C^mで次の段落へ
;; (define-key global-map (kbd "C-l") 'backward-paragraph); C^lで前の段落へ
(keyboard-translate ?\C-h ?\C-?);; C-hをバックスペースとして扱う