本文介绍了将代码粘贴到Mac OS X上的终端窗口到vim中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将代码粘贴到Mac OS X终端窗口中的vim中时,它会缩进每一行.每行添加一个缩进,因此文本看起来像这样...

When I paste code into my Mac OS X terminal window into vim it indents each line. For each line it adds an indent so the text looks like this...

"ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
   ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
        reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
             Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
                    deserunt mollit anim id est laborum."

我当前的解决方法是先将文本粘贴到textmate文本编辑器中,以保持正确的格式.然后,我保存该文件并在vim中打开它.然后我用vim yank粘贴它.
我的.vimrc中是否存在可以更改此行为的设置?还是这是一个终端问题?

My current workaround is I paste the text first into textmate text editor which keeps the correct formatting. Then I save that file and open it up in vim. Then I use vim yank to paste it.
Is there a setting in my .vimrc that could change this behavior? Or is this a terminal issue?

推荐答案

在vim中:

:set paste

这篇关于将代码粘贴到Mac OS X上的终端窗口到vim中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 00:35
查看更多