Back to Blog
Get text file to open in terminal5/28/2023 ![]() ![]() At that point, I'd totally forgotten about ftype myself until your question reminded me. If, in the future you find that ftype no longer works for you, see this answer that I provided just two days ago on an alterative. 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. But see my questions for clarifications in the comment above. A double click on the M-file opens it in the editor also. Alternatively you can click on the 'Open' button in the menu. ![]() Starts WSL by executing ( -e) a sh instance with the actual commandline ( -c) we need, which. Jan on 3 Link You can open an M-file in Matlab by typing edit File.m If it is not in the current path add the path name also. 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. The available mode s are: r (read-only - default), w (write - erase. Other registry entries override any attempts to change the default behavior via the venerable ftype command. open(file, moder) -> fileObj : Open the file and return a file object. Unfortunately (for me, not for you), ftype/ assoc are fairly deprecated, especially on Windows 11 it seems. ![]()
0 Comments
Read More
Leave a Reply. |