Tuesday, April 16, 2013

Re: substitution with accented characters




On Wed, Apr 17, 2013 at 3:52 AM, Cesar Romani <cesar.romani@gmail.com> wrote:
Suppose I have the following text:

Diagonalizaci&#243;n de matrices. Formas cuadr&#225;ticas.
El Espacio Af&#237;n
El problema de la Programaci&#243;n Lineal
El Espacio Eucl&#237;deo

How can I replace the &#...; with their corresponding characters?

I know that &#243; is ó
            &#225; is á
            &#237; is í

The text can be very large with several of the &#...;

Hi Cesar,

I am not sure if that is exactly what you are asking for but if your need is to do a "search and replace", you could type this to change &#237; into í :

:%s/&#237;/í/g

Then, similarly:

:%s/&#225;/á/g
:%s/&#243;ó/g

If you need to do this often you may want to record a macro or write a function or look for a plugin that does it.


I installed Tim Pope's unimpaired plugin to try out Drew Neil's suggestion and it works.
With that plugin installed, in normal mode, gg]xG would do the trick.

hope that helps,
nico



 

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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
--
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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment