Vim Recall繁體中文

Change directory locally

:lchdir

Example

Normal 0 / 2

Change directory locally.

Working directories

Global
/example/project
Window 1
/example/project
Window 2
/example/project
Before & after

Before

Working directories

Global
/example/project
Window 1
/example/project
Window 2
/example/project

After

Working directories

Global
/example/project
Window 1
/example/project/src
Window 2
/example/project

Documentation-backed illustration. /example/project/src exists; window 1 is current; no prior tab/window local directories. Change the current window directory to the existing src directory. Window 2 retains its directory. Primary help: :lchdir.

Sample buffer
alpha
beta
gamma
Cursor on line 1, column 1
Details & Vim help

Change directory locally. 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 :lch[dir] 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.