yatli / fvim

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

how to make --wsl launch lunarvim and not just plain nvim #226

Open jmlucjav opened 2 years ago

jmlucjav commented 2 years ago

Hi

I want to use fvim as the gui for nvim on wsl. I see I can start fvim like this

fvim --wsl

and it works fine, but I use lunarvim as my preferred setup. As is, fvim is starting nvim without lvim's configuration.

FYI, lvim is just launching this:

export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-/home/jm/.config/lvim}"
export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-/home/jm/.local/share/lunarvim}"

exec nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@"

Is there a way to make fvim start lvim in wsl instead of plain nvim?

I think I can achieve something similar like this:

SET NVIMSOCKET=66555
start /b cmd /c wsl lvim --listen "127.0.0.1:%NVIMSOCKET%" --headless
start C:\tools\fvim\fvim.exe --nvr 127.0.0.1:%NVIMSOCKET%

but I prefer to double check here if there is a better/cleaner way.

Thanks for this project!!

yatli commented 2 years ago

I would love to say:

fvim --wsl --nvim lvim

... but: https://github.com/yatli/fvim/blob/c43c0c651038637a889990b7a147bcb542474a11/getopt.fs#L142

The nvim argument is ignored for wsl.

yatli commented 2 years ago

I don't have access to my local git repo at the moment, can you please try:

- "wsl", ["bash"; "-l"; "-c"; $"nvim --embed {args |> escapeArgs |> join}"], true 
+ "wsl", ["bash"; "-l"; "-c"; $"{nvim} --embed {args |> escapeArgs |> join}"], true 
jmlucjav commented 2 years ago

mmm, I was testing the binary release, I don't have whatever is needed for compiling...(not a .net guy). If you can add that change, I'll test the next release

yatli commented 2 years ago

Sure. Will ping you when it's done. My local RAID0 blew up and I'm too distracted at the moment.

jmlucjav commented 2 years ago

Sure, I will keep an eye on this. Good luck if your hardware mishap!

brneor commented 2 years ago

I'm also interested in this change.

indika-dev commented 2 years ago

Hi! I found a little workaround for starting Lunarvim with fvim:

Drawback is, that Telescope based menus aren't working at all. Therefore, Lunarvim still isn't usable with Fvim, but this might be the next step in the right direction.

edit:

Drawback is, that Telescope based menus aren't working at all.

That is not correct! The dashboard menus are not working! If you call telescope directly with e.g. :Telescope projects, then all works as expected!

edit 2: :Telescope projects does not work within the dashboard! You must have a source file open in the editor! Therefore you can open config.lua with "Configuration" and then everything is working as expected.

mannahusum commented 1 year ago

I also would like to start fvim with a different „nvim“ in wsl. My backstory is a little different. I'm using fvim on windows and NixOS is my default wsl distribution. wsl nvim doesn't work:

PS C:\Users\to6338> wsl nvim
/run/current-system/sw/bin/bash: line 1: nvim: command not found

But wsl /home/nixos/.nix-profile/bin/nvim works as expected

I'll try your suggested patch and give feedback

mannahusum commented 1 year ago

I'm overwhelmed with compiling fvim on Windows. It seems I'm unable to find the necessary dependencies:

PS C:\Users\to6338\Documents\fvim> .\add_nuget_source.ps1
Die Paketquelle namens "Avalonia Nightly" wurde erfolgreich entfernt.
Die Paketquelle namens "Avalonia Nightly" wurde erfolgreich hinzugefügt.
PS C:\Users\to6338\Documents\fvim> nuget install -prerelease Avalonia.Native
Feeds used:
  https://www.myget.org/F/avalonia-ci/api/v2

Pakete "Avalonia.Native" bis "C:\Users\to6338\Documents\fvim" werden installiert.
  CACHE https://www.myget.org/F/avalonia-ci/api/v2/FindPackagesById()?id='Avalonia.Native'&semVerLevel=2.0.0

Attempting to gather dependency information for package 'Avalonia.Native.0.10.999' with respect to project 'C:\Users\to6338\Documents\fvim', targeting 'Any,Version=v0.0'
Gathering dependency information took 57 ms
Attempting to resolve dependencies for package 'Avalonia.Native.0.10.999' with DependencyBehavior 'Lowest'
Unable to find a version of 'Avalonia' that is compatible with 'Avalonia.Native 0.10.999 constraint: Avalonia (>= 0.10.999)'.
PS C:\Users\to6338\Documents\fvim>