fisadev / vim-isort

Vim plugin to sort python imports using https://github.com/timothycrosley/isort
MIT License
219 stars 32 forks source link

vim-isort not working by using git as cwd #34

Closed darrikonn closed 4 years ago

darrikonn commented 4 years ago

vim-isort does not work when setting the git repo as the cwd.

" CWD to the root of git repo when opening file inside repo
let g:gitroot=system("git rev-parse --show-toplevel")
let g:is_gitrepo = v:shell_error == 0
silent! cd `=gitroot`

This is a pretty common approach, so I wanted to check if anyone has found a workaround for this, i.e. getting vim-isort to honour to custom config.

In my case, I'm working in a monorepo, where the setup.cfg file is inside a child directory of the repo.

Cheers!