lazygit
lazygit copied to clipboard
using -ic instead of -c for command argument
when i try to open a file in lazygit, i got an error:
bash -c vim: vim cmmand not found
i think the reason is i dont have vim installed, rather i have nvim and alias vim to nvim.
This becomes an issue when run vim through bash -c. as the alias is not correctly expanded.
I woudl suggest to change the option args from -c to -ic to avoid such issues.
Can't you set $EDITOR to nvim?
i did that in .bashrc, i am in zsh calling bash -c, and does not work, i think due to the non-interactive call for bash...
Makes sense.
There is a draft PR for precisely that feature, but it's somewhat stale and faulty.
Would you maybe be willing to pick it up? It's okay if you're not, just asking :)
In the meantime, you could just set the editCommand to nvim in your config - link to the docs.
i did that in .bashrc, i am in zsh calling bash -c, and does not work
You need to write export EDITOR="nvim" in your .zshrc.
I believe I'm running into this as well.
still not resolved i believe
the problem is that nvim is invoked using bash, not zsh, thus, the nvim is a new instance in addition to the nvim that runs the laygit in its terminal.
It seems from what you’ve described that the problem is your configs depending on shell specific behavior, aliases, to be called from other applications. This is incredibly brittle for the reasons you’ve discovered, and is best avoided for that reason. It has been suggested above that you either set $EDITOR or lazygit’s editCommand config as needed. Have you tried either of those? If so, is there a reason that neither of these have worked for you?
yes, i have editor set to nvim, and have edit command set to either nvim or 'zsh -c nvim', none of that works... i am using lazyvim under zsh, and within lazyvim i call lazygit , and that is when it has problem, and the message when returning from lazygit says it uses bash -c nvim
I was able to partially get it working by using the full nvim path.
I had the same issue where both the env variable and config were set correctly. None of that worked.
It still hangs and has to be killed if:
- you miss the filename.
- you attempt to use o for open on a file or a dir.
# .config/lazygit/config
os:
edit: '/usr/local/bin/nvim-linux64/bin/nvim {{filename}}'