19. 情報共有 Emacs設定ファイル
(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)
'(scroll-bar-mode (quote right)))
(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.
'(default ((t (:inherit nil :stipple nil :background "white" :foreground "black" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 98 :width normal :foundry "unknown" :family "VL ゴシック")))))
;EmacsのキーバインドをWindows風にしてみる
;設定 変更不可能なものはコメントアウト
;キーバインド一覧を表示するには、
;M-x describe-bindings
(global-unset-key "\E")
(global-unset-key "\C-a")
(global-unset-key "\C-b")
(global-unset-key "\C-c")
(global-unset-key "\C-d")
(global-unset-key "\C-e")
(global-unset-key "\C-f")
;(global-unset-key "\C-g")
(global-unset-key "\C-h")
;(global-unset-key "\C-i")
;(global-unset-key "\C-j")
(global-unset-key "\C-k")
(global-unset-key "\C-l")
;(global-unset-key "\C-m")
(global-unset-key "\C-n")
(global-unset-key "\C-o")
(global-unset-key "\C-p")
(global-unset-key "\C-q")
(global-unset-key "\C-r")
(global-unset-key "\C-s")
(global-unset-key "\C-t")
(global-unset-key "\C-u")
(global-unset-key "\C-v")
(global-unset-key "\C-w")
(global-unset-key "\C-x")
(global-unset-key "\C-y")
(global-unset-key "\C-z")
;設定
(global-unset-key [(escape)])
;redo は無いが、Undoの直後にカーソル入力すると、Undoの方向が変わる(Redoが可能)
;Shell Script modeで、横取りされないように
(define-minor-mode overriding-minor-mode
"強制的にキーバインドを割り当てる" ;説明文字列
t ;デフォルトで有効にする
"" ;モードラインに表示しない
`(
(,(kbd "C-a") . mark-whole-buffer)
(,(kbd "C-c") . copy-region-as-kill)
(,(kbd "C-z") . undo)
(,(kbd "C-x") . kill-region)
(,(kbd "C-v") . yank)
(,(kbd "C-b") . bookmark-set)
(,(kbd "C-j") . bookmark-jump)
(,(kbd "C-r") . query-replace-regexp)
(,(kbd "C-s") . save-buffer-tcs)
(,(kbd "C-f") . isearch-forward)
(,(kbd "<f3>") . isearch-repeat-forward)
(,(kbd "<f2>") . isearch-repeat-backward)
(,(kbd "C-S-f") . isearch-backward)
(,(kbd "<ESC>") . keyboard-quit)
)
)
;Window size. (frame size)
(setq initial-frame-alist '((width . 120) (height . 35)))
(setq default-frame-alist '((width . 120) (height . 35)))
;C++開発用
;http://d.hatena.ne.jp/higepon/20060107/1136628498
;Emacs + GLOBALでソース読みを快適に
; 準備は
; sudo apt-get install global
; cd src_dir(親ディレクトリでOK)
; gtags -v
(autoload 'gtags-mode "gtags" "" t)
(setq gtags-mode-hook
'(lambda ()
(local-set-key "\M-t" 'gtags-find-tag)
(local-set-key "\M-r" 'gtags-find-rtag)
(local-set-key "\M-s" 'gtags-find-symbol)
(local-set-key "\C-t" 'gtags-pop-stack)
))
(add-hook 'c-mode-common-hook
'(lambda()
(gtags-mode 1)
(gtags-make-complete-list)
))
(setq gdb-many-windows t)
(setq gdb-use-separate-io-buffer t) ; "IO buffer" が必要ない場合は nil で
; セーブ前処理を追加
(defun save-buffer-tcs ()
"PS印刷時に文字化けする文字を、安全な文字に変換"
(interactive)
(setq ppp (point))
(mojibake-replace)
(goto-char ppp)
(save-buffer)
)
;日本語印刷
(setq ps-multibyte-buffer 'non-latin-printer)
(require 'ps-mule)
(defalias 'ps-mule-header-string-charsets 'ignore)
;;;印刷設定(postscript用)
;(setq ps-multibyte-buffer 'non-latin-printer)
;(setq ps-lpr-command "/usr/bin/lpr")
;(setq ps-printer-name "ps")
;(setq ps-paper-type 'a4)
;pdfプレビュー
(setq load-path (cons
"~/.emacs.d" ; elファイルのパス
load-path))
;http://en.sourceforge.jp/projects/macemacsjp/scm/svn/blobs/head/pdf-preview/trunk/pdf-preview.el
(require 'pdf-preview)
(setq pdf-preview-preview-command
"evince") ;ここに、PDFファイルを開くコマンドを記述
;ショートカット
(global-set-key "\C-p" 'pdf-preview-buffer)
;印刷時文字化け対策
;http://tanaka-cs.co.jp/download/mojibake.el
(require 'mojibake)
;ショートカット C-s に統合
;(global-set-key "\C-w" 'mojibake-replace)
;謎のバグ対応(Shift-Eが小文字になる)
(global-set-key "\S-e" 'self-insert-command)
前へ / 次へ