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

replace

Expand Messages
  • Cliff Oliveira
    I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility? --  Cliff Oliveira
    Message 1 of 8 , Aug 31, 2011
    • 0 Attachment
      I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

      --
       Cliff Oliveira
      www.tribodeideias.com.br

      --
      You received this message from the "vim_mac" 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
    • David Patrick Henderson
      ... See help for vimgrep, args, and argsdo David P Henderson -- Beautiful bodies and beautiful personalities rarely go together. -- Carl Jung -- You received
      Message 2 of 8 , Aug 31, 2011
      • 0 Attachment

        On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

        I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

        See help for vimgrep, args, and argsdo 


        David P Henderson
        --
        "Beautiful bodies and beautiful personalities rarely go together."
            -- Carl Jung

        --
        You received this message from the "vim_mac" 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
      • Kyle Lippincott
        Keep in mind also that Mac OS X is UNIX, and you can use :! in vim to shell ... s/original/replacement/ Depending on how many files there are, this may be
        Message 3 of 8 , Aug 31, 2011
        • 0 Attachment
          Keep in mind also that Mac OS X is UNIX, and you can use :! in vim to shell out, so something like:
          :!find project/directory -name '*.cc' | xargs sed -i 's/original/replacement/'

          Depending on how many files there are, this may be much faster than args/argdo.

          On Wed, Aug 31, 2011 at 8:06 AM, David Patrick Henderson <dp.chaoswerks@...> wrote:

          On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

          I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

          See help for vimgrep, args, and argsdo 


          David P Henderson
          --
          "Beautiful bodies and beautiful personalities rarely go together."
              -- Carl Jung

          --
          You received this message from the "vim_mac" 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 from the "vim_mac" 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
        • Kyle Lippincott
          err... you might need to escape the | in that, vim has its own uses for it (I can t remember if after :! it s *not* treated specially). It s probably easier
          Message 4 of 8 , Aug 31, 2011
          • 0 Attachment
            err...  you might need to escape the | in that, vim has its own uses for it (I can't remember if after :! it's *not* treated specially).  It's probably easier to just open a terminal and do it there.

            On Wed, Aug 31, 2011 at 11:26 AM, Kyle Lippincott <spectral@...> wrote:
            Keep in mind also that Mac OS X is UNIX, and you can use :! in vim to shell out, so something like:
            :!find project/directory -name '*.cc' | xargs sed -i 's/original/replacement/'

            Depending on how many files there are, this may be much faster than args/argdo.


            On Wed, Aug 31, 2011 at 8:06 AM, David Patrick Henderson <dp.chaoswerks@...> wrote:

            On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

            I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

            See help for vimgrep, args, and argsdo 


            David P Henderson
            --
            "Beautiful bodies and beautiful personalities rarely go together."
                -- Carl Jung

            --
            You received this message from the "vim_mac" 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 from the "vim_mac" 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
          • Cliff Oliveira
            I managed to locate the files using:! grep but how to replace the word being searched? I used ... 2011/8/31 David Patrick Henderson
            Message 5 of 8 , Aug 31, 2011
            • 0 Attachment
              I managed to locate the files using:! grep but how to replace the word being searched?

              I used

              :!grep sistema. ~/workspace/canto/*



              2011/8/31 David Patrick Henderson <dp.chaoswerks@...>

              On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

              I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

              See help for vimgrep, args, and argsdo 


              David P Henderson
              --
              "Beautiful bodies and beautiful personalities rarely go together."
                  -- Carl Jung

              --
              You received this message from the "vim_mac" 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



              --
               Cliff Oliveira
              www.tribodeideias.com.br

              --
              You received this message from the "vim_mac" 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
            • Kyle Lippincott
              This only does all of the files in one directory, is that what you intended? ... should work. http://en.wikipedia.org/wiki/Sed is the wikipedia page for sed,
              Message 6 of 8 , Aug 31, 2011
              • 0 Attachment
                This only does all of the files in one directory, is that what you intended?  If so:
                :!sed -i 's/sistema./replacement/' ~/workspace/canto/*
                should work.  http://en.wikipedia.org/wiki/Sed is the wikipedia page for sed, and there are many many tutorials out there on how to use it :)

                On Wed, Aug 31, 2011 at 1:39 PM, Cliff Oliveira <oliveira.cliff@...> wrote:
                I managed to locate the files using:! grep but how to replace the word being searched?

                I used

                :!grep sistema. ~/workspace/canto/*




                2011/8/31 David Patrick Henderson <dp.chaoswerks@...>

                On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

                I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

                See help for vimgrep, args, and argsdo 


                David P Henderson
                --
                "Beautiful bodies and beautiful personalities rarely go together."
                    -- Carl Jung

                --
                You received this message from the "vim_mac" 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



                --
                 Cliff Oliveira
                www.tribodeideias.com.br

                --
                You received this message from the "vim_mac" 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 from the "vim_mac" 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
              • Cliff Oliveira
                ... [No write since last change] sed: 1: /Users/cliffoliveira/wo ... : command c expects followed by text I tried to put at the end but did not work
                Message 7 of 8 , Sep 1, 2011
                • 0 Attachment
                  I tried the tip but sent it returned following error:

                  :!sed -i 's/sistema./www./' ~/workspace/canto/*
                  [No write since last change]
                  sed: 1: "/Users/cliffoliveira/wo ...": command c expects \ followed by text

                  I tried to put \ at the end but did not work



                  2011/8/31 Kyle Lippincott <spectral@...>
                  This only does all of the files in one directory, is that what you intended?  If so:
                  :!sed -i 's/sistema./replacement/' ~/workspace/canto/*
                  should work.  http://en.wikipedia.org/wiki/Sed is the wikipedia page for sed, and there are many many tutorials out there on how to use it :)

                  On Wed, Aug 31, 2011 at 1:39 PM, Cliff Oliveira <oliveira.cliff@...> wrote:
                  I managed to locate the files using:! grep but how to replace the word being searched?

                  I used

                  :!grep sistema. ~/workspace/canto/*




                  2011/8/31 David Patrick Henderson <dp.chaoswerks@...>

                  On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

                  I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

                  See help for vimgrep, args, and argsdo 


                  David P Henderson
                  --
                  "Beautiful bodies and beautiful personalities rarely go together."
                      -- Carl Jung

                  --
                  You received this message from the "vim_mac" 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



                  --
                   Cliff Oliveira
                  www.tribodeideias.com.br

                  --
                  You received this message from the "vim_mac" 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 from the "vim_mac" 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



                  --
                   Cliff Oliveira
                  www.tribodeideias.com.br

                  --
                  You received this message from the "vim_mac" 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
                • Kyle Lippincott
                  Doh. I forgot that -i takes an argument. Does sed -i -e s/sistema./www./ ~cliffoliveira/workspace/canto/* work? I keep responding from my iPhone, so I can t
                  Message 8 of 8 , Sep 1, 2011
                  • 0 Attachment
                    Doh. I forgot that -i takes an argument.  Does sed -i -e 's/sistema./www./' ~cliffoliveira/workspace/canto/* work?

                    I keep responding from my iPhone, so I can't really check if the command I'm giving has the correct syntax. :(

                    On Sep 1, 2011, at 3:23, Cliff Oliveira <oliveira.cliff@...> wrote:

                    I tried the tip but sent it returned following error:

                    :!sed -i 's/sistema./www./' ~/workspace/canto/*
                    [No write since last change]
                    sed: 1: "/Users/cliffoliveira/wo ...": command c expects \ followed by text

                    I tried to put \ at the end but did not work



                    2011/8/31 Kyle Lippincott <spectral@...>
                    This only does all of the files in one directory, is that what you intended?  If so:
                    :!sed -i 's/sistema./replacement/' ~/workspace/canto/*
                    should work.  http://en.wikipedia.org/wiki/Sed is the wikipedia page for sed, and there are many many tutorials out there on how to use it :)

                    On Wed, Aug 31, 2011 at 1:39 PM, Cliff Oliveira <oliveira.cliff@...> wrote:
                    I managed to locate the files using:! grep but how to replace the word being searched?

                    I used

                    :!grep sistema. ~/workspace/canto/*




                    2011/8/31 David Patrick Henderson <dp.chaoswerks@...>

                    On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

                    I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

                    See help for vimgrep, args, and argsdo 


                    David P Henderson
                    --
                    "Beautiful bodies and beautiful personalities rarely go together."
                        -- Carl Jung

                    --
                    You received this message from the "vim_mac" 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



                    --
                     Cliff Oliveira
                    www.tribodeideias.com.br

                    --
                    You received this message from the "vim_mac" 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 from the "vim_mac" 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



                    --
                     Cliff Oliveira
                    www.tribodeideias.com.br

                    --
                    You received this message from the "vim_mac" 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 from the "vim_mac" 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
                  Your message has been successfully submitted and would be delivered to recipients shortly.