[BUG] Opening files via Yazi does not respect default EDITOR
Describe the bug
The current setup
- Yazi as the default file explorer
- Kitty as the default terminal
- nvim as the default EDITOR
Details
Running Yazi through the terminal correctly opens the files using nvim. However using Yazi via the explorer keybinding opens files using nano.
Steps to reproduce
Reproduce
- Call the file explorer
yazivia the keybinding - navigate to any file and press
o - Take note that
nanois used
Verify correct editor
- open
kittyvia the default keybinding - type
yazi - Navigate to any file and press
o. - Take note that
nvimis used
Expected behavior
- Call the file explorer
yazivia the keybinding - navigate to any file and press
o - Take note that
nvimis used
Screenshots
No response
Distribution
EndeavourOS
If Other, specify
No response
Additional context
No response
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
@malhashemi Can you enter
export EDITOR=nvim
into a terminal and try again?
That didn't work but I have been doing some testing on what could be the issue. I think it is in the way 'exec' works in Hyprland. So when running the same script that key binding executes using any terminal I get yazi to use nvim, but everytime I press the keybinding yazi still uses nano. So I tried exporting the editor to NVIM from TTY. Did that by pressing Ctrl+Alt+F3 on the SDDM logging screen and that fixed the issue. However that is not persistent and every time I reboot I have to do the same thing. Appreciate if you have a better solution here
That didn't work but I have been doing some testing on what could be the issue. I think it is in the way 'exec' works in Hyprland. So when running the same script that key binding executes using any terminal I get yazi to use nvim, but everytime I press the keybinding yazi still uses nano. So I tried exporting the editor to NVIM from TTY. Did that by pressing Ctrl+Alt+F3 on the SDDM logging screen and that fixed the issue. However that is not persistent and every time I reboot I have to do the same thing. Appreciate if you have a better solution here
Configure openers in ~/.config/yazi/yazi.toml
[opener]
play = [
{ run = 'mpv "$@"', orphan = true, for = "unix" },
]
edit = [
{ run = 'nvim "$@"', block = true, for = "unix" },
]
open = [
{ run = 'xdg-open "$@"', desc = "Open" },
]