LunarVim / LunarVim

🌙 LunarVim is an IDE layer for Neovim. Completely free and community driven.
https://www.lunarvim.org
GNU General Public License v3.0
18.09k stars 1.5k forks source link

Terminal directory different from buffer directory #2739

Closed nachiketkanore closed 1 year ago

nachiketkanore commented 2 years ago

Problem description

Monday 20 June 2022 10:55:46 PM IST Monday 20 June 2022 10:55:29 PM IST

LunarVim version

master-f1a672f

Neovim version (>= 0.7)

NVIM v0.8.0-dev

Operating system/version

Ubuntu 20.04.4 LTS x86_64

Steps to reproduce

  1. New LunarVim setup
  2. create .cpp file
  3. run !pwd in command

support info

:LspInfo Language client log: /home/nachiket/.cache/lvim/lsp.log Detected filetype: cpp

1 client(s) attached to this buffer:

Client: clangd (id: 1, pid: 2205206, bufnr: [1]) filetypes: c, cpp, objc, objcpp, cuda autostart: true root directory: /home/nachiket/L cmd: clangd

Configured servers list: clangd

:LvimInfo


/ / ____ _ ____| | / (_)__ / / / / / / \/ / ___/ | / / / __ \ / // // / / / / // / / | |/ / / / / / / / //_,// //_,/_/ |__/// // /_/

Buffer info

Active client(s)

Automatic LSP info

Formatters info

Linters info

Code actions info

Screenshots

No response

rebuilt commented 2 years ago

LunarVim uses project.nvim to set your working directory. If you want to disable automatic switching of the working directory to the project root, add this to your config:

lvim.builtin.project.manual_mode = true

That will leave your working directory intact. The working directory will be the one from which you launched lunarvim.

Then, if you want project.nvim to detect your project root you can do so with the :ProjectRoot command.

To disable project.nvim altogether:

lvim.builtin.project.active = false

If you want to set the cwd programmatically yourself, you can read the help docs with :help nvim_set_current_dir to do so with lua. (vim.api.nvim_set_current_dir)

Or you can follow the instructions here to set the directory with vimscript

https://vim.fandom.com/wiki/Set_working_directory_to_the_current_file
github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.