Snippets are extremely useful feature of Gedit that make it usable for TextMate fiends like myself. They work exactly the same as in TM: in Gedit go to Edit -> Preferences -> Plugins and put a check next to “Snippets”. Now open, say, an html file, type body and press TAB. Gedit will automatically fill in the whole body tag complete with closing tag and your cursor conveniently resting in the id argument ready to fill in a value.
Snippets for HTML
Here’s a list of all the Snippets for html files. They are listed by tag names, with the TAB trigger in paratheses. These will only work in html files, other files have different snippets.
- Base (base)
- Body (body)
- Br (Shift+Ctrl+Space)
- Div (div)
- Form (form)
- Head (head)
- Heading (h)
- HTML — 4.01 Strict (doctype)
- HTML — 4.0 Transitional (doctype)
- Input (input)
- Link (link)
- Mail Anchor (mailto)
- Meta (meta)
- Non-Breaking Space (Ctrl+Alt+Space)
- Script (script)
- Script With External Source (scriptsrc)
- Style (style)
- Table (table)
- Table Row (tr)
- Text Area (textarea)
- Title (title)
- Wrap Selection as Link (ref, Shift+Alt+L)
- Wrap Selection in Open/Close Tag (Shift+Alt+W)
- XHTML — 1.0 Frameset (doctype)
- XHTML — 1.0 Strict (doctype)
- XHTML — 1.0 Tran (doctype)
- XHTML — 1.1 (doctype)