Web-Markup-VimTips

From KRayWiki
Revision as of 05:35, 3 January 2018 by Krb (talk | contribs) (Copy from PmWiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

!! Editing FAQ !!! How do I change unquoted attribute values to quoted values?

  • This colon command changes unquoted numeric attribute values to quoted values \\
 [@g/./s/=\([0-9]*\)\([ >]\)/="\1"\2/g@]

!!! How do I switch HTML or XHTML tag and attribute names to lowercase?

  • Use the following colon commands in a vim editor after making sure that all attribute values are quoted. Attributes without quotes are not modified.
    • Entities \\
  [@%s/<\/\?\zs\(\w\+\)\ze[ >]/\L\1/g@]
    • Attributes \\
  [@%s/\(<[^>]*\)\@<=\<\(\a*\)\ze=['"]/\L\2/g@]

!!! Where can I find lists of character entities?