Search code examples
visual-studio-code

Visual studio code, how to copy the file name


In the visual studio code, it has commands to Copy Path and Copy Relative Path (Ctrl+Shift+p->File: Copy Path of Active File). Is there a way I could copy the active file name instead of the whole path?

If there is no way copy the active file name. Is there a way I could write a script or something which creating a new command based on existing Copy Path and showing the new command in the Command Palette?


Solution

  • The extension Copy file name works like a charm! CTRL+ALT+F gives you filename and CTRL+ALT+E gives the filename.extension.