Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Copy Dir PathNew to Visual Studio Code? Get it now.
Copy Dir Path

Copy Dir Path

Roger Takeshita

|
142 installs
| (0) | Free
Copy current file dir path
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Copy Dir Path for Visual Studio Code

Copy relative / absolute directory path from your current file

Keybinding

Shortcut Description Command
alt+c Copy relative directory path of the current file (default) copyRelativePath

Available Options

Command Description
copy-dir-path.copyAbsolutePath Copy absolute directory path. (e.g. ../path_to/project/app/controllers/)
copy-dir-path.copyAbsolutePathTouch Copy touch + absolute directory path. (e.g. touch ../path_to/project/app/controllers/)
copy-dir-path.copyRelativePath Copy relative directory path. (e.g. app/controllers/)
copy-dir-path.copyRelativePathTouch Copy touch + relative directory path. (e.g. touch app/controllers/)

In your keybindings.json:

  • You can override the default keybinding to use another available option. e.g.

      // Disable copyRelativePath (default)
      {
          "key": "alt+c",
          "command": "-copy-dir-path.copyRelativePath",
          "when": "editorTextFocus"
      },
      // Enable copyRelativePathTouch
      {
          "key": "alt+c",
          "command": "copy-dir-path.copyRelativePathTouch",
          "when": "editorTextFocus"
      },
    

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft