Emacs がバージョンアップとともに使いにくくなってきたので、使いやすくする設定。まず、customize で設定できる簡単な項目: - inhibit-startup-screen t: 起動時に scratch バッファーが出るようにする
- transient-mark-mode nil: Mark set の時にデフォルトで色がつかないようにする
- line-move-visual nil: 上下のカーソル移動が行単位で行われるようにする
^H をバックスペースにする。 (let ((the-table (make-string 18 0)))
(let ((i 0)) (while (< i 128) (aset the-table i i) (setq i (1+ i)))) ;; Swap ^H and DEL ;;(aset the-table ?\177 ?\^h) (aset the-table ?\^h ?\177) (setq keyboard-translate-table the-table))
fundamental-mode の TAB キーで、インデントではなく必ず tab を入力するための設定。 (add-hook 'after-change-major-mode-hook
(lambda () (if (string= major-mode "fundamental-mode") (local-set-key "\t" 'self-insert-command))))
find-file-other-window のカスタマイズ。C-x 4 f RET で、現在のファイルを other-window に表示するための設定。 ;; This definition is copied from lisp/files.el
;; in GNU Emacs 21.4a, licensed under the GNU GPL version 2 or later. ;; Copyright (C) 1985, 86, 87, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 ;;; Free Software Foundation, Inc.
(defun find-file-other-window (filename &optional wildcards) "Edit file FILENAME, in another window. May create a new window, or reuse an existing one. See the function `display-buffer'. Interactively, or if WILDCARDS is non-nil in a call from Lisp, expand wildcards (if any) and visit multiple files." (interactive "FFind file in other window: \np") (let ((value (find-file-noselect filename nil nil wildcards))) (if (listp value) (progn (setq value (nreverse value)) (switch-to-buffer-other-window (car value)) (mapcar 'switch-to-buffer (cdr value))) (switch-to-buffer-other-window value))))
文字コード変換テーブルの修正。全角チルダの表示が変にならないようにする。Emacs 23 用。 ;; refer to http://nijino.homelinux.net/emacs/emacs23-ja.html
(coding-system-put 'euc-jp :encode-translation-table
(get 'japanese-ucs-cp932-to-jis-map 'translation-table)) (coding-system-put 'euc-jisx0213 :encode-translation-table (get 'japanese-ucs-cp932-to-jis-map 'translation-table)) (coding-system-put 'iso-2022-jp :encode-translation-table (get 'japanese-ucs-cp932-to-jis-map 'translation-table)) (coding-system-put 'iso-2022-jp-2 :encode-translation-table (get 'japanese-ucs-cp932-to-jis-map 'translation-table)) (coding-system-put 'cp932 :encode-translation-table (get 'japanese-ucs-jis-to-cp932-map 'translation-table))
EUC-JP 端末で文字幅が文字セットのバイト数と一致せず崩れてしまう問題を解決する。Emacs 23 用。 ;; This definition is based on lisp/international/characters.el ;; in GNU Emacs 23.3, licensed under the GNU GPL version 3 or later. ;; Copyright (C) 1997, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 ;; Copyright (C) 2003 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H13PRO009
(setq cjk-char-width-table-list '((ja_JP nil (japanese-jisx0208 (#x2121 . #x7E7E)) (japanese-jisx0212 (#x2121 . #x7E7E)) (japanese-jisx0213-1 (#x2121 . #x7E7E)) (japanese-jisx0213-2 (#x2121 . #x7E7E)) (japanese-jisx0213-a (#x2121 . #x7E7E)) (japanese-jisx0213.2004-1 (#x2121 . #x7E7E)) (cp932-2-byte (#x8140 . #xFEFE))) (zh_CN nil (chinese-gb2312 (#x2121 . #x297E))) (zh_HK nil (big5-hkscs (#xA140 . #xA3FE) (#xC6A0 . #xC8FE))) (zh_TW nil (big5 (#xA140 . #xA3FE)) (chinese-cns11643-1 (#x2121 . #x427E))) (ko_KR nil (korean-ksc5601 (#x2121 . #x2C7E))))) (use-cjk-char-width-table 'ja_JP) |
|