小编vuv*_*ume的帖子

复制粘贴时,Vim会缩进每行代码

当我复制并浏览Vim中的一段代码时,每一行都缩进一行.例如,我有这个来源:

    print "Hello"
    print "World"
    print "I'm copying"
    print "and pasting"
Run Code Online (Sandbox Code Playgroud)

粘贴到Vim时会混乱:

print "Hello"
        print "World"
            print "I'm copying"
                print "and pasting"
Run Code Online (Sandbox Code Playgroud)

为了复制长行代码,它非常令人沮丧,因为一切都不对齐(对python不好).

这是我的vimrc.它目前在换行符上自动缩进,并用标准的4个空格替换制表符.

filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
Run Code Online (Sandbox Code Playgroud)

虽然这个配置有效,但是有些东西导致了复制粘贴问题.如何解决这个问题,但仍保留我定义的行为?

vim indentation

7
推荐指数
1
解决办法
655
查看次数

标签 统计

indentation ×1

vim ×1