yatli / fvim

Cross platform Neovim front-end UI, built with F# + Avalonia
MIT License
1.29k stars 26 forks source link

When opening as default editor, can't use --wsl #246

Open schaefsteven opened 1 year ago

schaefsteven commented 1 year ago

I'm running neovim in WSL2.

If I run FVim.exe --wsl, FVim starts up just fine, but running just FVim.exe without the --wsl option gives an error (I believe because neovim is not installed on Windows.)

Therefore, if I simply set FVim as my default editor for .txt files in Windows, it produces an error when trying to open the .txt file because Open with... can't provide the --wsl option.

I tried using a .bat script to launch FVim with the --wsl option, and it does work, but it also spawns a cmd window, which is less than desirable.

I can use a .vbs script to run the .bat script, and that can hide the cmd window, but Windows won't allow you to select a .vbs script as the default editor for a file type.

Could we have a config file that defines the default options used when FVim is run without options? For a user like me whose nvim is installed in WSL, I will never want to run FVim without the --wsl option, so it would make sense.

yatli commented 1 year ago

Hi,

If you're interested in hacking this, here's the FVim config code: https://github.com/yatli/fvim/blob/master/config.fs

It will be picked up before firing up nvim.