"

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

"

Ni Va
Hi,


I need to edit buffer that contains vbscript that has " chars and friends ...


Without definitively write current edited file, How can I change all that chars in order to be able to make modification in an easy view ?

Thank you
NiVa

--
--
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: "

Erik Christiansen
On 13.09.18 01:53, Ni Va wrote:
>
> I need to edit buffer that contains vbscript that has " chars and friends ...
>
> Without definitively write current edited file, How can I change all
> that chars in order to be able to make modification in an easy view ?

:%s/&quot/"/

--
--
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: "

Ni Va
Le jeudi 13 septembre 2018 14:13:45 UTC+2, Erik Christiansen a écrit :
> On 13.09.18 01:53, Ni Va wrote:
> >
> > I need to edit buffer that contains vbscript that has " chars and friends ...
> >
> > Without definitively write current edited file, How can I change all
> > that chars in order to be able to make modification in an easy view ?
>
> :%s/&quot/"/

fun! EncodeHtmlEntities(  ) "{{{

  let s:decode = {
                \ "&": '&'  ,
                \ ">": '>'   ,
  \ "&lt;": '<'   ,
  \ "&apos;": "'" ,
  \ "&quot;": '"' }
  for k in keys(s:decode)
      silent! exe "%s/".k.'/\=get(s:decode, submatch(0), submatch(0))/g'
  endfor
 
endfunction "}}}

--
--
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: &quot;

Ruben Safir
On 9/13/18 8:15 AM, Ni Va wrote:
> silent! exe "%s/".k.'/\=get(s:decode, submatch(0), submatch(0))/g'


can you explain this line?


--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

--
--
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: &quot;

Ni Va
Le jeudi 13 septembre 2018 17:20:01 UTC+2, Ruben Safir a écrit :

> On 9/13/18 8:15 AM, Ni Va wrote:
> > silent! exe "%s/".k.'/\=get(s:decode, submatch(0), submatch(0))/g'
>
>
> can you explain this line?
>
>
> --
> So many immigrant groups have swept through our town
> that Brooklyn, like Atlantis, reaches mythological
> proportions in the mind of the world - RI Safir 1998
> http://www.mrbrklyn.com
>
> DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
> http://www.nylxs.com - Leadership Development in Free Software
> http://www2.mrbrklyn.com/resources - Unpublished Archive
> http://www.coinhangout.com - coins!
> http://www.brooklyn-living.com
>
> Being so tracked is for FARM ANIMALS and and extermination camps,
> but incompatible with living as a free human being. -RI Safir 2013
Sorry fr mistake

fun! DecodeHtmlEntities( str ) "{{{

  let s:decode = {
                \ "&amp;": '&'  ,
                \ "&gt;": '>'   ,
  \ "&lt;": '<'   ,
  \ "&apos;": "'" ,
  \ "&quot;": '"' }

  let str_ret=a:str

  for k in keys(s:decode)
  echomsg k.' '.s:decode[k]
      let str_ret = substitute(str_ret, k, s:decode[k], "g")
  endfor

  return str_ret
 
endfunction "}}}

--
--
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.