Selecting next occurrence of word incrementallyquery-replace in keyboard macroHighlighting text in open...

Why is the final chapter of "The Midwich Cuckoos" entitled "Zellaby of Macedon"?

Would we have more than 8 minutes of light, if the sun "went out"?

What should I do if I find a mistake in my submitted master's thesis?

How to prove (A v B), (A → C), (B → D) therefore (C v D)

Venn diagrams show + - = underneath

difference between $HOME and ~

The work of mathematicians outside their professional environment

How come the Russian cognate for the Czech word "čerstvý" (fresh) means entirely the opposite thing (stale)?

How to be productive while waiting for meetings to start, when managers are casual about being late

Selecting next occurrence of word incrementally

Who became a professor?

SHA3-255, one bit less

"Es gefällt ihm." How to identify similar exceptions?

What are the limits on an impeached and not convicted president?

Meaning/translation of title "The Light Fantastic" By Terry Pratchett

Find the percentage

I've been fired, was allowed to announce it as if I quit and given extra notice, how to handle the questions?

How to catch creatures that can predict the next few minutes?

Can't change the screenshot directory because "com.apple.screencapture: command not found"

Is there any specific significance of inverse demand?

If LPG gas burners can reach temperatures above 1700 °C, then how do HCA and PAH not develop in extreme amounts during cooking?

What (if anything) are the standards for "generic" part numbers?

Why do English transliterations of Arabic names have so many Qs in them?

Coffee Grounds and Gritty Butter Cream Icing



Selecting next occurrence of word incrementally


query-replace in keyboard macroHighlighting text in open (displayed) buffers/windows — searching for text from one buffer in anotherHow to center the current line vertically during IsearchWhat changed with Mark/Region behavior between GNU Emacs 24.3.1 and 24.5.1?Vim-LaTeX-Suite Macros in AucTeX / EmacsReplace word causes buffer issuehow can i do for replace a part of a regexpCreate strings of a wordlist using replace-regexpMake region(s) invisible (not evaluated) to query-replacy and similar commands






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}








1















I want to make changes inside a paragraph of a large text file.



If I have the cursor at the word "foo", what key combination would get the cursor at the next occurrences of this word? The cursor could be at the beginning, end, or highlight the word.



I'm looking to replace "foo" with "bar" in a paragraph.



This is similar to Sublime Text's Ctrl-D










share|improve this question



























  • Yes it was what I said in the second sentence. By "at" I mean "at the beginning" or "at the end". Have rephrased the question so it is clearer and doesn't risk being closed.

    – Saurabh
    7 hours ago


















1















I want to make changes inside a paragraph of a large text file.



If I have the cursor at the word "foo", what key combination would get the cursor at the next occurrences of this word? The cursor could be at the beginning, end, or highlight the word.



I'm looking to replace "foo" with "bar" in a paragraph.



This is similar to Sublime Text's Ctrl-D










share|improve this question



























  • Yes it was what I said in the second sentence. By "at" I mean "at the beginning" or "at the end". Have rephrased the question so it is clearer and doesn't risk being closed.

    – Saurabh
    7 hours ago














1












1








1








I want to make changes inside a paragraph of a large text file.



If I have the cursor at the word "foo", what key combination would get the cursor at the next occurrences of this word? The cursor could be at the beginning, end, or highlight the word.



I'm looking to replace "foo" with "bar" in a paragraph.



This is similar to Sublime Text's Ctrl-D










share|improve this question
















I want to make changes inside a paragraph of a large text file.



If I have the cursor at the word "foo", what key combination would get the cursor at the next occurrences of this word? The cursor could be at the beginning, end, or highlight the word.



I'm looking to replace "foo" with "bar" in a paragraph.



This is similar to Sublime Text's Ctrl-D







search replace






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 hours ago









Drew

51.6k4 gold badges67 silver badges117 bronze badges




51.6k4 gold badges67 silver badges117 bronze badges










asked 8 hours ago









SaurabhSaurabh

1206 bronze badges




1206 bronze badges
















  • Yes it was what I said in the second sentence. By "at" I mean "at the beginning" or "at the end". Have rephrased the question so it is clearer and doesn't risk being closed.

    – Saurabh
    7 hours ago



















  • Yes it was what I said in the second sentence. By "at" I mean "at the beginning" or "at the end". Have rephrased the question so it is clearer and doesn't risk being closed.

    – Saurabh
    7 hours ago

















Yes it was what I said in the second sentence. By "at" I mean "at the beginning" or "at the end". Have rephrased the question so it is clearer and doesn't risk being closed.

– Saurabh
7 hours ago





Yes it was what I said in the second sentence. By "at" I mean "at the beginning" or "at the end". Have rephrased the question so it is clearer and doesn't risk being closed.

– Saurabh
7 hours ago










2 Answers
2






active

oldest

votes


















1


















  1. With point at the beginning of the word you want to replace, e.g., foo:



    C-s C-w M-%



  2. Then type the replacement word, e.g. bar, then RET.


  3. Then follow the prompts to query-replace subsequent occurrences of foo. (You can use ! to replace all of them, for instance.)



To limit query-replace to a paragraph, you can narrow to it (C-x n n). Alternatively, just quit query-replace after that paragraph (using q), or quit it at the last replacement (.).





