2009年5月28日木曜日

【mac】ターミナルのlsに色をつける(bash)


GNUのCoreutilsを使う.
ここからcoreutils-7.3.tar.gzを落とす.

次はターミナルでインストール
$ tar xfvs coreutils-7.3.tar.gz
$ cd coreutils
$ configure
$ make
$ sudo make install

次は.bashrcに以下を書き込む
export LS_COLORS="no=00;31:fi=00;37:di=00;36:ln=00;31:ex=00;31"
(この設定はここを参照)
alias ls='ls --color'

最後にターミナルの環境設定で「ANSIカラーを表示」にチェックを入れる.

2009年5月19日火曜日

【mac】emacsの設定

忘れると困るのでメモメモ。
emacsの設定

------------------------------------------
;;分割ウィンドウの移動
(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))

;;w3mの設定
(require 'w3m-load)
(setq w3m-key-binding 'info)
;; browse-url w3m
(autoload 'w3m-browse-url "w3m" "Ask a WWW browser to show a URL." t)
(setq browse-url-browser-function 'w3m-browse-url)
;; URIらしき部分を選択してC-xmするとemacs-w3m起動
(global-set-key "\C-xm" 'browse-url-at-point)

;;全画面にしたり戻したり
(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)


;;タグジャンプする為の設定
(defadvice find-tag (before c-tag-file activate)
  "Automatically create tags file."
  (let ((tag-file (concat default-directory "TAGS")))
    (unless (file-exists-p tag-file)
      (shell-command "etags *.[ch] *.el .*.el -o TAGS 2>/dev/null"))
    (visit-tags-table tag-file)))


;; プロキシを利用せずに接続するサイトの設定
;;(setq w3m-no-proxy-domains '("localhost" "museion" "mikilab"))

;;tag-file activate)
 ;; "Automatically create tags file."
 ;; (let ((tag-file (concat default-directory "TAGS")))
 ;;   (unless (file-exists-p tag-file)
 ;;     (shell-command "etags *.[ch] *.el .*.el -o TAGS 2>/dev/null"))
 ;;   (visit-tags-table tag-file)))

 ;; (interactive)
 ;; (if (frame-parameter nil 'fullscreen)
  ;;  (set-frame-parameter nil 'fullscreen nil)

;; 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)

;; スタートアップページを表示しない
(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 180)
;;(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)

2009年5月4日月曜日

【mac】メモリ増設



macbookのメモリの増設を行った。
4Gのメモリ増設をAppleStoreで行うと24,500円するが,
日本橋で同じメモリを探したら4200円で売ってたw!

メモ:ホワイトmacbookでは,DDR2 667Mhz(PC2-5300 200pin)