ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.83k stars 451 forks source link

When I open a file, nvim is not in the current directory #1166

Closed Penguin-SAMA closed 5 months ago

Penguin-SAMA commented 5 months ago

Version confirmation

Following prerequisites

Not a user config issue

Neovim version

NVIM v0.10.0-dev

Operating system/version

WSL Ubuntu 24.04

Terminal name/version

zsh

$TERM environment variable

No response

Branch info

0.10 (Nightly)

Fetch Preferences

SSH (use_ssh = true)

How to reproduce the issue

I am currently in the ~/test/test directory, and when I use nvim, the directory is correct; but when I use nvim followed by any file name, it automatically jumps to the home directory. This includes all behaviors of :cd, treesitter, and the floating terminal, which are all operating under the home directory.

Expected behavior

Operate in the currently opened directory.

Actual behavior

No response

Additional information

No response

Deg2v commented 5 months ago

I encountered a similar problem where certain directories are recognized as a project, so nvim will jump to the project directory, so I manual_mode =true, in ~/.config/nvim/lua/modules/configs/tool/project.lua. project.nvim says Manual mode doesn't automatically change your root directory.I hope it will be helpful to you.

CharlesChiuGit commented 5 months ago

I am currently in the ~/test/test directory, and when I use nvim, the directory is correct; but when I use nvim followed by any file name, it automatically jumps to the home directory. This includes all behaviors of :cd, treesitter, and the floating terminal, which are all operating under the home directory.

it not a bug, it's by design.

Penguin-SAMA commented 5 months ago

@Deg2v Thx, its useful

Jint-lzxy commented 3 months ago

This seems to be a duplicate of https://github.com/ayamir/nvimdots/issues/677. Please refer to that issue for additional information.