Skip to main content
2 of 2
edited tags
Rich
  • 32.6k
  • 4
  • 74
  • 141

How do you go back to your to global current directory after inheriting an lcd

I frequently have one root project open which I've :cd'd to. I also have other tabs with :lcd's set. This is great and works really nicely, but occasionally I end up looking at something in the main project as a result of opening a Buffer from the main project in one of my other windows...

at this point I'd like to do something to swap out of :lcd mode and back into :cd mode.

Reading :h cd I can't work it out.

It states:

When a :cd command is used, the current window will lose his local current
directory and will use the global current directory from now on.

However as I'm running on linux just running a blank :cd actually wipes out my global directory and sets it to ~

I can't find a way of accessing the :cd value that isn't modified by having an :lcd set

JonnyRaa
  • 1.2k
  • 1
  • 8
  • 13