Ubuntu 8.04 LTS (Hardy Heron)でEmacsを動かす.
「システム / システム管理 / 日本語版セットアップ・ヘルパ」で
emacs-env-ja
を選択していれば,
基本的にはEmacs 22 (GTK)がインストールされているはず.
インストールされていなければ,
「システム / システム管理 / 日本語版セットアップ・ヘルパ」を起動し,
emacs-env-ja
を選択する.
EmacsではControlキーやMetaキーを多用するので, 以下のようにCapsLockキーもControlキーとして利用可能し, またAltキーがMetaキーとして利用できるようにする.
さらに,以下を設定しておく.
emacs &
」と入力して起動するemacs -nw
」と入力して起動するフォントをインストール
$ apt-get install xfonts-shinonome $ xset fp rehash
以下の内容を追加した .Xresources
ファイルをホームディレクトリに作成する.
!Emacs*Background: MidnightBlue !Emacs*Foreground: White Emacs*fontSetList: 0,1,2,3,4,5 Emacs.Fontset-0:-*-gothic-bold-r-normal-*-10-*-*-*-*-*-fontset-10 Emacs.Fontset-1:-*-gothic-bold-r-normal-*-12-*-*-*-*-*-fontset-12 Emacs.Fontset-2:-*-gothic-bold-r-normal-*-14-*-*-*-*-*-fontset-14 Emacs.Fontset-3:-*-gothic-bold-r-normal-*-16-*-*-*-*-*-fontset-16 Emacs.Fontset-4:-*-gothic-bold-r-normal-*-18-*-*-*-*-*-fontset-18 Emacs.Fontset-5:-*-gothic-bold-r-normal-*-20-*-*-*-*-*-fontset-20 Emacs.Font: fontset-16
!
から始まる行はコメントなので,文字色や背景色を変更したい場合は適当に編集する.
作成後,以下を実行し,emacsを起動する.
$ xrdb -remove ~/.Xresources $ xrdb -merge ~/.Xresources $ emacs &
emacsのウィンドウ上でShift+左ボタンで表示されるメニュー中の Fontsetにより,10ポイントから20ポイントのフォントを選択できる.
これでも,あまりフォントは綺麗とはいえない.
端末から emacs -nw
として起動したほうが良いかもしれない.
なお apt-get install emacs-snapshot
としてインストールできるEmacs 23なら,
アンチエイリアスが利用でき,より綺麗な表示が可能なようだ.
.emacs
ファイルの作成以下のようにしてホームディレクトリに .emacs
ファイルを作成する.
$ cp /usr/share/doc/emacs-env-ja/dot.emacs.example ~/.emacs
Emacsの動作をカスタマイズするEmacs lispファイルの置き場を作成する.
$ mkdir ~/.emacs.d/lisp
.emacs
ファイルを編集し,最初の行に以下を追加する.
(add-to-list 'load-path "~/.emacs.d/lisp")
必要になれば,Emacs Lispのファイル(xxx.el等)を ~/.emacs.d/lisp/
のディレクトリ中に置き,
.emacs
ファイル中で (load-library "xxx")
等として読み込む.
「C-u M-x byte-recompile-directory」で ~/.emacs.d/lisp/
を指定すれば,
ディレクトリ中のEmacs Lispファイルがバイトコンパイルされるので,
読み込みが高速になる.
$ sudo apt-get install aspell-el aspell-en
ファイルを開いて, 「M-x ispell-buffer RET」でスペルチェックできる.
.emacs
中に以下を記述する.
(global-set-key "\C-h" 'delete-backward-char)
以下のようにしてインストールする.
$ sudo apt-get install html-helper-mode
「C-x d RET」で現在のディレクトリのファイル一覧が表示される. 「f」でカーソル上のファイルを編集することができる等, 一種のファイラーである.
.emacs
中に以下を記述すれば,diredバッファ上で「o」をタイプすると,
nautilusファイルブラウザ中でアイコンをダブルクリックしたのと
同様の(厳密には異なる)動作になる.
(add-hook 'dired-load-hook (function (lambda () (define-key dired-mode-map "o" 'dired-open-file) ))) (defun dired-open-file () "In dired, open the file named on this line." (interactive) (let* ((file (dired-get-filename))) (message "Opening %s..." file) (call-process "gnome-open" nil 0 nil file) (message "Opening %s done" file) ))
「M-x shell RET」でEmacs内でshellターミナルが開かれる. 実行結果を残したい時などに便利.
「M-x info RET」でGNU関係の様々なオンラインマニュアルが表示される.
UbuntuでLaTeX を参照.
作成中