Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3452630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:16:49+00:00 2026-05-18T09:16:49+00:00

How can I bring back the last string I used for a search or

  • 0

How can I bring back the last string I used for a search or a search&replace?

For example, assume that I enter :%s/some_text/some_other_text/gc and vim gives me the E486: Patterns not found: some_text error message back. I then realize that I actually meant to write some_magic_text instead of some_text. At that point, how can I get back my original string in the bottom command row (or whatever it is called) so I can change it and do a second search? Is there a nifty little command for that?

In this brief example it looks unnecessary, but when the text you are looking to replace is mighty long and you just typed one letter wrong, it is fantastically annoying to have to retype everything.

And I am using MacVim if that makes any difference.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T09:16:50+00:00Added an answer on May 18, 2026 at 9:16 am

    Check out this vimvcast which explains what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I was thinking one way that you can bring method chaining into PHP
How can I bring a console application window to front in C# (especially when
In my Silverlight application, I can't seem to bring focus to a TextBox control.
How can one detect being in a chroot jail without root privileges? Assume a
How can I detect which CPU is being used at runtime ? The c++
I'm trying to write a script that can control different windows from different programs
I have got an ASP page that does some back-end processing. It calls a
Can audio being recorded be compressed on the fly? or are there any libraries
Can I control the order static objects are being destructed? Is there any way
How can I prevent the user from being able to resize an image in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.