Stop vim from adding closing " in HTML omni-completion

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Stop vim from adding closing " in HTML omni-completion

Marlun
Hi!

In HTML omnicompletion vim searches <style> and included stylesheets when you are adding classes to tags like <div class="| but when it adds the values it also adds an ending ". That ending " clashes with my auto-pairs functionality (plugin) which has already added an ending " so the result becomes class="classname"|" which is not very nice. Can you stop vim from adding the ending "? It would be nice if it could be changed with an option.

Best regards,

Martin Lundberg

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: Stop vim from adding closing " in HTML omni-completion

David Fishburn-2
I had a quick look at the code and didn't see a way to turn it off.
Though, I am not familiar with the code for that plugin, so it was more of a cursory inspection.

David


On Tue, Jan 22, 2013 at 12:00 PM, Martin Lundberg <[hidden email]> wrote:
Hi!

In HTML omnicompletion vim searches <style> and included stylesheets when you are adding classes to tags like <div class="| but when it adds the values it also adds an ending ". That ending " clashes with my auto-pairs functionality (plugin) which has already added an ending " so the result becomes class="classname"|" which is not very nice. Can you stop vim from adding the ending "? It would be nice if it could be changed with an option.

Best regards,

Martin Lundberg

--
You received this message from the "vim_use" 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_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: Stop vim from adding closing " in HTML omni-completion

Benjamin R. Haskell-8
In reply to this post by Marlun
On Tue, 22 Jan 2013, Martin Lundberg wrote:

> Hi!
>
> In HTML omnicompletion vim searches <style> and included stylesheets
> when you are adding classes to tags like <div class="| but when it
> adds the values it also adds an ending ". That ending " clashes with
> my auto-pairs functionality (plugin) which has already added an ending
> " so the result becomes class="classname"|" which is not very nice.
> Can you stop vim from adding the ending "? It would be nice if it
> could be changed with an option.

It can't be changed with an option, but it appears to be easily
disabled through manually editing the htmlcomplete file.

On line 380 (or so) of $VIMRUNTIME/autoload/htmlcomplete.vim, replace:

  let classquote = matchstr(classbase, '.$')

with:

  let classquote = ''

It worked in cursory testing.  Perhaps someone should add it as an
option.

And, as always, you shouldn't actually edit files in $VIMRUNTIME.
(Changes will be wiped out if you upgrade Vim.)  Save the modified copy
in your own ~/.vim/autoload/ directory.

--
Best,
Ben

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: Stop vim from adding closing " in HTML omni-completion

Marlun
On Wednesday, January 23, 2013 9:32:10 AM UTC+1, Benjamin R. Haskell wrote:
> On line 380 (or so) of $VIMRUNTIME/autoload/htmlcomplete.vim, replace:
> let classquote = matchstr(classbase, '.$')
> with:
> let classquote = ''

Thanks, works great.

> It worked in cursory testing.  Perhaps someone should add it as an
> option.

That would be nice since now that I've added this file to my autoload folder it will shadow newer htmlcomplete.vim files that comes with vim, will it not?

-Martin

--
You received this message from the "vim_use" 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