Skip to content

About Vim's "current directory"

NWang edited this page Feb 20, 2023 · 1 revision

All your function calls will use the "current directory" closest to your current window. If you only call :tcd instead of :cd in any tabpage you created for your project, you will be fine with suave.lua. The following are my notes:

  • :lcd stores a path for the current window, and any win-split starting from it will inherit the value.
  • :tcd stores a path for the current tabpage, and any tab-split starting from it will inherit the value.
  • :cd stores a path for the current Vim session.
    • :cd also affects those no-:lcd wins in no-:tcd tabs.
  • :tcd will also remove what :lcd has stored to the current win.
  • All these values can be restored by Vim's session. Thus my creation of this plugin.
Clone this wiki locally