Problem with matchit when editing html

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with matchit when editing html

Cesar Romani-2
I'm using vim 7.4.591 on Windows 7.
I'm editing an html file with the matchit plugin installed.
Using % I can jump from <body> to </body>, <script> to </script>, etc.
but not from ( to ), { to }, or [ to ] although "set mps" reports
(:),{:},[:],<:>

How can I add these pairs whenever I'm editing an html file?
If I do, for example, "let b:match_words='(:)'" then all other default
pairs get lost!

Many thanks in advance,

--
Cesar

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with matchit when editing html

Christian Brabandt
Hi Cesar!

On Fr, 23 Jan 2015, Cesar Romani wrote:

> I'm using vim 7.4.591 on Windows 7.
> I'm editing an html file with the matchit plugin installed.
> Using % I can jump from <body> to </body>, <script> to </script>, etc.
> but not from ( to ), { to }, or [ to ] although "set mps" reports
> (:),{:},[:],<:>
>
> How can I add these pairs whenever I'm editing an html file?
> If I do, for example, "let b:match_words='(:)'" then all other default
> pairs get lost!

You need let b:match_words.='(:)'

for the rest see http://vimhelp.appspot.com/vim_faq.txt.html#faq-26.1

Best,
Christian
--
Ich verachte Leute, die Hunde halten. Das sind Feiglinge, die sich
nicht trauen, die Leute selber zu beißen.
                -- August Strindberg

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with matchit when editing html

Benji Fisher-2
In reply to this post by Cesar Romani-2
On Fri, Jan 23, 2015 at 4:03 PM, Cesar Romani <[hidden email]> wrote:
I'm using vim 7.4.591 on Windows 7.
I'm editing an html file with the matchit plugin installed.
Using % I can jump from <body> to </body>, <script> to </script>, etc.
but not from ( to ), { to }, or [ to ] although "set mps" reports
(:),{:},[:],<:>

How can I add these pairs whenever I'm editing an html file?
If I do, for example, "let b:match_words='(:)'" then all other default
pairs get lost!

Many thanks in advance,

     Matchit.vim is supposed to add the 'mps' value to the end of b:match_words.  Sometimes this fails, for example if you :source matchit.vim after loading the file.  To force the script to re-parse, try

:MatchDebug

HTH  --Benji Fisher 

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with matchit when editing html

Cesar Romani-2
On 23/01/2015 04:22 p.m., Benji Fisher wrote:
 > On Fri, Jan 23, 2015 at 4:03 PM, Cesar Romani <[hidden email]
 > <mailto:[hidden email]>> wrote:
 >
 >     I'm using vim 7.4.591 on Windows 7.
 >     I'm editing an html file with the matchit plugin installed.
 >     Using % I can jump from <body> to </body>, <script> to </script>,
 >     etc. but not from ( to ), { to }, or [ to ] although "set mps"
 >     reports
 >     (:),{:},[:],<:>
 >
 >     How can I add these pairs whenever I'm editing an html file?
 >     If I do, for example, "let b:match_words='(:)'" then all other
 >     default pairs get lost!
 >
 >     Many thanks in advance,
 >
 >
 >       Matchit.vim is supposed to add the 'mps' value to the end of
 > b:match_words.  Sometimes this fails, for example if you :source
 > matchit.vim after loading the file.  To force the script to re-parse,
 > try
 >
 > :MatchDebug
 >
 > HTH  --Benji Fisher

Thanks it works. Actually I'm not sourcing matchit.vim, because it is on
the plugin folder. Should I source matchit.vim notwithstanding? I don't
want to run :MatchDebug every time.

Many thanks in advance,

--
Cesar

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Problem with matchit when editing html

