Skip to content

Current dir does not change when opening a file #2058

@alextrastero

Description

@alextrastero

Description

Steps:
cd ~/Downloads
vim ../Documents/how-to-close-vim.docx
:NvimTreeOpen

Result:
nvim tree opens in Downloads folder

Expected:
nvim tree opens in Documents folder

my config:

-- disable netrw at the very start of your init.lua (strongly advised)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

nvim_tree.setup {
  respect_buf_cwd = true,
  sync_root_with_cwd = true,
}

Neovim version

NVIM v0.9.0-dev-1092+gbc15b075d

Operating system and version

Linux fedora 6.1.14-200.fc37.x86_64

nvim-tree version

Updated nvim-tree/nvim-tree.lua: bbb6d48..1d79a64

Minimal config

-- disable netrw at the very start of your init.lua (strongly advised)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

nvim_tree.setup {
  respect_buf_cwd = true,
  sync_root_with_cwd = true,
}

Steps to reproduce

cd ~/Downloads
vim ../Documents/how-to-close-vim.docx
:NvimTreeOpen

Expected behavior

nvim tree opens in Documents folder

Actual behavior

nvim tree opens in Downloads folder

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions