Change directory locally
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2Change directory locally.
Working directories
- Global
/example/project- Window 1
/example/project- Window 2
/example/project
Command entered · ready to apply
Working directories
- Global
/example/project- Window 1
/example/project- Window 2
/example/project
Command line
- Typed text
:lchdir /example/project/src- Insertion offset
28
Change the current window directory to the existing src directory. Window 2 retains its directory.
Working directories
- Global
/example/project- Window 1
/example/project/src- 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.
alpha
beta
gammaCursor on line 1, column 1Details & 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.