-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Feature]: Support for VimR and neovide #1229
Comments
I second this. I use neovide, and would like to be able to just run with the lunarvim setup by default. I actually ended up getting this to work by changing a few paths in a few of the files (in lunarvim 0.5.1 release), but the moment I get the next release, I know I will have to do some merges. It would be nice to have user configurable root, so that some of us that just want to use lunarvim full-time, can do so without running a different executable (lvim) and/or aliasing nvim. |
Does this launch neovide correctly for you (without the altering of paths?) neovide -- -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim"
|
By the way, if that command works for you then you can add this shell function to your bashrc/zshrc function lvimr(){
vimr --nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim" "@"
} It would still take arguments like any typical compdef _vimr lvimr |
thanks. BUT what I mean is there are so many cases people want to open the GUI application from GUI environment, and get lunarVim loaded automatically (I guess so IMHO) 😀 |
I have not tried doing that, but if I did I would still have to alias it, or create a function (as was suggested earlier). By having the paths (really the root) be configurable, there would be no need for that. Also, it would basically have any GUI vim application (such as neovide, or VimR) just work out of the box. I realize that this is perhaps no longer the direction that lunarvim wants to go in (though pre-0.5, it did work this way), and that I can always just grab the latest code and manually update the paths in the code myself. But it would be nice if that flexibility was re-introduced. |
If you use the code from above. Also set your editor to |
As far as I know, changing the default app needs the bundle ID of an app, not a function in shell, $ duti -x .md
VimR
/Applications/VimR.app
com.qvacua.VimR Can you tell me more details on how to do it? Many thanks~ |
Ah, sorry. I'm misleading you. That will only work from the command line, not finder. |
I'm not sure about osx, but on Linux you can just add an entry like this one here and give it any flags you want for LunarVim/utils/desktop/lvim.desktop Lines 1 to 13 in 2345d8c
Another approach is to wrap that call in a shell "launcher" script, just like how Lines 1 to 3 in 2345d8c
|
I would like to request support for Goneovim as well please :) https://github.com/akiyosi/goneovim |
This should probably work now after #1381. Clone the repo into |
@kylo252 wait are you saying clone the lunarvim repo into |
It kind of works but not without some tweaks. Some of the things like reloading the configs, and running LvimUpdate will fail Here is what I did to get this to work:
becomes
becomes
After these changes, everything works. I launch nvim, and I get lunarvim (no aliases or using lvim script). I launch neovide and it automatically uses lunarvim. Just gotta make sure that the LUNARVIM_RUNTIME_DIR variable is set. |
The pattern is that in the code (and the install scripts), there is an assumption that the repository files will reside in a subdirectory of LUNARVIM_RUNTIME_DIR called I have been looking through the code, and this can be resolved by using another environment variable (e.g. LUNARVIM_REPO_DIR) to represent this directory. After making the necessary code changes my above tweaks (minus the LUNARVIM_RUNTIME_DIR export) would simply be replaced by the following export:
Of course, the insallers and code would default to:
I would me happy to submit a PR with the changes. My concern is that there may not be interest in pulling in my PR as this issue has been open for a while, and not had engagement in some time. |
You don't need to do that, that's the whole point 😅
I just needed someone to test the changes, I know it works fine on Windows for example.
Thank you! But it's a lot simpler to fix than you think. I had just forgotten to use the diff --git a/lua/bootstrap.lua b/lua/bootstrap.lua
index fb2099c..c6f0646 100644
--- a/lua/bootstrap.lua
+++ b/lua/bootstrap.lua
@@ -63,7 +63,6 @@ function M:init()
self.runtime_dir = get_runtime_dir()
self.config_dir = get_config_dir()
self.cache_path = get_cache_dir()
- self.repo_dir = join_paths(self.runtime_dir, "lvim")
self.pack_dir = join_paths(self.runtime_dir, "site", "pack")
self.packer_install_dir = join_paths(self.runtime_dir, "site", "pack", "packer", "start", "packer.nvim")
@@ -120,19 +119,15 @@ function M:update()
end)
end
-local function git_cmd(subcmd)
+local function git_cmd(args)
local Job = require "plenary.job"
local Log = require "core.log"
- local repo_dir = join_paths(get_runtime_dir(), "lvim")
- local args = { "-C", repo_dir }
- vim.list_extend(args, subcmd)
local stderr = {}
local stdout, ret = Job
:new({
command = "git",
args = args,
- cwd = repo_dir,
on_stderr = function(_, data)
table.insert(stderr, data)
end,
@@ -153,10 +148,16 @@ end
---pulls the latest changes from github
function M:update_repo()
local Log = require "core.log"
+
+ local repo_root = join_paths(get_runtime_dir(), "lvim")
+ if not os.getenv "LUNARVIM_RUNTIME_DIR" then
+ repo_root = vim.fn.stdpath "config"
+ end
+
local sub_commands = {
- fetch = { "fetch" },
- diff = { "diff", "--quiet", "@{upstream}" },
- merge = { "merge", "--ff-only", "--progress" },
+ fetch = { "-C", repo_root, "fetch" },
+ diff = { "-C", repo_root, "diff", "--quiet", "@{upstream}" },
+ merge = { "-C", repo_root, "merge", "--ff-only", "--progress" },
And that source command in |
Thanks. I tried to apply your diff, but I kept getting a an error about it being corrupt. So I went ahead and applied the changes manually. It looks like your line numbers did not match up with what I had from the latest pull from rolling. Unfortunately your change did not work when I called LvimUpdate. The reason is that this code (while consistent with function _G.get_runtime_dir()):
Breaks the LvimUpdate for me. As I mentioned before, in order to get lunarvim to work, I had to define LUNARVIM_RUNTIME_DIR as:
This is so that the packpath is properly setup in the bootstrap.init() method where the check for LUNARVIM_RUNTIME_DIR is performed. The simple change would be to just update the repo_root setup to:
I tested this, and it worked. Though I am not sure if that is the right way to do this as it leads to it no longer being consistent with Lastly, the function _G.get_version(type) in bootstrap is also hardcoding the If you think it is ok to use the corrected code above, then I can send you a diff (ill create a get_repo_dir() function since it would also be used by the get_version() function), and/or submit a PR with your changes, plus my tweaks. My only question would be if I should make the new get_repo_dir() function Global or local. |
I noticed some additional changes were made in rolling so I have grabbed the latest. Also, now having a better understanding of how the packages are loaded and what the default directories are, I finally got everything working as I want (in both nvim and running neovide). Here is what I changed:
FYI, I am running this on Linux Manjaro. If you agree with my change, I can submit a pull request, and I think this issue can be closed. |
Yeah I've been thinking about how to resolve this, the problem is specifically related to packer's runtime, and not necessarily lvim's. I also did fix the LvimUpdate path for you in #1707. Please do open a PR, and we can figure out the best way to solve this. We really should add some CI test for this to make sure it's not broken. I ended up removing the tests that I had attempted at the time, but it should be easier now, I hope. |
Thanks. Here you go: |
I understand your above comment is almost 6 months old. Does it still "work" for you? I do not see LunarVim Dashboard, nor do LunarVim keybindings like say @sa-mendez @kylo252 Do I need to set any environment variables to get VimR to use lvim configuration ? |
@mandarvaze, this should still work. You basically need to clone this repo into |
@kylo252 I cloned the repo How do I invoke If I start Am I missing any steps ? Am I doing something wrong ? |
Try opening |
@kylo252 and I think there might some caching issue somewhere. I wish I knew what it was. |
IMPORTANT: Backup any of these folders if you need to Please make sure to run the uninstaller.sh. Then delete all of these neovim folders manually. rm -rf "$HOME/.config/nvim"
rm -rf "$HOME/.local/share/nvim"
rm -rf "$HOME/.cache/nvim" Now open up Only after you have verified that your vanilla neovim is working, do the following git clone https://github.com/LunarVim/LunarVim ~/.config/nvim
touch ~/.config/nvim/config.lua |
@kylo252 💯 I hope these instructions make it to official documentation |
Hi! If I do the above, and attempt to update LunarVim, I get the following (apparently unformatted) error:
|
@riotrah, your issue is related to a recent-ish change in git, see https://github.blog/2022-04-12-git-security-vulnerability-announced the easiest solution is back up your config and re-install lunarvim |
This worked perfectly after running |
Use this https://gitlab.com/lostneophyte/dotfiles/-/blob/main/bins/.local/bin/lvimn #!/usr/bin/env bash
export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}"
export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$HOME/.config/lvim"}"
export LUNARVIM_CACHE_DIR="${LUNARVIM_CACHE_DIR:-"$HOME/.cache/lvim"}"
export LUNARVIM_BASE_DIR="${LUNARVIM_BASE_DIR:-"$HOME/.local/share/lunarvim/lvim"}"
exec neovide -- -u "$LUNARVIM_BASE_DIR/init.lua" "$@" |
Feature motivation
Since LunarVim uses a custom directory (
~/.local/share/lunarvim/lvim
), the LunarVim configuration cannot be loaded when opening vimr (a Neovim GUI for macOS) directly.Even I copy it into
~/.config/nvim
, it doesn't work,because the path has been remove from
packpath
andruntimepath
PS. the command
vimr --nvim -u ~/.local/share/lunarvim/lvim/init.lua --cmd "set runtimepath+=~/.local/share/lunarvim/lvim"
works fine.Describe the expected solution
No response
Describe the alternatives you've considered
an installation switch option to choose directory between
~/.local/share/lunarvim/lvim
and~/.config/nvim
?Additional context
No response
The text was updated successfully, but these errors were encountered: