Vim Recall繁體中文

Change directory for tab page

:tcd

Example

Normal 0 / 2

Change directory for tab page.

Directory scope

Global cwd
/demo
Current tab
inherits /demo
Other tab
inherits /demo
Current window
no window-local override
Before & after

Before

Directory scope

Global cwd
/demo
Current tab
inherits /demo
Other tab
inherits /demo
Current window
no window-local override

After

Directory scope

Global cwd
/demo
Current tab
/demo/project
Other tab
inherits /demo
Current window
uses /demo/project

Subject: :tcd. Documentation-backed illustration; assumes existing fixture directory /demo/project and no current window-local directory; not replay-verified. Sets the current tab's working directory, which its current window uses. The other tab and global directory keep /demo.

Sample buffer
notes
Cursor on line 1, column 1
Details & Vim help

Change directory for tab page. This Ex reference uses the full command name; the alphabetical index omits arguments. Supply the ranges, arguments, flags and prerequisite state documented in the linked help. Press Enter to submit a complete command. The index spelling :tc[d] puts the optional abbreviation suffix in square brackets; those brackets are not typed. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.