Hi,

Mark Woodward wrote:
> 
> came across this [Emacs] link the other day and wondered if Vim
> can do this?
> http://steve-yegge.blogspot.com/

[snip]

> 1. change these to number order starting at 1 (1, 2, 3, 4 etc)
> 2. change these to alpha list (a, b, c, etc)
> [This one has me stumped although I'm sure I've seen something
> along these lines before. ? something to do with sub-replace-special
> and submatch?]
> 
> 
> 1987:Bogotá
> 5243:Fabergé
> 9772:Mallarmé
> 12044:Paraná
> 12499:Poincaré
> 16956:abbé
> 19923:appliqué
> 20932:attaché
> 23704:blasé
> 26223:café
> 26511:canapé
> 29314:cliché
> 31431:consommé
> 38981:décolleté
> 42995:fiancé
> 43623:flambé
> 44996:frappé
> 48317:habitué
> 58328:macramé
> 58898:manqué
> 62514:naiveté
> 65243:outré
> 66710:passé
> 71609:protégé
> 73675:recherché
> 76387:risqué
> 76847:roué
> 77811:sauté
> 82455:soufflé
> 89055:touché
> 96268:émigré
> 96274:études
> 
> 
> any hints?,

1.) if this text starts at line 1

  %s/^\d\+:/\=line('.') . '.) '/

2.) for at most 26 lines

  %s/^\d\+:/\=nr2char(char2nr('a') + line('.') - 1) . ') '/

Regards,
Jürgen

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

Reply via email to