A simple Neovim plugin to quickly set the current working directory. Useful for people who frequently change directories, without necessarily quitting Neovim.
- Easily set the current working directory to the directory of the current selected buffer
- Works within netrw, files and terminal buffers (tested with zsh. should work with bash & co)
- Provides variants for different directory changing commands:
:TcdHere,:LcdHere, and:CdHere
Add the following to your lazy configuration:
{
"juliuswaldmann/here.nvim",
config = function()
require("here)
end,
}Add the following to your packer configuration:
use {
'juliuswaldmann/here.nvim',
config = function()
require("here")
end
}Use any of the following commands to set the current working directory according to the buffer directory:
:Here(alias for:CdHere):CdHere(Uses:cdto change the global working dir):TcdHere(Uses:tcdto change the tab-wide working dir):LcdHere(Uses:lcdto change the window-local working dir)
These commands work in different contexts:
- In a file buffer: Sets the working directory to the directory containing the current file
- In a terminal buffer: Sets the working directory to match the current directory in the shell
- In netrw: Sets the working directory to the current netrw directory
Coming soon...
If you want to contribute please feel free to open a Pull-Request. All contributions are welcome!
This project is licensed under the MIT License - see the LICENSE file for details.