- #Linux set default editor to vim install#
- #Linux set default editor to vim full#
- #Linux set default editor to vim code#
#Linux set default editor to vim code#
VS Code should launch into a WSL session showing the instance, Ubuntu, with a directory and file listing for the current directory.Ĩ.
#Linux set default editor to vim install#
Enter the following command to install the VS Code Server on Linux and launch VS Code in Windows from the current directory: $code. Using the WSL2 shell, in this case for Ubuntu, log in to the terminal.Ħ. One of these, Ubuntu, was configured for WSL2 by running the following command: C:\Users\Torben\wsl -set-version Ubuntu 2ĥ.
Optional, I had WSL (v1) instances installed prior to running WSL2. Open a Command Prompt and list installed WSL subsystems and their versions by typing: C:\Users\Torben\wsl -list -verboseĤ. Install the ‘Remote-WSL’ extension for VS Codeģ. Install the Windows Subsystem for Linux 2 (WSL2) utilizing the Microsoft Installation GuideĢ. However, VS Code will not replace VIM, only make its use a little less (for my editing), and if we so choose we can even run VIM within VS Code as will be highlighted in the steps. Next we will go through the steps of getting WSL2 installed and configured with VS Code integration to see this editing in practice. This virtualization technology enables us to view and edit the Linux filesystems from Windows using VS Code. It is still there and the enabling technology for WSL2, however, we do not need to manage it ourselves, thus making us more productive. Yes, the summary is less than truthful by stating hypervisor VMs are gone.
#Linux set default editor to vim full#
WSL2 is a feature of Windows 10 that allows running a full Linux Kernel instance on the same machine utilizing its hypervisor technology, Hyper-V, effectively running a lightweight Linux VM on Windows. The problem WSL2 and VS Code has solved, is if we are productive using VS Code based on its capabilities and extensions, such as IntelliSense, Source Code Management, etc., we want that productivity to carry across Windows and Linux filesystems. After all, computing was intended to make our lives more productive, not less (a tidbit I sometimes find overlooked in the spirit of innovation). if the one you are using makes you productive, then that is the right editor for you. Regardless of editor Notepad, Notepad++, Word, VS Code, Visual Studio, Eclipse, VI, VIM, nano, etc. This passion is fully justified and what is the right editor for one may not be right for someone else. Code/text editors strike passion in anyone who does any type of substantial editing, particularly if attempting to convince them there is a better one than what they are using. The intent of this post is not to compare VIM to VS Code or claim one is better than the other. A very transparent editing experience with high productivity. With WSL2 it is now possible to edit the direct Linux filesystem files from within VS Code in Windows which reduces the need for VIM/nano and provides IntelliSense for known file types. In Windows it is Visual Studio or VS Code and in Linux it is VIM or nano.
However, until WSL2 I continued to use both Windows and Linux native editors for each environment. Gone are the days of dual boots, hypervisor VMs, or multiple machines to get started in developing between Windows and Linux. Cross-platform development between Windows and Linux has been made simpler over the years since the introduction of Windows Subsystem for Linux. This post will go through using Visual Studio Code (VS Code) as the “native” file editor for Linux by leveraging the Windows Subsystem for Linux 2 (WSL2).