Difference between revisions of "Skeleton"

From WikEmacs
Jump to navigation Jump to search
(Skeleton: Fix typo)
m (Reverted edits by Debrita (talk) to last revision by Bozhidar)
 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{Package
 +
|name=Skeleton
 +
|description=Insert the complex statement skeleton SKELETON describes very concisely.
 +
|source=http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/skeleton.el
 +
|maintainer=[[FSF]]
 +
|in_emacs=yes
 +
|Development status=active
 +
}}
 +
 
'''Skeleton''' library can be used to create documents based on
 
'''Skeleton''' library can be used to create documents based on
 
templates.
 
templates.
  
= Common Customization =
+
== Keep some chars always balanced ==
  
 
Use the below setting to insert paired characters with just a single
 
Use the below setting to insert paired characters with just a single
keystroke. For example, typing ''('' will automatically insert ''()''
+
keystroke.  
in to the buffer. Similarly typing '{' will automatically insert
+
 
''{}''. This setting is quite useful if you are editing
+
For example, typing ''''('''' will automatically insert ''''()'''' in
 +
to the buffer. Similarly typing ''''{'''' will automatically insert
 +
''''{}''''. This way parenthesis, quotes etc will always remain
 +
balanced. This setting is quite useful if you are editing
 
[[Emacs Lisp]], [[C]] etc.
 
[[Emacs Lisp]], [[C]] etc.
  
Line 18: Line 30:
 
(global-set-key "{" 'skeleton-pair-insert-maybe)
 
(global-set-key "{" 'skeleton-pair-insert-maybe)
 
</source>
 
</source>
 +
 +
[[Category:Minor Mode]]
 +
[[Category:Built-in Package]]
 +
[[Category:Editing]]
 +
[[Category:Template System]]

Latest revision as of 20:19, 7 December 2012

Skeleton
Description Insert the complex statement skeleton SKELETON describes very concisely.
Author name of author
Maintainer FSF
Source http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/skeleton.el
Part of Emacs yes

Skeleton library can be used to create documents based on templates.

Keep some chars always balanced

Use the below setting to insert paired characters with just a single keystroke.

For example, typing '(' will automatically insert '()' in to the buffer. Similarly typing '{' will automatically insert '{}'. This way parenthesis, quotes etc will always remain balanced. This setting is quite useful if you are editing Emacs Lisp, C etc.

(require 'skeleton)
(setq skeleton-pair t)
(global-set-key "\"" 'skeleton-pair-insert-maybe)
(global-set-key "(" 'skeleton-pair-insert-maybe)
(global-set-key "[" 'skeleton-pair-insert-maybe)
(global-set-key "{" 'skeleton-pair-insert-maybe)