HTML/XHTML Editing Plugin: Frequently Asked Questions


Index:

  1. Why am I getting an error when I try to set options for the plugin?
  2. How do I disable the tab mapping?
  3. How do I prevent the plugin from overriding mappings I have defined?
  4. How do I disable any mapping?
  5. How do I make the mappings insert uppercase tags instead of lowercase?
  6. How do I make the mappings insert XHTML tags?
  7. How do I change the map leader from ; or the character entities map leader from & to something else?
  8. How do I keep the mappings from interfering when I edit CSS, JavaScript, PHP, etc?
  9. Where is the VimBall archive?
  10. Is there an HTML/XHTML strict mode for the mappings?


1. Why am I getting an error when I try to set options for the plugin?

You need to initialize the configuration dictionary variable to an empty value first, by doing ":let g:htmlplugin = {}" in your vimrc before any other configuration commands.

More information:

2. How do I disable the tab mapping?

You can disable the default tab mapping by putting ":let g:htmlplugin.no_tab_mapping = 'yes'" in your vimrc.

This will change the default tab mapping to <lead>tab (;tab) instead.

More information:

3. How do I prevent the plugin from overriding mappings I have defined?

You can prevent the plugin from overriding a mapping you have defined elsewhere—such as in your ~/.vimrc—by putting ":let g:htmlplugin.no_map_override = 'yes'" in your vimrc.

More information:

4. How do I disable any mapping?

You can disable any mapping that the plugin defines by adding an entry that will match it to "g:htmlplugin.no_maps", which is a list. For example, to disable the ;ah and ;im mappings for all modes, put ":let g:htmlplugin.no_maps = [';ah', ';im']" in your vimrc.

Mappings that match this list will be suppressed regardless of the mode the mapping is for, and the list will not undergo g:htmlplugin.map_leader and g:htmlplugin.map_entity_leader substitution.

More information:

5. How do I make the mappings insert uppercase tags instead of lowercase?

You can make the output of the mappings uppercase by putting ":let g:htmlplugin.tag_case = 'uppercase'" in your vimrc.

More information:

6. How do I make the mappings insert XHTML tags?

You can make the mappings output transitional XHTML by putting ":let g:htmlplugin.do_xhtml_mappings = 'yes'" in your vimrc.

More information:

7. How do I change the map leader from ; or the character entities map leader from & to something else?

You can change the default leader from ";" to something else—"_" for example—by putting ":let g:htmlplugin.map_leader = '_'" in your vimrc.

You may also change the leader for the &-mappings by putting something like ":let g:htmlplugin.map_entities_leader = '\'" in your vimrc.

More information:

8. How do I keep the mappings from interfering when I edit CSS, JavaScript, PHP, etc?

You can temporarily turn off all the mappings for the current buffer by typing ":HTMLplugin disable" within Vim. You can re-enable them with ":HTMLplugin enable".

You can shorten the command to just ":HTML" and the arguments "off" and "on" are valid.

More information:

9. Where is the VimBall archive?

VimBall is no longer supported as an installation method.


10. Is there an HTML/XHTML strict mode for the mappings?

No, because it is assumed that when an author wants strict (X)HTML he will not use the mappings that output transitional tags.

The only concession to strict mode is the ";s4" mapping.

More information: