See open command for more info.

$ open file.txt

If you have this command enabled for your IDE. Use code for VS Code.

$ code file.txt