tags:

views:

230

answers:

2

I am using the closetag.vim plugin, but it doesn't seem to work for all tags. In the plugin code there is the ignored tags var that contains some one that I noticed were not closing ex dd dl, but there are many others that aren't in the list that are not working (p, ul, li).

Nothing seemed to happen after updating the list of ignored tags.

To get this plugin to work you just enter the tag text and click tab, right? ie div

Am I missing something?

+1  A: 

How did you install the plugin?

I had troubles with closetag.vim when I installed it in ~/.vim/plugins. Then I moved it into ~/.vim/scripts instead, and added the following to my .vimrc:

:let g:closetag_html_style=1
:source ~/.vim/scripts/closetag.vim

and now it works fine for me. I find that it closes all tags (including those included in the 'ignore' list), but not those that are self-closing (e.g. <img/>).

In the version of the script that I am using (0.9.1), it defines <C-_> as the trigger for completing tags. If you have mapped the command to <tab>, then that should work too.

nelstrom
I also put it in the plugins folder. As mentioned it works on some tags just not some very common ones (p, ul, li). I will try what you mentioned.
chris
I get the same thing as before. Am I not using the plugin properly? I hit the Tab key to complete a tag. For the tags that I mentioned it doesn't work the cursor just tabs over 2 chars.
chris
Did you configure the tab key as the closetag trigger? As I said before, the default is <C-_> (control+underscore). What happens if you press that?
nelstrom
A: 

I also cannot get this plugin to work, however in my case what it does it throw out a number of error messages before finally working. For instance if I try to close an H1 tag I will get the error Error Detected while processing function GetCloseTag and the error is an undefined variable b:UnaryTagsStack.

Seems like it would be a useful plugin but it just won't cooperate.

gaoshan88
My new favourite is the allml.vim plugin by Tim Pope. It hasn't failed me yet.
chris