Skip to content

How sync with on .git folder (root project) and change it on switch between files? #2036

Answered by nitaicharan
nitaicharan asked this question in Q&A
Discussion options

You must be logged in to vote

To make the working directory be synchronized with the parent folder with .git folder, you can use ahmedkhalf/project.nvim.

P.S.: I had this problem that my working directory was changing all the time I opened a new file. After a log time trying to figure out what was going on, my null-ls.nvim bellow had the active formatter with prettier and it was changing automatically the working directory for some reason:

local null_ls = require("null-ls")

null_ls.setup({
  debug = true,
  sources = {
    ...
    -- null_ls.builtins.formatting.prettier,
    ...
  },
})

This case can also happen, I guess, if the autochdir is active via command line set autochdir or via command file setting with vim.o…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@alex-courtis
Comment options

@nitaicharan
Comment options

Comment options

You must be logged in to vote
3 replies
@alex-courtis
Comment options

@gegoune
Comment options

@nitaicharan
Comment options

Answer selected by nitaicharan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants