Selecting next occurrence of word incrementallyquery-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
Can 35 mm film which went through a washing machine still be developed?
What (if anything) are the standards for "generic" part numbers?
Can someone identify this old round connector?
Who became a professor?
How do I know how many sub-shells deep I am?
Is there a penalty for switching targets?
Would Great Old Ones care about the Blood War?
Injection from two strings to one string
Had there been instances of national states banning harmful imports before the Opium wars?
A traceless stress energy tensor?
Why is the final chapter of "The Midwich Cuckoos" entitled "Zellaby of Macedon"?
Did I lie to my friends about how long I have been studying?
What's the difference between motherboard and chassis?
Trigger : making API call to validate record creation?
Would it be easier to colonise a living world or a dead world?
Why would they pick a gamma distribution here?
I'm made of obsolete parts
Characters in a conversation
How do lasers measure short distances (<1cm) when electronics are too slow for time-of-flight to work?
Why didn't Snape ask Dumbledore why he let "Moody" search his office?
Coffee Grounds and Gritty Butter Cream Icing
How long could a human survive completely without the immune system?
I've been fired, was allowed to announce it as if I quit and given extra notice, how to handle the questions?
AC/DC 100A clamp meter
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;
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
add a comment
|
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
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
add a comment
|
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
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
search replace
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
add a comment
|
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
add a comment
|
2 Answers
2
active
oldest
votes
With point at the beginning of the word you want to replace, e.g.,
foo
:C-s C-w M-%
Then type the replacement word, e.g.
bar
, thenRET
.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.
add a comment
|
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)
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
With point at the beginning of the word you want to replace, e.g.,
foo
:C-s C-w M-%
Then type the replacement word, e.g.
bar
, thenRET
.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.
add a comment
|
With point at the beginning of the word you want to replace, e.g.,
foo
:C-s C-w M-%
Then type the replacement word, e.g.
bar
, thenRET
.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.
add a comment
|
With point at the beginning of the word you want to replace, e.g.,
foo
:C-s C-w M-%
Then type the replacement word, e.g.
bar
, thenRET
.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.
With point at the beginning of the word you want to replace, e.g.,
foo
:C-s C-w M-%
Then type the replacement word, e.g.
bar
, thenRET
.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.
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
add a comment
|
add a comment
|
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)
add a comment
|
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)
add a comment
|
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)
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)
answered 7 hours ago
JesseJesse
1,5895 silver badges15 bronze badges
1,5895 silver badges15 bronze badges
add a comment
|
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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