如何在不注释代码的情况下粘贴 vim? [英] How do you paste with vim without code being commented?

查看:33
本文介绍了如何在不注释代码的情况下粘贴 vim?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次我在 vim 中粘贴时,每一行都会被注释掉.

Everytime I paste in vim, every line is commented out.

有没有办法解决这个问题?

Is there a way around this?

推荐答案

粘贴前,在正常模式下输入:

Before you paste, type this in normal mode:

:set paste

然后进入插入模式.您将看到状态栏显示 insert (paste).粘贴您的代码.按 ESC 返回正常模式,然后:

Then enter insert mode. You will see the status bar say insert (paste). Paste your code. Hit ESC to return to normal mode, and:

:set nopaste

您不再处于粘贴模式.

这篇关于如何在不注释代码的情况下粘贴 vim?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