2007-05-11

Skeleton-pair mode in Emacs

Emacs is really great editor. A bit clumsy for beginners, but powerful when you get used to it. I have just added skeleton-pair insert stuff to my .emacs file. This enables direct insert of additional character, say ), when I type (. Nice! Here is the elisp code for it - I found it at emacsWiki site


;; enable skeleton-pair insert globally
(setq skeleton-pair t)
(setq skeleton-pair-on-word t) ; apply skeleton trick even in front of a word.
(global-set-key (kbd "(") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "[") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "{") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "\"") 'skeleton-pair-insert-maybe)
(global-set-key (kbd "\'") 'skeleton-pair-insert-maybe)

No comments: