Name

HTML/XHTML Editing Macros version 1.1.15 — Vim mappings and menus to make editing HTML/XHTML files quick and easy.

Description

This is a set of HTML/XHTML mappings (macros) and menus for Vim 9 or later. The mappings will be local to the buffer so they will not interfere if you edit other files in the same Vim session.

Until Vim 9 is officially released, you may download a recently patched version of Vim 8.2 for Windows that will support this plugin at tuxproject.de.

Warning: Until Vim 9 is offically released, this plugin and its accompanying helper scripts may randomly break.

Installation

Note: If you have an old installation of this plugin, you need to remove its files first or they may prevent the packed version from loading.

Put "filetype plugin on" in your vimrc.

To install from the zip archive

Extract the HTML.zip archive in your runtime directory (~/.vim for Unix, %USERPROFILE%\vimfiles for Windows; see ":help 'runtimepath'").

This archive includes ftplugin/html/HTML.vim (the main plugin), doc/HTML.txt, autoload/HTML.vim (support functions), commands/HTML.vim (support commands), import/HTML.vim (plugin variables), json/htmlentities.vim (entity mappings and menus), json/htmltags.vim (tag mappings and menus), autoload/BrowserLauncher.vim (functions for remote controlling browsers), autoload/MangleImageTag.vim (functions that allow automatic updating of <IMG> tags), and the toolbar bitmaps.

To install using git

Download and install git.

Unix/MacOS

Type the following in a terminal:

mkdir -p ~/.vim/pack/cjr/start
cd ~/.vim/pack/cjr/start
git clone https://github.com/Heptite/HTML.git

Windows

Press Windows+R and type in "cmd", then type the following into the command window:

mkdir %USERPROFILE%\vimfiles\pack\cjr\start
cd %USERPROFILE%\vimfiles\pack\cjr\start
git clone https://github.com/Heptite/HTML.git

After installing using git you can always update by entering the pack/cjr/start/HTML directory and typing: git pull

See the plugin's Github page for more information.

Manual installation

Note: Manual installation is not recommended. Please consider installing from the zip archive or using the git instructions, which will place the plugin and its associated files in a self-contained "pack" directory. See ":help packages" for more information.

Put HTML.vim in your ftplugin/html/ subdirectory somewhere in your 'runtimepath', then install the files below that you need.

To install for old versions of Vim

The last version that supported Vim 5 is 0.10, the last version that supported Vim 6 is 0.33.1, and the last version that supported Vim 7 is 0.42.6. Support for Vim 8.2 was unintentionally broken.

Other old versions can be found on the plugin's Vim.org page.

Files

These files—except wikipedia.vim—are included in the HTML.zip archive (see "installation" above).

  • Documentation: HTML.txt
    Place this file in the doc subdirectory somewhere in your 'runtimepath' (~/.vim/doc for Unix, %USERPROFILE%\vimfiles\doc for Windows) and run ":helptags <directory>/doc". Then you will be able to do ":help HTML.txt". (You may view the documentation as HTML here.)
  • GUI Toolbar Bitmaps: vim-html-pixmaps.zip
    Extract this in the bitmaps directory somewhere in your 'runtimepath' (~/vim/bitmaps for Unix, %USERPROFILE%\vimfiles\bitmaps for Windows.) (You may view a montage of the pixmaps here.)
  • HTML Plugin Functions: HTML.vim
    This file is essential, and is a different HTML.vim from the main plugin, so be careful! Put this in one of the autoload/ directories in your 'runtimepath' (such as ~/.vim/autoload for Unix, %USERPROFILE%\vimfiles\autoload for Windows) and it will allow the browser control mappings to work.
  • HTML Plugin Commands: HTML.vim
    This file is essential, and is a different HTML.vim from the main plugin, so be careful! Put this in the commands/ directory relative to your 'autoload/HTML.vim' (such as ~/.vim/commands for Unix, %USERPROFILE%\vimfiles\commands for Windows).
  • HTML Plugin Imported Variables: HTML.vim
    This file is essential, and is a different HTML.vim from the main plugin, so be careful! Put this in the import/ directory relative to your 'autoload/HTML.vim' (such as ~/.vim/import for Unix, %USERPROFILE%\vimfiles\import for Windows).
  • Browser Launcher Functions: BrowserLauncher.vim
    Put this in one of the autoload/ directories in your 'runtimepath' and it will allow the browser control mappings to work.
  • Auto-Update Image Tag Size Attributes: MangleImageTag.vim
    This file is placed in one of the autoload/ directories in your 'runtimepath' and it will allow the ;mi mapping to automatically update the WIDTH and HEIGHT attributes of an <IMG> tag.
  • HTML Entities Definition File: htmlentities.json
    This is a special JSON encoded file that defines the HTML entity mappings and corresponding menus all at once. It is placed in a 'json/' directory in your 'runtimepath'.
  • HTML Tags Definition File: htmltags.json
    This is a special JSON encoded file that defines the HTML tag mappings and corresponding menus all at once. It is placed in a 'json/' directory in your 'runtimepath'.

Support

If you have questions, first read the Frequently Asked Questions (text version). This covers the most frequent support requests I get.

If you still have a question or a problem with the plugin, email me, or submit a bug report on the plugin's Github issues page.

The curious can read the ChangeLog (text version), which includes revision notes for all the files listed above.

Some other Vim features and plugins that may be useful for editing (X)HTML:

  • closetag.vim
    This plugin provides functions and mappings to close open HTML/XML tags.
  • :help ft-html-omni
    How to auto-complete tags, attributes, CSS, JavaScript, etc. in Vim 7 or later.
  • html.vim
    For Vim 7.3 or later. Syntax additions for HTML files that enables concealing of some items. This file should be placed in your <runtimepath>/after/syntax/ directory. See my main Vim page for more information.
(Suggestions welcome.)