Get Emacs to jump to the start of a word after isearchHow can I configure incremental search to put my cursor at the start of whitespace rather than the end?Customize isearch to start from buffer startMake forward-word not to jump over newline characterGet word at pointSelecting (i.e., as the region) the current match in incremental searchisearch but don't move the cursor until I ask to searchclear highlighted matches of an isearchMake isearch commands search only at the beginning of wordsJump to word in another window

What explains the Genie's fate?

Owner keeps cutting corners and poaching workers for his other company

Explaining "向けてじゃないよ"

A PEMDAS issue request for explanation

What is the purpose of the rotating plate in front of the lock?

How can faith be maintained in a world of living gods?

Are personality traits, ideals, bonds, and flaws required?

If every star in the universe except the Sun were destroyed, would we die?

I multiply the source, you (probably) multiply the output!

Contour plot of a sequence of spheres with increasing radius

Is it right to use the ideas of non-winning designers in a design contest?

When calculating averages, why can we treat exploding die as if they're independent?

Why did Tony's Arc Reactor do this?

Is mountain bike good for long distances?

Word for something that used to be popular but not anymore

What is the delta-v required to get a mass in Earth orbit into the sun using a SINGLE transfer?

Why are UK MPs allowed to abstain (but it counts as a no)?

How to run NPCs with complicated mechanics?

Why do the Brexit opposition parties not want a new election?

How can I hint that my character isn't real?

Why would an airport be depicted with symbology for runways longer than 8,069 feet even though it is reported on the sectional as 7,200 feet?

After a few interviews, What should I do after told to wait?

Strategies for dealing with chess burnout?

Problem with listing a directory to grep



Get Emacs to jump to the start of a word after isearch


How can I configure incremental search to put my cursor at the start of whitespace rather than the end?Customize isearch to start from buffer startMake forward-word not to jump over newline characterGet word at pointSelecting (i.e., as the region) the current match in incremental searchisearch but don't move the cursor until I ask to searchclear highlighted matches of an isearchMake isearch commands search only at the beginning of wordsJump to word in another window






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








2















If I use isearch to search for the word "accommodating" in my document, I have to type acc before the cursor jumps to the word. When I press enter the cursor is on the the second "c" as in acCommodating. This strikes me as rather unintuitive because I have to go back two characters to begin editing the word. In Vim, search puts the cursor at the start of the word. Can I replicate this behaviour in Emacs?










