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

  • SEARCH
  • Home
  • 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 6827865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:18:56+00:00 2026-05-26T22:18:56+00:00

Is it possible to provide some parameter when recording a macro in vim via

  • 0

Is it possible to provide some parameter when recording a macro in vim via prompt or some other ways?

Edit:
I have such code:

foo
bar

And I would like to surround each with ruby block:

expect do
  foo
end.to raise_error(CustomClass)

expect do
  foo
end.to raise_error(OtherCustomClass)

So, it is easy to create a macro that will result with:
expect do
foo
end.to raise_error()

expect do
  foo
end.to raise_error()

But it will be nice to have prompt that will be used to set raise_error method parameter. In each use of macro this parameter will be different.

  • 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-26T22:18:57+00:00Added an answer on May 26, 2026 at 10:18 pm

    While I agree with everyone else that if you need this feature, you’re probably going about things inefficiently, it is possible to insert a variable text string into a document as part of a macro. The trick is to store the text you want to use in your macro in a register.

    1. yank some text into a named register, for example "xyw to yank a word into the x register
    2. record your macro, qq, when you want to place the variable text, put it, for example "xp to put the text in the x register into the document where the cursor is
    3. now, when you play your q macro, @q, it will use whatever is currently in the x register, so you can yank different text into the x register, play your q macro, and the newly yanked text will be used.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to use HTMl.RenderAction using ajax to provide the parameter? I have
Animations in WPF provide the boolean parameter AutoReverse . Is it possible to make
I have a method that will provide an array of model object. Some of
I have class MasterData whose instances contain some general information about all possible gadgets.
Is it possible to provide Basic authentication to clients using ASP.Net to authenticate the
I'm having the trouble finding the wording, but is it possible to provide a
I know that it's possible to implicitly provide asynchronous interaction using: Asynchronous Delegates Asynchronous
Possible Duplicate: Why does C# not provide the C++ style ‘friend’ keyword? I'd like
Is it possible to implement Bluetooth devices to provide conference rather than one-to-one operation.
If this is possible, please provide a sample query or two so I can

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.