Cesar Romani-2
In reply to this post by Christian Brabandt
On 23/01/2015 04:18 p.m., Christian Brabandt wrote:
 > Hi Cesar!
 >
 > On Fr, 23 Jan 2015, Cesar Romani wrote:
 >
 >> I'm using vim 7.4.591 on Windows 7.
 >> I'm editing an html file with the matchit plugin installed.
 >> Using % I can jump from<body>  to</body>,<script>  to</script>, etc.
 >> but not from ( to ), { to }, or [ to ] although "set mps" reports
 >> (:),{:},[:],<:>
 >>
 >> How can I add these pairs whenever I'm editing an html file?
 >> If I do, for example, "let b:match_words='(:)'" then all other default
 >> pairs get lost!
 >
 > You need let b:match_words.='(:)'
 >
 > for the rest see http://vimhelp.appspot.com/vim_faq.txt.html#faq-26.1
 >
 > Best,
 > Christian

Thanks Christian, but it doesn't work. The tags get messed up, even if
I do ":MatchDebug" afterwards.

For example, on the file below, I can't go from ( to ) or from { to },
only from < to > or <script to </script>
but if I do "let b:match_words.='(:)'" I can verify with "let
b:match_words" that the pair is included, but I cannot go from <script
to </script> or from ( to ) anymore.

If I close and load the file again and first run ":MatchDebug" it works.
Apparently this is the only solution.

--------------------
<html>
<head>
<title>Test</title>
<script type="text/x-mathjax-config">
   MathJax.Hub.Config({
     TeX: {
       equationNumbers: {autoNumber: "all"}
     },
     tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
   });
</script>
</head>
<body>
   This is only a test
</body>
</html>
--------------------


Regards,

--
Cesar

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

SyncEdit plugin wanted

Егор
In reply to this post by Benji Fisher-2
Is there a plugin that allows to do something like on attached gif? I
found it on lazarus. Allows to select text and change all words in
selected area.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

syneditsyncro.gif (373K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SyncEdit plugin wanted

Christian Brabandt
Hi Егор!

On Fr, 06 Mär 2015, Егор wrote:

> Is there a plugin that allows to do something like on attached gif?
> I found it on lazarus. Allows to select text and change all words in
> selected area.

Looks like the multiple cursor feature:
https://github.com/terryma/vim-multiple-cursors

Best,
Christian
--
Konversation ist die Kunst zu reden, ohne zu denken.
                -- Victor de Kowa

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: SyncEdit plugin wanted

Ethan Hereth
Good morning Erop,

On Fri, Mar 6, 2015 at 6:33 AM, Christian Brabandt <[hidden email]> wrote:
Hi Егор!

On Fr, 06 Mär 2015, Егор wrote:

> Is there a plugin that allows to do something like on attached gif?
> I found it on lazarus. Allows to select text and change all words in
> selected area.

 
You also might look into Dr. Chip's vis.vim; it is not quite as fancy as the gif you attached, but it can do the same thing


Cheers,

Ethan Alan
 
Looks like the multiple cursor feature:
https://github.com/terryma/vim-multiple-cursors

Best,
Christian
--
Konversation ist die Kunst zu reden, ohne zu denken.
                -- Victor de Kowa

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

js reference in vim

Егор
Perlusers has perldoc and some vim plugins, like perlsupport, allows to
view reference about perl keyword in new split. Is there a way to do
something like this for javascript?

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: js reference in vim

Paul Isambert
Le vendredi 27 mars 2015 à 10:13, Егор a écrit:
> Perlusers has perldoc and some vim plugins, like perlsupport, allows to view
> reference about perl keyword in new split. Is there a way to do something
> like this for javascript?

This might not help you much, but anyway. I have this for R (here in
simplified form):

    " This is in ftplugin/r.vim.
    function! s:RHelp (f)

      " Split screen.
      silent split R\ Help

      " Call to the 'R' command to display help; a bit of string
      " manipulation is actually performed on the result, to remove
      " formatting of the R help.
      exe "0read !R --slave -e '?" . a:f . "'"

      " Not necessary, but I have additional things in
      " ftplugin/rhelp.vim.
      set ft=rhelp

      " Set the cursor at the beginning of the file.
      call cursor(1, 1)
    endfunction

    " I now use ':Rhelp keyword'.
    com! -buffer -nargs=1 Rhelp call s:RHelp(<q-args>)

This shouldn’t be too hard to adapt to JS if you can find a reference
in appropriate form. On that point, I don’t know if there exists a JS
doc readable in a terminal.

Best,
Paul

--
--
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 because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.