19

Whenever I copy-paste a file in VS Code's project pane from one folder to another with an existing file of the same name, it keeps appending a .1 in the filename.

(ex: bob.jpg -> bob.1.jpg).

Is there a way to disable this and have it overwrite the file instead (or at least prompt to confirm the overwrite)?

Example of project folder:

[folder] images_1
        bob.jpg   //copy this
[folder] images_2
        bob.jpg   //to replace this one here...

For now, I'm forced to do it through Windows Explorer, but if there's a way I'd sure like the answer! :)

chamberlainpi
  • 4,854
  • 8
  • 32
  • 63

3 Answers3

6

Incremental naming can be disabled as of v1.72, see release notes:incremental naming:

Ability to disable incremental naming, in file explorer

A new value of disabled has been introduced to the explorer.incrementalNaming setting. This allows for completely disabling any logic surrounding changing the file name on paste within the explorer. If the file name is already present you will be prompted to overwrite the existing file, similar to most native explorers.

Mark
  • 143,421
  • 24
  • 428
  • 436
4

It's a bit of a hack but I delete the file I'd like to replace, then paste the new one.

designreact
  • 141
  • 1
  • 10
1

From what I've been able to gather, incremental naming patterns are forced when performing duplicate copy-paste operations within VS Code itself. The VS Code team were not so keen on the idea of changing that, either.

Windows Explorer drag and drop seems to be the best "workaround" for this to date.