The neovim API provides nvim_set_current_dir(), but apparently does not expose a way to query cwd. How can I go about doing this?
old question, but I couldn't find the answer, so...
here it is; :lua print(vim.fn.getcwd())
ps; if you're using lsp, you may want to put it on on_attach;
vim.api.nvim_set_current_dir(client.config.root_dir)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With