2009年10月17日土曜日

【mac】emacs設定2

友達に教えてもらったauto-complete機能.かなりの優れもの.
emacsの設定も結構変更したので,メモメモ

************************************************
;;loadを読み込ます
(load "~/.emacs.d/auto-complete.el")

;;auto-completeの設定
(require 'auto-complete)
(global-auto-complete-mode t)


;; for CUDA Program
(setq auto-mode-alist
(cons (cons "\\.cu$" 'c++-mode) auto-mode-alist))

;;分割ウィンドウの移動
(windmove-default-keybindings)
(global-set-key [?\C-x up] (quote windmove-up))
(global-set-key [?\C-x down] (quote windmove-down))
(global-set-key [?\C-x right] (quote windmove-right))
(global-set-key [?\C-x left] (quote windmove-left))
(global-set-key "\C-xp" (lambda () (interactive)(other-window -1)))

;;全画面にしたり戻したり
(defun my-mac-toggle-max-window()
(interactive)
(if (frame-parameter nil 'fullscreen)
(set-frame-parameter nil 'fullscreen nil)
(set-frame-parameter nil 'fullscreen 'fullboth)))
(global-set-key "\C-cm" 'my-mac-toggle-max-window)

;;画像ファイルを表示
(auto-image-file-mode t)
;;(define-key global-map "\C-c " 'other-frame) ; フレーム移動

;; C-c c で compile コマンドを呼び出す
(define-key mode-specific-map "c" 'compile)
;; C-c v で recompile コマンドを呼び出す
(define-key mode-specific-map "v" 'recompile)
;; C-c s で shell コマンドをよびだす
(define-key mode-specific-map "s" 'shell)
;; C-c b で buffer-menu コマンドを呼び出す
(define-key mode-specific-map "b" 'buffer-menu)

;; スタートアップページを表示しない
(setq inhibit-startup-message t)

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

;; Macのキーバインドを使う。optionをメタキーにする。
(mac-key-mode 1)
(setq mac-option-modifier 'meta)

;; タブキー
(setq default-tab-width 4)
(setq indent-line-function 'indent-relative-maybe)

;; シフト + 矢印で範囲選択
(setq pc-select-selection-keys-only t)
(pc-selection-mode 1)

;; フォント設定
(set-face-attribute 'default nil
:family "monaco"
:height 110)
;;(if (eq window-system 'mac) (require 'carbon-font))
;;(fixed-width-set-fontset "hirakaku_w3" 10)
;;(setq fixed-width-rescale nil)

;; ウィンドウ設定
(if window-system (progn
(setq initial-frame-alist '((width . 80) (height . 30) (top . 20)))
(set-background-color "Black")
(set-foreground-color "White")
(set-cursor-color "Gray")
))

;; ウィンドウを透明化
(add-to-list 'default-frame-alist '(alpha . (0.85 0.85)))

;; メニューバーを隠す
(tool-bar-mode -1)
(put 'set-goal-column 'disabled nil)
************************************************

0 件のコメント: