Loading ...
Sorry, an error occurred while loading the content.

Re: equivalent of sed 'y/abc/def/' in vim

Expand Messages
  • Andy Wokula
    ... or (without :s) ... -- Andy --~--~---------~--~----~------------~-------~--~----~ You received this message from the vim_use maillist. For more
    Message 1 of 6 , Sep 7, 2008
    • 0 Attachment
      thomas schrieb:
      > 2008/9/6 Anton Sharonov <anton.sharonov@...>:
      >> 2008/9/6, thomas <thomas.bsd@...>:
      >>> To do some transliteration, I use something like:
      >>> :%!sed 'y/abc/def/'
      >>>
      >>> It works well.
      >>> Is there a builtin function that does the same?
      >> :%s/^.*$/\=tr(submatch(0),"au","äü")
      >
      > Thanks Anton!
      >
      > Tony, it was precisely to avoid the drawbacks of multiple simple
      > substitution commands that I was looking for something better than
      > "%s/a/d/; %s/b/e/; %s/c/f/".
      >
      > ++
      > Thomas

      or (without :s)

      :%call setline(".", tr(getline("."),"abc","def"))

      --
      Andy


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.