share|improve this question
































    2















    If I use isearch to search for the word "accommodating" in my document, I have to type acc before the cursor jumps to the word. When I press enter the cursor is on the the second "c" as in acCommodating. This strikes me as rather unintuitive because I have to go back two characters to begin editing the word. In Vim, search puts the cursor at the start of the word. Can I replicate this behaviour in Emacs?










    share|improve this question




























      2












      2








      2








      If I use isearch to search for the word "accommodating" in my document, I have to type acc before the cursor jumps to the word. When I press enter the cursor is on the the second "c" as in acCommodating. This strikes me as rather unintuitive because I have to go back two characters to begin editing the word. In Vim, search puts the cursor at the start of the word. Can I replicate this behaviour in Emacs?










      share|improve this question
















      If I use isearch to search for the word "accommodating" in my document, I have to type acc before the cursor jumps to the word. When I press enter the cursor is on the the second "c" as in acCommodating. This strikes me as rather unintuitive because I have to go back two characters to begin editing the word. In Vim, search puts the cursor at the start of the word. Can I replicate this behaviour in Emacs?







      isearch words






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 11 hours ago









      Drew

      51.2k4 gold badges65 silver badges115 bronze badges




      51.2k4 gold badges65 silver badges115 bronze badges










      asked 12 hours ago









      devcomdevcom

      801 silver badge8 bronze badges




      801 silver badge8 bronze badges























          2 Answers
          2






          active

          oldest

          votes


















          2
















          As Drew pointed in his answer you can also end the search with another key such as M-b or M-f, which for words boundaries works good, but my solution is kind of more general: define a key to put the cursor at the beginning (or end) of the pattern I'm searching:



          (use-package isearch
          :bind (:map isearch-mode-map
          ("C-<return>" . isearch-done-opposite))
          :init (defun isearch-done-opposite (&optional nopush edit)
          "End current search in the opposite side of the match."
          (interactive)
          (funcall #'isearch-done nopush edit)
          (when isearch-other-end (goto-char isearch-other-end))))


          Basically, map C-Ret to another function isearch-done-opposite which checks the variable isearch-other-end which is defined in isearch.el as:



          (defvar isearch-other-end nil) ; Start (end) of match if forward (backward).


          This will work with forward and backward searches.






          share|improve this answer


































            1
















            There's really nothing to replicate, I think. You somehow have to tell Isearch that you're done typing text for the search string - you have to hit some key to tell it that. So at a minimum you have C-s acc <SOME KEY>.



            You can end Isearch with any key that is not already bound to something in isearch-mode-map. (And even then, you can rebind any keys that are already bound.) And the key that ends Isearch can do whatever you like, including move back to a word beginning.



            So you can end it with M-b (that key isn't bound for Isearch, by default), which goes back to the beginning of the current word:



            C-s acc M-b



            That's not so hard. Whether you find it "intuitive" probably has to do with what you're already used to. There are a zillion use cases for Isearch, only one of which is wanting to move to the beginning of a matching word.



            C-h k M-b tells you:




            M-b runs the command backward-word (found in global-map), which is an
            interactive compiled Lisp function in simple.el.



            It is bound to M-b, ESC left.



            (backward-word &optional ARG)



            Move backward until encountering the beginning of a word.



            With argument ARG, do this that many times.
            If ARG is omitted or nil, move point backward one word.



            The word boundaries are normally determined by the buffer’s
            syntax table and character script (according to
            char-script-table), but find-word-boundary-function-table,
            such as set up by subword-mode, can change that. If a Lisp
            program needs to move by words determined strictly by the syntax
            table, it should use backward-word-strictly instead. See Info
            node (elisp) Word Motion for details.







            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%2f52549%2fget-emacs-to-jump-to-the-start-of-a-word-after-isearch%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









              2
















              As Drew pointed in his answer you can also end the search with another key such as M-b or M-f, which for words boundaries works good, but my solution is kind of more general: define a key to put the cursor at the beginning (or end) of the pattern I'm searching:



              (use-package isearch
              :bind (:map isearch-mode-map
              ("C-<return>" . isearch-done-opposite))
              :init (defun isearch-done-opposite (&optional nopush edit)
              "End current search in the opposite side of the match."
              (interactive)
              (funcall #'isearch-done nopush edit)
              (when isearch-other-end (goto-char isearch-other-end))))


              Basically, map C-Ret to another function isearch-done-opposite which checks the variable isearch-other-end which is defined in isearch.el as:



              (defvar isearch-other-end nil) ; Start (end) of match if forward (backward).


              This will work with forward and backward searches.






              share|improve this answer































                2
















                As Drew pointed in his answer you can also end the search with another key such as M-b or M-f, which for words boundaries works good, but my solution is kind of more general: define a key to put the cursor at the beginning (or end) of the pattern I'm searching:



                (use-package isearch
                :bind (:map isearch-mode-map
                ("C-<return>" . isearch-done-opposite))
                :init (defun isearch-done-opposite (&optional nopush edit)
                "End current search in the opposite side of the match."
                (interactive)
                (funcall #'isearch-done nopush edit)
                (when isearch-other-end (goto-char isearch-other-end))))


                Basically, map C-Ret to another function isearch-done-opposite which checks the variable isearch-other-end which is defined in isearch.el as:



                (defvar isearch-other-end nil) ; Start (end) of match if forward (backward).


                This will work with forward and backward searches.






                share|improve this answer





























                  2














                  2










                  2









                  As Drew pointed in his answer you can also end the search with another key such as M-b or M-f, which for words boundaries works good, but my solution is kind of more general: define a key to put the cursor at the beginning (or end) of the pattern I'm searching:



                  (use-package isearch
                  :bind (:map isearch-mode-map
                  ("C-<return>" . isearch-done-opposite))
                  :init (defun isearch-done-opposite (&optional nopush edit)
                  "End current search in the opposite side of the match."
                  (interactive)
                  (funcall #'isearch-done nopush edit)
                  (when isearch-other-end (goto-char isearch-other-end))))


                  Basically, map C-Ret to another function isearch-done-opposite which checks the variable isearch-other-end which is defined in isearch.el as:



                  (defvar isearch-other-end nil) ; Start (end) of match if forward (backward).


                  This will work with forward and backward searches.






                  share|improve this answer















                  As Drew pointed in his answer you can also end the search with another key such as M-b or M-f, which for words boundaries works good, but my solution is kind of more general: define a key to put the cursor at the beginning (or end) of the pattern I'm searching:



                  (use-package isearch
                  :bind (:map isearch-mode-map
                  ("C-<return>" . isearch-done-opposite))
                  :init (defun isearch-done-opposite (&optional nopush edit)
                  "End current search in the opposite side of the match."
                  (interactive)
                  (funcall #'isearch-done nopush edit)
                  (when isearch-other-end (goto-char isearch-other-end))))


                  Basically, map C-Ret to another function isearch-done-opposite which checks the variable isearch-other-end which is defined in isearch.el as:



                  (defvar isearch-other-end nil) ; Start (end) of match if forward (backward).


                  This will work with forward and backward searches.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 7 hours ago

























                  answered 7 hours ago









                  AnlerAnler

                  1695 bronze badges




                  1695 bronze badges


























                      1
















                      There's really nothing to replicate, I think. You somehow have to tell Isearch that you're done typing text for the search string - you have to hit some key to tell it that. So at a minimum you have C-s acc <SOME KEY>.



                      You can end Isearch with any key that is not already bound to something in isearch-mode-map. (And even then, you can rebind any keys that are already bound.) And the key that ends Isearch can do whatever you like, including move back to a word beginning.



                      So you can end it with M-b (that key isn't bound for Isearch, by default), which goes back to the beginning of the current word:



                      C-s acc M-b



                      That's not so hard. Whether you find it "intuitive" probably has to do with what you're already used to. There are a zillion use cases for Isearch, only one of which is wanting to move to the beginning of a matching word.



                      C-h k M-b tells you:




                      M-b runs the command backward-word (found in global-map), which is an
                      interactive compiled Lisp function in simple.el.



                      It is bound to M-b, ESC left.



                      (backward-word &optional ARG)



                      Move backward until encountering the beginning of a word.



                      With argument ARG, do this that many times.
                      If ARG is omitted or nil, move point backward one word.



                      The word boundaries are normally determined by the buffer’s
                      syntax table and character script (according to
                      char-script-table), but find-word-boundary-function-table,
                      such as set up by subword-mode, can change that. If a Lisp
                      program needs to move by words determined strictly by the syntax
                      table, it should use backward-word-strictly instead. See Info
                      node (elisp) Word Motion for details.







                      share|improve this answer































                        1
















                        There's really nothing to replicate, I think. You somehow have to tell Isearch that you're done typing text for the search string - you have to hit some key to tell it that. So at a minimum you have C-s acc <SOME KEY>.



                        You can end Isearch with any key that is not already bound to something in isearch-mode-map. (And even then, you can rebind any keys that are already bound.) And the key that ends Isearch can do whatever you like, including move back to a word beginning.



                        So you can end it with M-b (that key isn't bound for Isearch, by default), which goes back to the beginning of the current word:



                        C-s acc M-b



                        That's not so hard. Whether you find it "intuitive" probably has to do with what you're already used to. There are a zillion use cases for Isearch, only one of which is wanting to move to the beginning of a matching word.



                        C-h k M-b tells you:




                        M-b runs the command backward-word (found in global-map), which is an
                        interactive compiled Lisp function in simple.el.



                        It is bound to M-b, ESC left.



                        (backward-word &optional ARG)



                        Move backward until encountering the beginning of a word.



                        With argument ARG, do this that many times.
                        If ARG is omitted or nil, move point backward one word.



                        The word boundaries are normally determined by the buffer’s
                        syntax table and character script (according to
                        char-script-table), but find-word-boundary-function-table,
                        such as set up by subword-mode, can change that. If a Lisp
                        program needs to move by words determined strictly by the syntax
                        table, it should use backward-word-strictly instead. See Info
                        node (elisp) Word Motion for details.







                        share|improve this answer





























                          1














                          1










                          1









                          There's really nothing to replicate, I think. You somehow have to tell Isearch that you're done typing text for the search string - you have to hit some key to tell it that. So at a minimum you have C-s acc <SOME KEY>.



                          You can end Isearch with any key that is not already bound to something in isearch-mode-map. (And even then, you can rebind any keys that are already bound.) And the key that ends Isearch can do whatever you like, including move back to a word beginning.



                          So you can end it with M-b (that key isn't bound for Isearch, by default), which goes back to the beginning of the current word:



                          C-s acc M-b



                          That's not so hard. Whether you find it "intuitive" probably has to do with what you're already used to. There are a zillion use cases for Isearch, only one of which is wanting to move to the beginning of a matching word.



                          C-h k M-b tells you:




                          M-b runs the command backward-word (found in global-map), which is an
                          interactive compiled Lisp function in simple.el.



                          It is bound to M-b, ESC left.



                          (backward-word &optional ARG)



                          Move backward until encountering the beginning of a word.



                          With argument ARG, do this that many times.
                          If ARG is omitted or nil, move point backward one word.



                          The word boundaries are normally determined by the buffer’s
                          syntax table and character script (according to
                          char-script-table), but find-word-boundary-function-table,
                          such as set up by subword-mode, can change that. If a Lisp
                          program needs to move by words determined strictly by the syntax
                          table, it should use backward-word-strictly instead. See Info
                          node (elisp) Word Motion for details.







                          share|improve this answer















                          There's really nothing to replicate, I think. You somehow have to tell Isearch that you're done typing text for the search string - you have to hit some key to tell it that. So at a minimum you have C-s acc <SOME KEY>.



                          You can end Isearch with any key that is not already bound to something in isearch-mode-map. (And even then, you can rebind any keys that are already bound.) And the key that ends Isearch can do whatever you like, including move back to a word beginning.



                          So you can end it with M-b (that key isn't bound for Isearch, by default), which goes back to the beginning of the current word:



                          C-s acc M-b



                          That's not so hard. Whether you find it "intuitive" probably has to do with what you're already used to. There are a zillion use cases for Isearch, only one of which is wanting to move to the beginning of a matching word.



                          C-h k M-b tells you:




                          M-b runs the command backward-word (found in global-map), which is an
                          interactive compiled Lisp function in simple.el.



                          It is bound to M-b, ESC left.



                          (backward-word &optional ARG)



                          Move backward until encountering the beginning of a word.



                          With argument ARG, do this that many times.
                          If ARG is omitted or nil, move point backward one word.



                          The word boundaries are normally determined by the buffer’s
                          syntax table and character script (according to
                          char-script-table), but find-word-boundary-function-table,
                          such as set up by subword-mode, can change that. If a Lisp
                          program needs to move by words determined strictly by the syntax
                          table, it should use backward-word-strictly instead. See Info
                          node (elisp) Word Motion for details.








                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 11 hours ago

























                          answered 12 hours ago









                          DrewDrew

                          51.2k4 gold badges65 silver badges115 bronze badges




                          51.2k4 gold badges65 silver badges115 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%2f52549%2fget-emacs-to-jump-to-the-start-of-a-word-after-isearch%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

                              Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                              Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                              Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її