emacs.my.el

.emacs (Fedora 10)
;===================================
;; load path
;===================================
(setq load-path (cons "~/.lisp/" load-path))

(require 'auto-complete)
(global-auto-complete-mode t)

(require 'anything-config)

;====================================
;;; キーバインド
;====================================
(define-key global-map "\C-h" 'delete-backward-char) ; 削除
(define-key global-map "\M-?" 'help-for-help) ; ヘルプ
(define-key global-map "\C-z" 'undo) ; undo
(define-key global-map "\C-ci" 'indent-region) ; インデント
(define-key global-map "\C-c\C-i" 'dabbrev-expand) ; 補完
(define-key global-map "\C-c;" 'comment-region) ; コメントアウト
(define-key global-map "\C-c:" 'uncomment-region) ; コメント解除
(define-key global-map "\C-o" 'toggle-input-method) ; 日本語入力切替
(define-key global-map "\C-\\" nil) ; \C-\の日本語入力の設定を無効にする
(define-key global-map "\C-c " 'other-frame) ; フレーム移動

;====================================
;;; 消すやつ
;====================================
;(menu-bar-mode 0)
(tool-bar-mode 0)
(setq inhibit-startup-message t)
(setq initial-scratch-message "");;バージョンによっては nil だと消えない時ある
(fringe-mode 0);;ムカつくから消してる

;====================================
;;; 色とか見た目とか
;====================================
(set-background-color "Gray12")
(set-foreground-color "LightGray")
(set-cursor-color "Gray")
(set-face-attribute 'mode-line nil :box nil :background "HotPink")
(set-scroll-bar-mode 'right)
(show-paren-mode t)
(blink-cursor-mode 0)
(column-number-mode t)
(line-number-mode)

;====================================
;;;バックアップとか
;====================================
(setq backup-inhibited t)
(setq delete-auto-save-files t)
(setq delete-auto-save-files t)
(setq completion-ignore-case t);;大文字小文字ムシ


;====================================
;;; 行数表示
;====================================
(custom-set-variables '(line-number-mode t)
	      '(column-number-mode t)
	      )


;====================================
; 最近使ったファイル」を(メニューに)表示する
;====================================
; M-x recentf-open-files で履歴一覧バッファが表示される。
(require 'recentf)
;;http://homepage.mac.com/zenitani/elisp-j.html#recentf
;; /sudo:hogehoge などが履歴に残っていると、起動時に毎回パ
;; スワードを聞いてくるのでその履歴だけを削除する。
;;(setq recentf-exclude '("^/[^/:]+:")) ;;tramp対策。
(setq recentf-auto-cleanup 'never) ;;tramp対策。
(recentf-mode 1)


;;;====================================
;;;; Buffer 設定
;;;===================================
;;; iswitchb は、バッファ名の一部の文字を入力することで、
;;; 選択バッファの絞り込みを行う機能を実現します。
;;; バッファ名を先頭から入力する必要はなく、とても使いやすくなります。
(iswitchb-mode 1) ;;iswitchbモードON
;;; C-f, C-b, C-n, C-p で候補を切り替えることができるように。
(add-hook 'iswitchb-define-mode-map-hook
     (lambda ()
       (define-key iswitchb-mode-map "\C-n" 'iswitchb-next-match)
       (define-key iswitchb-mode-map "\C-p" 'iswitchb-prev-match)
       (define-key iswitchb-mode-map "\C-f" 'iswitchb-next-match)
       (define-key iswitchb-mode-map "\C-b" 'iswitchb-prev-match)))

(global-set-key "\C-x\C-b" 'bs-show) ;;bs-showでバッファ選択する。

;====================================
;;shift+矢印キーでの範囲選択
;====================================
(pc-selection-mode)

;====================================
;;全角スペースとかに色を付ける
;====================================
(defface my-face-b-1 '*1) nil)
(defface my-face-b-1 '*2) nil)
(defface my-face-b-2 '*3) nil)
(defface my-face-b-2 '*4) nil)
(defface my-face-u-1 '*5) nil)
(defvar my-face-b-1 'my-face-b-1)
(defvar my-face-b-2 'my-face-b-2)
(defvar my-face-u-1 'my-face-u-1)
(defadvice font-lock-mode (before my-font-lock-mode ())
           (font-lock-add-keywords
                major-mode
                   '(
                          (" " 0 my-face-b-1 append)
                          ("\t" 0 my-face-b-2 append)
                          ("[ ]+$" 0 my-face-u-1 append)
         )))
(ad-enable-advice 'font-lock-mode 'before 'my-font-lock-mode)
(ad-activate 'font-lock-mode)
(add-hook 'find-file-hooks '(lambda ()
                            (if font-lock-mode
                              nil
                              (font-lock-mode t))))


;====================================
;;; タイトルバーにファイル名を表示する
;====================================
(setq frame-title-format (format "%%f" (system-name)))


;====================================
;;; Ctrl + v で貼り付け
;====================================
(defun win-sel ()
 (if (or (null (mark t)) (not mark-active))
     (setq win-sel-v nil))
 win-sel-v)
(defun win-paste () (interactive)
 (if (win-sel) (delete-region (region-beginning) (region-end)))
 (yank))
(global-set-key "\C-v" 'win-paste)



.emacs.my.el

;;; キーバインド
(define-key global-map "\C-h" 'delete-backward-char) ; 削除
(define-key global-map "\M-?" 'help-for-help) ; ヘルプ
(define-key global-map "\C-z" 'undo) ; undo
(define-key global-map "\C-ci" 'indent-region) ; インデント
(define-key global-map "\C-c\C-i" 'dabbrev-expand) ; 補完
(define-key global-map "\C-c;" 'comment-region) ; コメントアウト
(define-key global-map "\C-c:" 'uncomment-region) ; コメント解除
(define-key global-map "\C-o" 'toggle-input-method) ; 日本語入力切替
(define-key global-map "\C-\\" nil) ; \C-\の日本語入力の設定を無効にする
(define-key global-map "\C-c " 'other-frame) ; フレーム移動

;;; 行数表示
(custom-set-variables '(line-number-mode t)
	      '(column-number-mode t)
	      )

;;; 消すやつ
(menu-bar-mode 0)
(tool-bar-mode 0)
(setq inhibit-startup-message t)
(setq initial-scratch-message "");;バージョンによっては nil だと消えない時ある
(fringe-mode 0);;ムカつくから消してる

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2008年11月29日 01:01
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。

*1 t (:background "medium aquamarine"

*2 t (:background "dark turquoise"

*3 t (:background "cyan"

*4 t (:background "SeaGreen"

*5 t (:foreground "SteelBlue" :underline t