忍者ブログ
PCをいじったときのメモ
[17]  [15]  [14]  [13]  [12]  [11]  [10]  [9
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

Emacs の設定ファイル。

E-Lisp を書けるわけでもなく、
ただ、検索して出てきたもののうち使えそうなのをコピペしただけ。


多分、YaTeXとAnthyとIPAフォントと言うのが入っていれば動くのではないかと思う。

プログラミング言語は、C、C++、Ruby、Haskell、そしてTeXに対応していると思う。

一応、Emacsは問題なく起動するけれど、
各言語モードなどは検証していない。


↓以下、.emacs


;; .emacs

;=====================================
; Interface
;=====================================

;; default to better frame titles
(setq frame-title-format
      (concat  "%b - emacs@" (system-name)))

;; vanish tool bar
;(tool-bar-mode 0)

;; display clock
(display-time)  

;; display line number
(setq line-number-mode t)

;; dispose scroll bar to right
(set-scroll-bar-mode 'right)

;; vanish startup message
(setq inhibit-startup-message t)
;(setq initial-scratch-message nil)

;; errar bell
(setq ring-bell-function (lambda ()))
;(setq visible-bell t)

;; color parenthesis
(show-paren-mode t)
(setq show-paren-style 'parenthesis)

;; font setting

;(create-fontset-from-fontset-spec
; "-shinonome-gothic-medium-r-normal--14-*-*-*-*-*-fontset-14")
;(set-default-font "fontset-14")

(create-fontset-from-fontset-spec
  "-misc-ipagothic-medium-r-normal--14-*-*-*-*-*-fontset-ipa")
(set-default-font "fontset-ipa")

;; font color
(global-font-lock-mode t) 
(setq font-lock-support-mode 'jit-lock-mode)

(setq font-lock-maximum-decoration t)

(add-hook 'font-lock-mode-hook
          '(lambda ()(set-face-foreground
                     'font-lock-comment-face "gray")))

;; frame setting
(setq initial-frame-alist
  (append (list
           '(foreground-color . "white") ;; font
           '(background-color . "black") ;; back ground
           '(border-color . "black")
           '(mouse-color . "white")
           '(cursor-color . "white")
           '(width . 75)   ;; frame width
           '(height . 62)  ;; frame hight
           '(top . 0)      ;; Y position
           '(left . 5)     ;; X position
          )
          initial-frame-alist))
 (setq default-frame-alist initial-frame-alist)

;===================================
; Language
;===================================

;; using ja-JP.UTF-8

;;; uncomment for CJK utf-8 support for non-Asian users
;(require 'un-define)

(set-language-environment "Japanese")
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(setq file-name-coding-system 'utf-8)

;; using anthy
(load-library "anthy")
(setq default-input-method "japanese-anthy")
(toggle-input-method nil)
(global-set-key [zenkaku-hankaku] 'toggle-input-method)

;; display collectly Japanese info
(auto-compression-mode t)


;=====================================
;Manipulation Setting
;====================================

;; mouse wheel
(global-set-key [mouse-4] 'scroll-down)
(global-set-key [mouse-5] 'scroll-up)
(progn
 (defun scroll-up-half ()
     "Scroll up half a page."
     (interactive)
     (scroll-up (/ (window-height) 2))
 )
 (defun scroll-down-half ()
     "Scroll down half a page."
     (interactive)
     (scroll-down (/ (window-height) 2))
 )
 (global-set-key [(mouse-5)] 'scroll-up-half)
 (global-set-key [(mouse-4)] 'scroll-down-half)
)

;; edit gz file
(auto-compression-mode t)


;=====================================
;Key Setting
;=====================================

;; change to coment or uncoment
(global-set-key "\C-c;" 'comment-region)  
(global-set-key "\C-c:" 'uncomment-region)

;; kill line
(setq kill-whole-line t)

;; undo
(global-set-key "\C-z" 'undo)

;; back space
(global-set-key "\C-h" 'delete-backward-char)


;=======================================
;Progrum Mode
;======================================

;; yatex-mode
(setq auto-mode-alist
      (cons (cons "\\.tex$" 'yatex-mode) auto-mode-alist))
(autoload 'yatex-mode "yatex" "Yet Another LaTeX mode" t)
(setq YaTeX-use-AMS-LaTeX t)
(setq YaTeX-use-LaTeX2e t)

;; Ruby Mode
(add-to-list 'load-path "~/.site-lisp/ruby-mode")

(require 'ruby-mode)
(require 'ruby-electric)

(defun ruby-eval-buffer () (interactive)
"Evaluate the buffer with ruby."
(shell-command-on-region (point-min) (point-max) "ruby"))

(defun my-ruby-mode-hook ()
(font-lock-mode t)
(setq standard-indent 2)
(pabbrev-mode t)
(ruby-electric-mode t)
(define-key ruby-mode-map "\C-c\C-a" 'ruby-eval-buffer))
(add-hook 'ruby-mode-hook 'my-ruby-mode-hook)

(setq auto-mode-alist (cons '("\\.rb\\'" . rhtml-mode) auto-mode-alist))

;; C Mode
(add-hook 'c-mode-hook
          '(lambda ()
             (auto-fill-mode 1)
             (local-set-key "\M-c\M-c" 'compile)
             (local-set-key "\M-c\M-d" 'gdb)
             ))

;; C++ Mode
(add-hook 'c++-mode-hook
          '(lambda ()
             (auto-fill-mode 1)
             (local-set-key "\M-c\M-c" 'compile)
             (local-set-key "\M-c\M-d" 'gdb)
             ))

;; Haskell Mode
(setq auto-mode-alist
      (cons '("\\.hs$" . haskell-mode) auto-mode-alist))
PR
この記事にコメントする
お名前
タイトル
文字色
メールアドレス
URL
コメント
パスワード   Vodafone絵文字 i-mode絵文字 Ezweb絵文字
カレンダー
07 2025/08 09
S M T W T F S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
リンク
フリーエリア
最新CM
最新TB
プロフィール
HN:
No Name
性別:
非公開
バーコード
ブログ内検索
カウンター
アクセス解析
忍者ブログ [PR]