I'm using Visual Studio Code for working and I use ctrl-P
command to search for files in my directory.
The problem appears when I want to search for another file, it opens it in the place of the first searched file, closing it.
Is any setting for avoiding this pain?
By default, VSCode opens files in preview mode. This is indicated by their name being italic in the menu bar. As John noted, you can double click on the file to fully open it.
To disable this behavior, try setting:
"workbench.editor.enablePreview": false