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

feat(exclude-from-chdir) Add exclude_chdir #131

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Zeioth
Copy link

@Zeioth Zeioth commented Jul 21, 2023

New options added

-- Don't chdir for certain buffers
exclude_chdir = {
  filetype = {"", "OverseerList", "alpha"},
  buftype = {"nofile", "terminal"},
},

This allow users to exclude certain plugins from triggering chdir.

Example case of use

I like to use manual_mode = false to auto chdir. But I don't want it to auto chdir to ~/ when opening compiler.nvim / Overseer.

Zeioth and others added 4 commits July 21, 2023 23:32
… buftypes from chdir.

This feature allow users to exclude certain plugins from triggering
chdir.
cd only when opening the file. Otherwise the behavior won't be what the user expects.
@towry
Copy link

towry commented Nov 6, 2023

I think the best solution would be adding a vim.b[0].project_nvim_disable flag so we don't have to iterate those list.

and you can set vim.b[0].project_nvim_disable in your own autocmds.

I added those flag in my fork and use it to prevent session plugins from reading the buffer in wrong cwd and it works well.

@collinvandyck
Copy link

Thanks for creating this PR. I think this change will probably fix the issue I'm seeing in #156. I thought it was a but in project.nvim but after reading the code I was confused why it would try to change the CWD multiple times, but being triggered by other kinds of buffers seems the most likely explanation.

@Zeioth Zeioth changed the title feat(exclude-from-chdir) Add exclude_filetype_chdir / exclude_buftype_chdir feat(exclude-from-chdir) Add exclude_chdir May 25, 2024
@Zeioth
Copy link
Author

Zeioth commented May 25, 2024

@collinvandyck You can use the main branch of my fork to get the feature (compatible with nvim 0.10 and upper).

@collinvandyck
Copy link

thanks @Zeioth ! i'm still on 0.9.5 but plan on upgrading soon and I will try that out, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants