There are tweaks that you can do to the command line if that is an issue, but it does make launch slightly longer. This could bite you if you shell-out from Vim to bash often. Note that no profile or rc (startup) scripts are read from your shell when launching this way, so be mindful of that if there are any environment variable definitions you set there (or aliases, etc.) when inside Vim. For instance, launching C:\readme.txt this way will allow Vim to open /mnt/C/readme.txt. Uses the wslpath command to translate the Windows-style path that is passed in to the WSL equivalent. Starts WSL by executing ( -e) a sh instance with the actual commandline ( -c) we need, which. wsl.exe is the replacement command for launching WSL instances (of any distribution) and is much more flexible than the. I tested it with a hardcoded Windows path (with spaces) from within CMD, at least. Hopefully I'm getting the quoting/escaping correct. So, since I can't use ftype myself, I can't test out this solution, but I'm gong to propose, as a first pass: ftype txtfile=wsl -e sh -c "vi \"$(wslpath '%1')\"" ![]() I'm happy to hear that they are still working for you, but be aware that you may need to transition to other techniques in the future. Other registry entries override any attempts to change the default behavior via the venerable ftype command. Unfortunately (for me, not for you), ftype/ assoc are fairly deprecated, especially on Windows 11 it seems.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |