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 766747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:05:54+00:00 2026-05-14T17:05:54+00:00

I have a file where I store snippets of vim commands. When I need

  • 0

I have a file where I store snippets of vim commands. When I need a snippet, I yank it and then execute it with @". The snippets are stored as a script, one line per command, like this:

:s/foo/bar/g
:echo "hello"
:s/1/2/g

Edit: I removed normal mode commands from the example, as they were not part of the problem.

Now this procedure doesn’t work anymore: when executing the snippet, it just stops at the first line as if waiting for a newline.

Is there an option somewhere affecting how @ is executed? I’m pretty sure it was working some time ago…

Substituting the newline with a ^M character works but makes the file more difficult to handle.


Additional information:

Here’s another symptom: when I yank a snippet, if I execute it with @" it stops at the first line as I just explained. But if I execute it with :@ it works. But the help file doesn’t seem to imply any difference in how the two commands treat the register’s content…

  • 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-14T17:05:55+00:00Added an answer on May 14, 2026 at 5:05 pm

    I finally found the culprit. Somehow I had a command mapping on <C-J> in my .vimrc file. When read with the default cpoptions, this turned into a mapping on <NL>.

    How I found out: I noticed that when starting vim with -u ~/.vimrc, it would indeed execute yanked snippets. I generated a session file with and without that commandline option and compared them. This way I found out that a different set of cpoptions where used to read the same .vimrc file, so that in one case the mapping was indeed on <C-J>, in the other it was converted into a mapping on <NL>!

    If someone has a similar problem, I suggest to look carefully at the currently set command mappings, with :cmap.

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

Sidebar

Related Questions

I have a problem to Store file (from a remote API) in MongoDB, i'm
I have semicolon-separated .dat file and I want to read that file and store
I have a properties file in java, in which I store all information of
I have an XML based file format that I'm using to store and load
I have used this code to store Object to a file: try{ FileOutputStream saveFile=new
I have an xml file stored on my website that looks like this: <games>
I have a text file stored in my sql DB. in that .txt file
I have a json file being stored in a static url, i would like
I have a working perl script that grabs the data I need and displays
I have the below contents from a .txt file stored into a string variable

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.