On Thu, 20 Apr 2006, Mark Sargent wrote:

Hi All,

I'm trying to get vi to display an ab like so(minus the \),

ab htm <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
\<html>
\<head>
\<meta content="text/html; charset=UTF-8" http-equiv="content-type">
\<title>NewUser</title>
\</head>
\<body>
\</body>
\</html>
[snip]

Mark,

Here's an alternate suggestion:

You may want to take a look at ":help template". It may be better to
have a file with the HTML header/skeleton elsewhere that you can read in
to your current buffer on demand. For example:

  :read skeleton.htm

This way, you don't have to wrestle with :abbreviate - you can make
skeleton.htm as pretty as you wish (indents and all). Besides,
abbreviating "htm" may cause future problems everytime you do type "htm".

You could try a mapping instead:

  nnoremap \htm :read skeleton.htm<CR>

With the mapping above, in Normal mode, type "\htm" and skeleton.htm
will be inserted into your text.

Hope this helps.
--
Gerald

Reply via email to