-
Notifications
You must be signed in to change notification settings - Fork 23
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
Change working directory on exit? #617
Comments
Hi, this is not currently supported. As a workaround you can maybe use the I could see if I can implement this in the future, so let's keep this open until then. |
I remembered that this was also discussed in #83 It seems to have a custom implementation that you could try using in your own config, if you want to have something working for yourself until I implement this. |
Some users have a workflow where they change the cwd a lot. This feature adds an option to change neovim's cwd to the directory that was last open when yazi was closed. To opt in to this feature, set the `change_cwd_on_exit` option to `"always"` in your yazi config. You can see an example in the README file. Right now only "always" is supported, which means the cwd is always changed regardless of whether files were opened or not, but in the future we might add more options. Related issues and discussions: - #617 - #83 - #95
Hmm, I implemented this in a naive way but I don't think it's going to work. The issue is that while I can change the cwd easily, many yazi.nvim keymappings also close yazi, and I can't make a distinction between the user quitting yazi, and some command quitting yazi. The cwd should only be changed if the user presses I'll have to think of another way and maybe discuss this with sxyazi. |
If I understand correctly, you're looking for No matter if the user exits Yazi through custom keys or default keys, Yazi will write the last So, you can pass it when starting Yazi, just like how the shell wrappers do. |
I want my cwd in nvim to change when I press q in Yazi.nvim, I only quickly looked here but is this possible?
The text was updated successfully, but these errors were encountered: