How can one close HTML tags in Vim quickly ?

How can one close HTML tags in Vim quickly ?

Asked on December 27, 2018 in XML.
Add Comment


  • 3 Answer(s)

         One can close HTML tags in Vim by  closetag.vim

    Functions and mappings to close open HTML/XML tags
    

         Similarly use this link https://www.vim.org/scripts/script.php?script_id=13

     

    Answered on December 27, 2018.
    Add Comment

         The xmledit plugin will be useful. This will add two parts of components:

    1. While opening a tag  type <p>, it fastly expands the tag as we type the closing > into <p></p> and places the cursor inside the tag in insert mode.
    2. Then immediately typing another > , for example type <p>>, it enlarge that into

               <p>

               </p>

    and places the cursor inside the tag, sectioned once, in insert mode. The xml vim plugin will add code folding and nested tag that relating to these features.

    Answered on December 27, 2018.
    Add Comment

         To close HTML tags in Vim quickly, simply use,

    imap ,/ </<C-X><C-O>
    
    Answered on December 27, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.