投稿

11月, 2009の投稿を表示しています

The textedit.app

MacOS X のオマケくらいの感じでついてくる textedit.app ですが、 これが、実は結構、高性能です。 最も強く実感するのは、英語の文章を書いているときです。 たとえば、''the'' を ''hte'' と入力してしまった時、 ひっそりと、(かってに?) ''the'' と直してくれます。 私は基本的には、viper-mode on emacs を長い文章を書くのに使いますが、 たとえ、flyspell-mode を使用しても、単語の自動修正はしてくれません。 一所懸命に、Meta+$ (Shift+4) をおして、仕上げていきます。 私の英語力でしたら、textedit で入力してペーストする方が、 まちがいが少なく、早いかもしれません。 ただし、emacs上で、おりかえしの設定をやりなすのは、 ちょっと面倒な気もしますが。。。 textedit.app は、なんとも、あなどるべからずですね。

Viper-mode on Emacs で折り返し表示時に次の表示行へ移動する。

Viper-mode on Emacs で折り返し表示時に次の表示行へ移動する方法です。 2段階の設定が必要です。 まず、Control+P or N でも折り返し行に対応できるように下記を設定に入れます。 (defun previous-window-line (n) (interactive "p") (let ((cur-col (- (current-column) (save-excursion (vertical-motion 0) (current-column))))) (vertical-motion (- n)) (move-to-column (+ (current-column) cur-col)))) (defun next-window-line (n) (interactive "p") (let ((cur-col (- (current-column) (save-excursion (vertical-motion 0) (current-column))))) (vertical-motion n) (move-to-column (+ (current-column) cur-col)))) (global-set-key "\C-p" 'previous-window-line) (global-set-key "\C-n" 'next-window-line) つぎに、''j'' and ''l'' のキーを新しく指定し直します。 (define-key viper-vi-global-user-map "j" 'next-window-line) (define-key viper-vi-global-user-map "k" 'previous-window-line)

LaTeX でハイフネーションを禁止する。

LaTeXで英単語等のハイフネーションを禁止するには、下記をプリアンブルに記載します。 \hyphenpenalty=10000\relax \exhyphenpenalty=10000\relax \sloppy

viper-mode で前の行と後の行を行き来する。

Viper-mode on Emacs において、''l'' または ''h'' で、前の行と後ろの行に移動できないという悩みがありました。下の呪文を .emacs に書き込んで解決です。なにか、情けない設定のようにも見えます。 (define-key viper-vi-global-user-map "l" 'forward-char) (define-key viper-vi-global-user-map "h" 'backward-char)