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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:44:45+00:00 2026-05-14T02:44:45+00:00

When I paste things from the clipboard, they’re normally (always) multilined, and in those

  • 0

When I paste things from the clipboard, they’re normally (always) multilined, and in those cases (and those cases only), I’d like :set paste to be triggered, since otherwise the tabbing will increase with each line (you’ve all seen it!).

Though the problem with :set paste is that it doesn’t behave well with set smartindent, causing the cursor to jump to the beginning of a new line instead of at the correct indent. So I’d like to enable it for this instance only.

I’m using Mac, sshing to a Debian machine with Vim, and thus pasting in Insert mode using cmd + v.

  • 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-14T02:44:45+00:00Added an answer on May 14, 2026 at 2:44 am

    I don’t use a mac, but I believe I have the prefix right here: <D-v> should mean cmd-v. For insert mode:

    :imap <D-v> ^O:set paste<Enter>^R+^O:set nopaste<Enter>
    

    or really, just do this:

    :imap <D-V> ^O"+p
    

    The ^O and ^R are literal control-O and control-R, which you can type with ^V^O (control-v control-o) and ^V^R (control-v control-r). Control-O in insert mode allows you to execute one command then return to insert mode; here you can use it to put from the clipboard register.

    This worked for me when I tested them mapped to a different key, so you should be all set.

    There’s no need to map anything when not in insert mode; you can just use "+p.

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

Sidebar

Related Questions

I want to paste something I have cut from my desktop into a file
When I cut and paste from a Word document into VIM, quotes get translated
Suppose I write my code very defensively and always check the return types from
I have a table like this: http://jsfiddle.net/DSvb7/ It currently works normally. However, when I
When I try to copy code from eclipse and paste it in the actionscript
First, I'm just starting to learn MySQL with PHP. My query copy/paste directly from
I have a requirement to paste text from a textarea into the DOM as
I have a legacy DLL written in C that I'd like to call from
Possible Duplicate: Keyboard shortcut to paste clipboard content into command prompt window (Win XP)
It seems that when you copy something from a web browser to the clipboard,

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.