Change directory
Example
Normal 0 / 2Command-line 1 / 2Normal 2 / 2Change directory.
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
:cd /example/project/src- Insertion offset
24
Change the global directory to the existing src directory. Both windows inherit the new global directory.
Working directories
- Global
/example/project/src- Window 1
/example/project/src- Window 2
/example/project/src
Before & after
Before
Working directories
- Global
/example/project- Window 1
/example/project- Window 2
/example/project
After
Working directories
- Global
/example/project/src- Window 1
/example/project/src- Window 2
/example/project/src
Documentation-backed illustration. /example/project/src exists; window 1 is current; no prior tab/window local directories. Change the global directory to the existing src directory. Both windows inherit the new global directory. Primary help: :cd.
alpha
beta
gammaCursor on line 1, column 1Details & Vim help
Change directory. 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. Availability and exact behavior can depend on Vim build features, options, mappings and editor state; the linked help is authoritative.