.emacs をさらすテスト @mac

Posted September 30th, 2010 in General. Tagged: , .

使用環境: http://emacsformacosx.com/ からとってきた Emacs22 @mac

いまはもう Emacs23ですが何か

;;; 日本語環境設定
(set-language-environment "Japanese")

;; default buffer file coding system
(setq default-buffer-file-coding-system 'utf-8-unix)
(prefer-coding-system 'utf-8-unix)

;; ツールバーを表示しない
(tool-bar-mode nil)

;; カーソルは点滅しない
(blink-cursor-mode nil)

;; バックアップファイルを作らない
(setq backup-inhibited t)

;; Shift+左クリックでURLをブラウザで開く
(global-set-key [S-down-mouse-1] 'browse-url-at-mouse)

;; mac-key-mode
;;(mac-key-mode 1)
(global-set-key "\M-c" 'clipboard-kill-ring-save)
(global-set-key "\M-v" 'clipboard-yank)

;; I love \C-8 for help-command
(global-set-key [?\C-8] 'help-command)
(define-key help-map [?\C-8] 'help-for-help)

;; info mode
(add-hook
 'Info-mode-hook
 '(lambda ()
    (define-key Info-mode-map "b" 'Info-scroll-down)))

;; viper-mode
(setq viper-mode t)
(require 'viper)
(define-key viper-insert-basic-map "\C-[" 'viper-intercept-ESC-key)
;;(define-key viper-insert-basic-map [M-v] 'clipboard-yank)

;; auto-mode
;
;(setq auto-mode-alist (cons '("\\.h\\'" . c++-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.php\\'" . php-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\.phtml\\'" . php-mode) auto-mode-alist))

;; insert time
(defun my-insert-time ()
  (interactive)
  (insert 
   (format-time-string "[%H:%M:%S] ")
   ))
(global-set-key "\C-xt" 'my-insert-time)

;; insert date
(defun my-insert-date ()
  (interactive)
  (insert 
   (format-time-string "%Y%m%d")
   ))
(global-set-key "\C-xd" 'my-insert-date)

;; shell mode
(add-hook
 'shell-mode-hook
 '(lambda ()
    (set-buffer-process-coding-system 'utf-8-unix 'utf-8-unix)))

;; indent default offset
(setq-default c-basic-offset 1)

;; 対応する括弧をハイライト
(show-paren-mode t)

(put 'narrow-to-region 'disabled nil)
Posted September 30th, 2010 in General. Tagged: , .

Comments are closed.


track feed