I am using Ubuntu app inside the Windows 10. I am writing some programs inside the Ubuntu OS, able to edit the files through the Vim editor from terminal interface.
I am wondering if there is a way to open the files in Ubuntu through the interface friendly editor like Vs-code? It will be super cool. Like for example opening Vs-code in Windows and somehow configure it to access directories inside the Ubuntu system.
Let me know if you need any more specific details. Thanks
>Solution :
Absolutely. In Windows VSCode, install either:
- The "Remote – WSL" extension
- The "Remote Development" extension pack, which includes the "Remote – WSL" extension, along with similar features for Docker and SSH.
Once you’ve installed that, from inside your Ubuntu instance, you can:
code .
… to open the current directory in VSCode. Or:
code filename
to open a particular file.
You can also start from inside VSCode, and open any of your WSL instances to browse the directory structure. You’ll find an icon for this that looks like "><" stacked together at the bottom left of the status-bar. That’s the "Open a Remote Window" tool.
Alternatively, Ctrl+Shift+P and type "remote" to get a list of the features available from those extensions.
This extension creates a server running inside Ubuntu with which VSCode communicates. It not only allows editing, but also connecting to debuggers in Ubuntu, etc.