V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
工单节点使用指南
• 请用平和的语言准确描述你所遇到的问题
• 厂商的技术支持和你一样也是有喜怒哀乐的普通人类,尊重是相互的
• 如果是关于 V2EX 本身的问题反馈,请使用 反馈 节点
allenlee7c9
V2EX  ›  全球工单系统

VS Code 粘贴时会修改文本的缩进

  •  
  •   allenlee7c9 · 2017-11-20 11:20:06 +08:00 via Android · 11075 次点击
    这是一个创建于 2348 天前的主题,其中的信息可能已经有所发展或是发生改变。
    今天用 Code 写 html 时发现有时候拷贝的文本是有缩进的,粘贴后却全部居左,得 Ctrl + z 才能恢复原有的缩进,不知道有没有人遇到过这种情况,该如何解决
    13 条回复    2019-09-05 14:23:29 +08:00
    misaka19000
        1
    misaka19000  
       2017-11-20 11:21:26 +08:00
    去掉 format-when-paste 选项就可以了
    DOLLOR
        2
    DOLLOR  
       2017-11-20 11:35:30 +08:00
    应该是这个吧
    "editor.autoIndent": false,
    ie88
        3
    ie88  
       2017-11-20 12:00:24 +08:00
    // Controls if the editor should automatically adjust the indentation when users type, paste or move lines. Indentation rules of the language must be available.
    "editor.autoIndent": true,

    true 改为 false
    rocksolid
        4
    rocksolid  
       2017-11-20 12:02:17 +08:00
    应该学学 sublime ctrl v 和 ctrl shift v 分开
    DoraJDJ
        5
    DoraJDJ  
       2017-11-20 12:02:31 +08:00
    我还想着要有这个功能呢,有时候要套用的代码复制粘贴过去还得人工调缩进真的是累死人...
    whattheh3ll
        6
    whattheh3ll  
       2017-11-20 12:59:14 +08:00
    原来是个 feature 而不是 bug.
    Wicked
        7
    Wicked  
       2017-11-20 15:59:50 +08:00 via iPhone
    我比较烦的是它无视用户设定,自动把缩进改成空格,而我是用 tab 的
    mxalbert1996
        8
    mxalbert1996  
       2017-11-20 17:51:30 +08:00
    @Wicked
    // 按 "Tab" 时插入空格。该设置在 `editor.detectIndentation` 启用时根据文件内容进行重写。
    "editor.insertSpaces": true
    你们用软件之前都不看设置的吗
    Wicked
        9
    Wicked  
       2017-11-20 21:12:44 +08:00 via iPhone
    @mxalbert1996 最新版,设置了也不行…
    janxin
        10
    janxin  
       2017-11-21 09:56:36 +08:00
    @Wicked 已有的文件手动可以设置一下右下角的缩进选项试试
    mxalbert1996
        11
    mxalbert1996  
       2017-11-21 14:20:32 +08:00 via Android   ❤️ 1
    @Wicked 我这里最新版测试没有问题。
    wclimb
        12
    wclimb  
       2018-06-19 09:53:46 +08:00
    最新版设置了也还是不行,很烦人
    jearyvon
        13
    jearyvon  
       2019-09-05 14:23:29 +08:00
    Editor: Format On Paste
    把这个取消掉就好了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3468 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:42 · PVG 08:42 · LAX 17:42 · JFK 20:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.