Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neovide --neovim-bin lvim #1570

Closed
kdamaski opened this issue Sep 29, 2022 · 8 comments · Fixed by #1946
Closed

neovide --neovim-bin lvim #1570

kdamaski opened this issue Sep 29, 2022 · 8 comments · Fixed by #1946
Labels
bug Something isn't working

Comments

@kdamaski
Copy link

i use the flag --neovim-bin to launch neovide with the lvim executable that i have (which has different configuration dir (~/.config/lvim) and different runtime dir (~/.local/share/lunarvim/) but the gui and my settings in lua managed to work when hitting the command under the ~/.config but not under every other directory (for example doesn't run under home dir). I cannot assume anything as neovide is not configurable by itself so i would appreciate some help if there is a quick(?) fix for that.

Screencast.from.29-09-2022.09.56.52.webm
@kdamaski kdamaski added the bug Something isn't working label Sep 29, 2022
@indika-dev
Copy link

indika-dev commented Sep 30, 2022

I run neovide with lvim in the following way:

  • lunarvim.lua in ~/.local/bin

vim.fn.setenv("LUNARVIM_CONFIG_DIR", "/home/user/.config/lvim")
vim.fn.setenv("LUNARVIM_RUNTIME_DIR", "/home/user/.local/share/lunarvim")
vim.fn.setenv("LUNARVIM_CACHE_DIR", "/home/user/.cache/lvim")

dofile("/home/user/.local/share/lunarvim/lvim/init.lua")

  • commandline then for neovide neovide --multigrid -- -u /home/user/.local/bin/lunarvim.lua
    all things written after '--' are parameters for neovim

@kdamaski
Copy link
Author

kdamaski commented Sep 30, 2022

I run neovide with lvim in the following way:

* lunarvim.lua in ~/.local/bin

vim.fn.setenv("LUNARVIM_CONFIG_DIR", "/home/user/.config/lvim")
vim.fn.setenv("LUNARVIM_RUNTIME_DIR", "/home/user/.local/share/lunarvim")
vim.fn.setenv("LUNARVIM_CACHE_DIR", "/home/user/.cache/lvim")
dofile("/home/user/.local/share/lunarvim/lvim/init.lua")

* commandline then for neovide `neovide --multigrid -- -u /home/user/.local/bin/lunarvim.lua`
  all things written after '--' are parameters for neovim

Thanks for replying. Unfortunately this doesn't work for me. What version of lvim are you running though? I have: master-e4a5fe9

@indika-dev
Copy link

My version of lvim 1.1.4 (47e4e5b) and neovim 0.7.2
What error message do you get?

@kdamaski
Copy link
Author

kdamaski commented Oct 2, 2022

The problem is i get no error. The neovide now provides the flag --neovim-bin and the lvim i am running is a seperate executable from nvim ( no longer runs like an alias of nvim $args -- -u <config_file> ). I am not sure if that's the case though and will be very time consuming to figure that out so i made a script that firstly goes into ~/.config and then runs neovide with the given filename as arg (if there is one) in the previous directory like so:

#!/bin/bash

cur_dir=${PWD}
cd /home/user/.config;

if [ -z $1 ] # no args given
then
neovide --multigrid --neovim-bin lvim
elif [ ${1:0:1} = "/" ] # first arg is an absolute path
then
neovide --multigrid --neovim-bin lvim "$1"
else
neovide --multigrid --neovim-bin lvim "$cur_dir/$1"
fi

Which works fine

@indika-dev
Copy link

if it's working for you, that will be great news!
Nevertheless, I would check for lvim again, perhaps with a "file lvim", because lvim is not an executable like nvim but a shell script. I checked https://github.com/LunarVim/LunarVim/blob/master/utils/bin/lvim.template (this is the lvim installed by the installer) and it's still a shell script.

@kdamaski
Copy link
Author

kdamaski commented Oct 4, 2022

Oh, that's true. I should have noticed 😅.

@fredizzimo
Copy link
Member

I think this fixes it #1946, at least it seems to work when I tested it, at least on Linux. Could someone else verify?

Just start neovide --neovim-bin lvim

@kdamaski
Copy link
Author

if it's working for you, that will be great news! Nevertheless, I would check for lvim again, perhaps with a "file lvim", because lvim is not an executable like nvim but a shell script. I checked https://github.com/LunarVim/LunarVim/blob/master/utils/bin/lvim.template (this is the lvim installed by the installer) and it's still a shell script.

Lvim depends on its own runtime configuration to run and this aknowledgement that it's a script solved my issue back then. So when I checked lvim script I just had to change nvim with neovide and there you have the correct way to run lvim through neovide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants