Open Sloun opened 11 years ago
If you do in Vim :set runtimepath?
in both cases, what do you get? Sounds like in the first case the file isn't getting picked up.
Sorry for late reply. In case when plugin works well I get this: runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after In other case: runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim73,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after It's identical.
I'm sorry, I have no idea. My best guess would be that you have a file somewhere that is checking whether vim is running as gvim and then setting b:did_ftplugin
so that the html.vim file does not load. You should try moving all of your files out and adding them back in to narrow down where the problem is.
Sorry, by 'all your files', I mean all of your ~/.vim files.
This trouble is identical in vim and gvim. Also, I've put plugin in ~/.vim/plugin directory. Because if I move it in ~/.vim/ftplugin it doesn't work at all. I've recreated home directory for user, problem is still here. Test ~/.vim directory: /home/all/makeuser/.vim ├── doc │ └── tags ├── ftplugin ├── .netrwhist ├── plugin │ ├── html.vim │ └── xml.vim └── .VimballRecord
3 directories, 5 files
And .vimrc: makeuser@localhost:~$ cat ~/.vimrc syntax on set nu color elflord
It should work in the ftplugin folder. Try removing the following lines from the top of the html.vim file to see if this resolves the problem:
if exists("b:did_ftplugin")
finish
endif
Unfortunately, that's didn't help.
Maybe it's some bug in debian build of vim, I dont know at all.
How do you open a file once vim is running? If you describe the steps maybe that will help. Also, try :set ft?
when it is working and when it isn't to compare the differences.
Having the same issue here. As soon as I load a file into vim not opening it right away as cli parameter from the shell, the plugin doesn't work anymore.
For example via calling :tabedit file2.html
.
Would really appreciate a fix for this. Thanks for a great plugin ;-)
Are there any similarities with your setup and the one described above?
I can't reproduce this. You guys are going to have to debug it. See if you can narrow down the problem by temporarily removing other plugins, commenting out guard lines of code as I suggested above etc. @Sloun, did you resolve this issue?
Modifying line 10 did the trick for me:
9 augroup matchhtmlparen 10 autocmd! CursorMoved,CursorMovedI,WinEnter <buffer> call s:Highlight_Matching_Pair() 11 augroup END
I'm not that familiar with vim autocommands, so I honestly have no idea what side effects this may cause. I substituted [buffer] by an asterisk and it works like a charm, even with NERDtree.
Oh, btw. I noticed some weird behavior as well: having a tag highlighted in the first buffer and then opening a copy in a second buffer leads to the same tag being highlighted in the second buffer. But nothing happens when repositioning the cursor. In the first buffer all works fine, when I switch back to that....
By substituting an asterisk, this function will be being called for every buffer you open. It suggests that this block is called at least once but not for every buffer. Do you always start vim/gvim with a file argument?
@gregsexton Unfortunately, no. The issue is still here. @Kitzberger Thanks for some fix, I'll try to use it.
@gregsexton Yes, in most cases I do start vim with a file argument.
Out of curiousity: why don't we wanna call the auto command for every buffer? We certainly want the highlighting to work for every buffer, right?
If you don't start with a file argument and open files from within Vim, does the issue still occur?
Not every buffer has tags. With an asterisk it will be applied to every buffer regardless of whether this is appropriate. You could substitute for something like *.html but that defeats being able to symlink the file to provide the functionality for other file types.
Yes, the plugin's only working as long as I open the file as an argument.
Maybe a white list variable for file extensions that do usually contain tags to substitute that asterisk?
Having the same problem I would use the :tabedit and open another html file, but there are no highlights in the new tab, only in the first.
I can't get working html.vim plugin if I open vim first, and then open some file (e.g. open test.html or via NERDTree). In this situation I have this: http://s18.postimg.org/miqsywm8p/Selection_2013_04_24_03_21.png
But if I open file via terminal (gvim test.html) plugin works perfectly: http://s24.postimg.org/sxoaypr45/Selection_2013_04_24_03_22.png
vim version: 7.3.547 (Debian testing)
Thank you.