相关疑难解决方法(0)

将文本粘贴到vim时关闭自动缩进

我正在努力学习Vim.

当我从剪贴板将代码粘贴到我的文档中时,我会在每个新行的开头添加额外的空格:

line
  line
    line
Run Code Online (Sandbox Code Playgroud)

我知道你可以关闭自动缩进但我无法让它工作,因为我有一些其他设置冲突或某事(在我的.vimrc中看起来非常明显,但是当我把它们取出时似乎并不重要).

当我粘贴代码时如何关闭自动缩进但在编写代码时仍然有自动缩进?这是我的.vimrc档案:

set expandtab  
set tabstop=2  
set shiftwidth=2  
set autoindent  
set smartindent  
set bg=dark  
set nowrap  
Run Code Online (Sandbox Code Playgroud)

vim configuration editor indentation auto-indent

1119
推荐指数
16
解决办法
35万
查看次数

为什么Python pep-8强烈建议使用标签上的空格来缩进?

我在Stack Overflow和PEP 8上看到,建议仅在Python程序中使用空格进行缩进.我能理解一致压痕的必要性,我感到痛苦.

空间是否有首选的潜在原因?我本以为选项卡更易于使用.

python indentation

137
推荐指数
8
解决办法
6万
查看次数

标签 统计

indentation ×2

auto-indent ×1

configuration ×1

editor ×1

python ×1

vim ×1