Loading ...
Sorry, an error occurred while loading the content.

Need help with html plugins etc.

Expand Messages
  • David Reed
    Hello, I have just recently been introduced to Vim and I m loving it so far. I was able to get Latex going, and I like the support for it and all the macros
    Message 1 of 6 , May 16, 2010
    • 0 Attachment
      Hello,

      I have just recently been introduced to Vim and I'm loving it so far.  I was able to get Latex going, and I like the support for it and all the macros that are available, it makes it really easy. 

      Before I continue, I am NOT using MacVim, I would like to stick to the terminal window if I can.

      I want to start writing html more efficiently but am having problems understanding how to get started.  I see that Mac comes with a vim package already installed with many plugins. Under ftplugin I see html.vim and I have tried to decipher it, but with no luck.
      It appears it is able to do things like tag complete, so if I type <html> a closing </html> automatically is written.

      Is this what it is doing?  If so how can I get it to load?

      I also wanted to ask how to generate a macro that will automatically generate all the basic tags for an html page if I create a brand new html file.


      I appreciate all the help and look forward to hearing back from someone.

      -Dave



      --
      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Andrew Stewart
      Hello, ... I m not familiar with the html.vim ftplugin...but I do recommend the vim-ragtag plugin. http://github.com/tpope/vim-ragtag This gives you really
      Message 2 of 6 , May 17, 2010
      • 0 Attachment
        Hello,

        On 16 May 2010, at 17:10, David Reed wrote:
        > I want to start writing html more efficiently but am having problems understanding how to get started. I see that Mac comes with a vim package already installed with many plugins. Under ftplugin I see html.vim and I have tried to decipher it, but with no luck.
        > It appears it is able to do things like tag complete, so if I type <html> a closing </html> automatically is written.

        I'm not familiar with the html.vim ftplugin...but I do recommend the vim-ragtag plugin.

        http://github.com/tpope/vim-ragtag

        This gives you really good tag completion.

        > I also wanted to ask how to generate a macro that will automatically generate all the basic tags for an html page if I create a brand new html file.

        Put something like this in your .vimrc:

        :autocmd BufNewFile *.html 0r /path/to/your/html_template.html

        This tells Vim to read the file html_template.html into the buffer whenever you make a new HTML file. See `:help template` for a little more information.

        Regards,
        Andy Stewart

        -------
        http://airbladesoftware.com




        --
        You received this message from the "vim_mac" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • David Reed
        Thanks for the help. I found that command shortly after sending the email, but I kept trying to put it into my own ftplugin file and was getting very
        Message 3 of 6 , May 17, 2010
        • 0 Attachment
          Thanks for the help.

          I found that command shortly after sending the email, but I kept trying to put it into my own ftplugin file and was getting very frustrated that it wasn't working. Why does it work when in the vimrc file and not in the ftplugin file?

          Also,  I am now getting the skeleton repeated twice, and think this is because my vimrc is being referenced twice, but how do I find this or get rid of this from happening.

          Thanks again for the help.

          -Dave

          On Mon, May 17, 2010 at 4:41 AM, Andrew Stewart <boss@...> wrote:
          Hello,

          On 16 May 2010, at 17:10, David Reed wrote:
          > I want to start writing html more efficiently but am having problems understanding how to get started.  I see that Mac comes with a vim package already installed with many plugins. Under ftplugin I see html.vim and I have tried to decipher it, but with no luck.
          > It appears it is able to do things like tag complete, so if I type <html> a closing </html> automatically is written.

          I'm not familiar with the html.vim ftplugin...but I do recommend the vim-ragtag plugin.

             http://github.com/tpope/vim-ragtag

          This gives you really good tag completion.

          > I also wanted to ask how to generate a macro that will automatically generate all the basic tags for an html page if I create a brand new html file.

          Put something like this in your .vimrc:

             :autocmd BufNewFile *.html  0r /path/to/your/html_template.html

          This tells Vim to read the file html_template.html into the buffer whenever you make a new HTML file.  See `:help template` for a little more information.

          Regards,
          Andy Stewart

          -------
          http://airbladesoftware.com




          --
          You received this message from the "vim_mac" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          --
          You received this message from the "vim_mac" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Andrew Stewart
          ... I m not certain why without seeing the exact command you put in your ftplugin. Maybe it s because the autocommand in the .vimrc fires for any file ending
          Message 4 of 6 , May 17, 2010
          • 0 Attachment
            On 17 May 2010, at 13:37, David Reed wrote:
            > I found that command shortly after sending the email, but I kept trying to put it into my own ftplugin file and was getting very frustrated that it wasn't working. Why does it work when in the vimrc file and not in the ftplugin file?

            I'm not certain why without seeing the exact command you put in your ftplugin. Maybe it's because the autocommand in the .vimrc fires for any file ending in .html whereas your ftplugin fires only when a file has been identified as html (e.g. perhaps when you save it). Anyway, it would help if you could post your ftplugin snippet.

            > Also, I am now getting the skeleton repeated twice, and think this is because my vimrc is being referenced twice, but how do I find this or get rid of this from happening.

            I'm don't know of a neat way to do this. But you could move all your .(g)vimrc files and .vim directory elsewhere, restart Vim, and slowly add in your plugins and configuration files bit by bit until you isolate the problem. Tedious, but guaranteed to work.

            Regards,

            Andy Stewart
            -------
            http://airbladesoftware.com


            --
            You received this message from the "vim_mac" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • David Reed
            Hi Andrew, I am at work right now so I cannot send you the code, but the line I moved over to the vimrc file was the same as the one I was trying in the
            Message 5 of 6 , May 17, 2010
            • 0 Attachment
              Hi Andrew,

              I am at work right now so I cannot send you the code, but the line I moved over to the vimrc file was the same as the one I was trying in the ftplugin file.  I also put a couple of key mappings in that same ftplugin file to make sure it was even getting hit, and it was.  If I opened an html file, there was no skeleton, but if I ran the exact command that I put into the ftplugin file and then did ':split new.html', it worked (more or less, it was still coming up twice). 

              I have a feeling you are on the right track with your assessment though and I will see if I can create a work around.  I really don't think I want to put all these lines in my vimrc file but if thats the only way to do it I will.

              Thanks again for the help.

              -Dave

              On Mon, May 17, 2010 at 10:47 AM, Andrew Stewart <boss@...> wrote:

              On 17 May 2010, at 13:37, David Reed wrote:
              > I found that command shortly after sending the email, but I kept trying to put it into my own ftplugin file and was getting very frustrated that it wasn't working. Why does it work when in the vimrc file and not in the ftplugin file?

              I'm not certain why without seeing the exact command you put in your ftplugin.  Maybe it's because the autocommand in the .vimrc fires for any file ending in .html whereas your ftplugin fires only when a file has been identified as html (e.g. perhaps when you save it).  Anyway, it would help if you could post your ftplugin snippet.

              > Also,  I am now getting the skeleton repeated twice, and think this is because my vimrc is being referenced twice, but how do I find this or get rid of this from happening.

              I'm don't know of a neat way to do this.  But you could move all your .(g)vimrc files and .vim directory elsewhere, restart Vim, and slowly add in your plugins and configuration files bit by bit until you isolate the problem.  Tedious, but guaranteed to work.

              Regards,

              Andy Stewart
              -------
              http://airbladesoftware.com


              --
              You received this message from the "vim_mac" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              --
              You received this message from the "vim_mac" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • dacresni
              I ve never seen that functionality in vi before, I ll give it a look. I think there s a template package for vi, look it up on http://www.vim.org/scripts/ ...
              Message 6 of 6 , May 17, 2010
              • 0 Attachment
                I've never seen that functionality in vi before, I'll give it a look.
                I think there's a template package for vi, look it up on http://www.vim.org/scripts/

                On May 16, 11:10 am, David Reed <david.ree...@...> wrote:
                > Hello,
                >
                > I have just recently been introduced to Vim and I'm loving it so far.  I was
                > able to get Latex going, and I like the support for it and all the macros
                > that are available, it makes it really easy.
                >
                > Before I continue, I am NOT using MacVim, I would like to stick to the
                > terminal window if I can.
                >
                > I want to start writing html more efficiently but am having problems
                > understanding how to get started.  I see that Mac comes with a vim package
                > already installed with many plugins. Under ftplugin I see html.vim and I
                > have tried to decipher it, but with no luck.
                > It appears it is able to do things like tag complete, so if I type <html> a
                > closing </html> automatically is written.
                >
                > Is this what it is doing?  If so how can I get it to load?
                >
                > I also wanted to ask how to generate a macro that will automatically
                > generate all the basic tags for an html page if I create a brand new html
                > file.
                >
                > I appreciate all the help and look forward to hearing back from someone.
                >
                > -Dave
                >
                > --
                > You received this message from the "vim_mac" maillist.
                > Do not top-post! Type your reply below the text you are replying to.
                > For more information, visithttp://www.vim.org/maillist.php

                --
                You received this message from the "vim_mac" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              Your message has been successfully submitted and would be delivered to recipients shortly.