C-s starts Isearch (incremental search). An immediate C-w yanks the text from point to the end of the word at point (e.g. foo) to the search string, so C-s C-w searches for that word.



M-% while searching switches to query-replace, using the search-string as the text to replace.






share|improve this answer



































    0
















    The multiple-cursors package is probably what you're looking for. You can install it using the melpa repository. Once installed, I believe the command mc/mark-next-like-this-work should do what you want. Then you can bind it to some custom keybinding like C-d:



    (define-key global-map (kbd "C-d") 'mc/mark-next-like-this-word)





    share|improve this answer



























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "583"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });















      draft saved

      draft discarded
















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f52898%2fselecting-next-occurrence-of-word-incrementally%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1


















      1. With point at the beginning of the word you want to replace, e.g., foo:



        C-s C-w M-%



      2. Then type the replacement word, e.g. bar, then RET.


      3. Then follow the prompts to query-replace subsequent occurrences of foo. (You can use ! to replace all of them, for instance.)



      To limit query-replace to a paragraph, you can narrow to it (C-x n n). Alternatively, just quit query-replace after that paragraph (using q), or quit it at the last replacement (.).





      C-s starts Isearch (incremental search). An immediate C-w yanks the text from point to the end of the word at point (e.g. foo) to the search string, so C-s C-w searches for that word.



      M-% while searching switches to query-replace, using the search-string as the text to replace.






      share|improve this answer
































        1


















        1. With point at the beginning of the word you want to replace, e.g., foo:



          C-s C-w M-%



        2. Then type the replacement word, e.g. bar, then RET.


        3. Then follow the prompts to query-replace subsequent occurrences of foo. (You can use ! to replace all of them, for instance.)



        To limit query-replace to a paragraph, you can narrow to it (C-x n n). Alternatively, just quit query-replace after that paragraph (using q), or quit it at the last replacement (.).





        C-s starts Isearch (incremental search). An immediate C-w yanks the text from point to the end of the word at point (e.g. foo) to the search string, so C-s C-w searches for that word.



        M-% while searching switches to query-replace, using the search-string as the text to replace.






        share|improve this answer






























          1














          1










          1











          1. With point at the beginning of the word you want to replace, e.g., foo:



            C-s C-w M-%



          2. Then type the replacement word, e.g. bar, then RET.


          3. Then follow the prompts to query-replace subsequent occurrences of foo. (You can use ! to replace all of them, for instance.)



          To limit query-replace to a paragraph, you can narrow to it (C-x n n). Alternatively, just quit query-replace after that paragraph (using q), or quit it at the last replacement (.).





          C-s starts Isearch (incremental search). An immediate C-w yanks the text from point to the end of the word at point (e.g. foo) to the search string, so C-s C-w searches for that word.



          M-% while searching switches to query-replace, using the search-string as the text to replace.






          share|improve this answer

















          1. With point at the beginning of the word you want to replace, e.g., foo:



            C-s C-w M-%



          2. Then type the replacement word, e.g. bar, then RET.


          3. Then follow the prompts to query-replace subsequent occurrences of foo. (You can use ! to replace all of them, for instance.)



          To limit query-replace to a paragraph, you can narrow to it (C-x n n). Alternatively, just quit query-replace after that paragraph (using q), or quit it at the last replacement (.).





          C-s starts Isearch (incremental search). An immediate C-w yanks the text from point to the end of the word at point (e.g. foo) to the search string, so C-s C-w searches for that word.



          M-% while searching switches to query-replace, using the search-string as the text to replace.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 5 hours ago

























          answered 5 hours ago









          DrewDrew

          51.6k4 gold badges67 silver badges117 bronze badges




          51.6k4 gold badges67 silver badges117 bronze badges




























              0
















              The multiple-cursors package is probably what you're looking for. You can install it using the melpa repository. Once installed, I believe the command mc/mark-next-like-this-work should do what you want. Then you can bind it to some custom keybinding like C-d:



              (define-key global-map (kbd "C-d") 'mc/mark-next-like-this-word)





              share|improve this answer






























                0
















                The multiple-cursors package is probably what you're looking for. You can install it using the melpa repository. Once installed, I believe the command mc/mark-next-like-this-work should do what you want. Then you can bind it to some custom keybinding like C-d:



                (define-key global-map (kbd "C-d") 'mc/mark-next-like-this-word)





                share|improve this answer




























                  0














                  0










                  0









                  The multiple-cursors package is probably what you're looking for. You can install it using the melpa repository. Once installed, I believe the command mc/mark-next-like-this-work should do what you want. Then you can bind it to some custom keybinding like C-d:



                  (define-key global-map (kbd "C-d") 'mc/mark-next-like-this-word)





                  share|improve this answer













                  The multiple-cursors package is probably what you're looking for. You can install it using the melpa repository. Once installed, I believe the command mc/mark-next-like-this-work should do what you want. Then you can bind it to some custom keybinding like C-d:



                  (define-key global-map (kbd "C-d") 'mc/mark-next-like-this-word)






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 7 hours ago









                  JesseJesse

                  1,5895 silver badges15 bronze badges




                  1,5895 silver badges15 bronze badges


































                      draft saved

                      draft discarded



















































                      Thanks for contributing an answer to Emacs Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f52898%2fselecting-next-occurrence-of-word-incrementally%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                      Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                      Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...