Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to overwrite files in VS Code on copy-paste (and not get a *.1* appended to the filename)?

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! :)

like image 269
chamberlainpi Avatar asked Jan 29 '19 12:01

chamberlainpi


People also ask

How do I replace all occurrences in Visual Studio?

You can find and replace text in the Visual Studio editor by using Find and Replace (Ctrl+F or Ctrl+H) or Find/Replace in Files (Ctrl+Shift+F or Ctrl+Shift+H). You can also find and replace only some instances of a pattern by using multi-caret selection.

How do you paste multiple times in VS Code?

Instead of paste the code with the key combination Ctrl+V, paste them using Ctrl+Shift+V. A dropdown appears close to the cursor with the list of your clipboard history from Visual Studio. Now you can click directly to an item or you can use the number of the line that you want to paste. That's all!


1 Answers

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

like image 168
designreact Avatar answered Oct 13 '22 22:10

designreact