DEV Community

Mahdi Jafari
Mahdi Jafari

Posted on

A convenient way of creating, duplicating, moving, renaming, and deleting files and directories in VS Code.

You can be more productive in VSCode if you know how to use it.
The power of VSCode comes with its extensions.
Today I want to show two amazing extensions, which you can create, duplicate, move, rename and delete files and directories in a more convenient way.

Trust me, you're gonna love it if you use it.
These extensions are:

Let's get started!

  1. Install File Utils extension

    • click this link and follow the instructions.
    • Or just open VSCode and click extension's icon on activity bar or hit Ctrl + Shift + x. Search File Utils, select the first one File Utils extension, and click the install button File Utils
  2. Install Advanced New File extension

    • click this link and follow the instructions
    • or just open extensions in VSCode with Ctrl + Shift + x shortcut. search advanced new file, select advanced new file by patbenatar, and install it. Advanced New File
  3. after you have installed File Utils and Advanced New File extension, it's time to play around.

Let's use it:

Creating files and directories

Create a new file:
- Hit Ctrl + Shift + p
- Type new file
- Choose either Advanced New File or File utils: new file relative to the current view
- Choose the location where you want to create your file
- Then type your file name with its extension

Wow! your file is created. you might think that it is easier to create a file by clicking the + button, but after you have created files a couple of times this way, you're gonna love it.

Create directories
- Same as files, you can create directories.

Renaming files

  • Open the file you want to rename
  • Hit Ctrl + Shift + p to open command palette
  • Type rename
  • Rename your file

Deleting files

  • Open the file you want to delete
  • Hit Ctrl + Shift + p to open command palette
  • Type delete and press Enter
  • This will delete your file and you can find it on your PC Trash or Recycle Bin

Moving files

  • Open the file you want to delete
  • Hit Ctrl + Shift + p to open command palette
  • Type move and press Enter
  • This will open and small popup which contains the file path and file name. you can move to other directories.
    • if the directory does not exist, you can create it by typing in the path.
    • also you can rename the file this way.

It might take time to get used to this approach. but this increases your productivity as a developer.

Note:
what I wrote, was my personal experience with these extensions.

Follow for more!

Discussion (0)