File in a Nutshell
Quickly copy files and their contents with formatted paths.
Features
- Copy File Content with Path: Easily copy the content of selected files along with their relative paths, formatted with appropriate comment styles based on the file type.
- Copy Folder Content with Paths: Recursively copy the content of selected folders and all their subfolders, including file paths and contents.
- Customizable Keyboard Shortcuts: Assign your preferred keyboard shortcuts for quick access to copy commands.
- Supports Multiple File Types: Automatically applies the correct comment syntax for a wide range of file extensions.
Installation
Install via VS Code Marketplace:
- Open Visual Studio Code.
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of the window or pressing
Ctrl+Shift+X (Cmd+Shift+X on macOS).
- Search for "File in a Nutshell".
- Click Install.
Install from .vsix Package:
- Download the
.vsix file from the Marketplace or your repository.
- Open Visual Studio Code.
- Press
Ctrl+Shift+P (Cmd+Shift+P on macOS) to open the Command Palette.
- Type
Extensions: Install from VSIX... and select it.
- Browse to the downloaded
.vsix file and install.
Usage
2. Using Keyboard Shortcuts
- Copy File Content with Path:
- Windows/Linux:
Ctrl + Alt + C
- macOS:
Cmd + Alt + C
- Copy Folder Content with Paths:
- Windows/Linux:
Ctrl + Alt + Shift + C
- macOS:
Cmd + Alt + Shift + C
Note: These are the default shortcuts. You can customize them as described below.
Configuration
Customize Keyboard Shortcuts
You can change the default keyboard shortcuts to better fit your workflow.
Open Keyboard Shortcuts:
- Press
Ctrl + K Ctrl + S (Cmd + K Cmd + S on macOS).
Search for Commands:
- Look for Copy File(s) Content with Path and Copy Folder Content with Paths.
Change the Keybinding:
- Click the pencil icon next to the command you want to change.
- Press the desired key combination.
- Press
Enter to confirm.
Extension Settings
You can also customize settings related to the extension:
Copy File Shortcut:
fileInANutshell.copyFileShortcut
- Type:
string
- Default:
ctrl+alt+c
- Description: Default keyboard shortcut for copying file content with path.
Copy Folder Shortcut:
fileInANutshell.copyFolderShortcut
- Type:
string
- Default:
ctrl+alt+shift+c
- Description: Default keyboard shortcut for copying folder content with paths.
To modify these settings:
Open Settings:
- Press
Ctrl + , (Cmd + , on macOS).
Search for the Setting:
- Type
fileInANutshell.copyFileShortcut or fileInANutshell.copyFolderShortcut .
Change the Value:
- Enter your preferred keyboard shortcut.
Supported File Types
The extension automatically applies the correct comment syntax based on the file extension. It supports a wide range of file types, including but not limited to:
Single-line Comments:
.js , .ts , .jsx , .tsx , .py , .sh , .rb , .php , .go , .swift , .json , .yaml , .yml , .ini , .toml , .rs , .pl , .ps1 , .bat , .cmd , .make , .mk , .dockerfile , .hs , .lua , .r , .jl , .scala , .kt , .sql , .erl , .ex , .exs , .clj , .cljs , .coffee , .nim
Block Comments:
.css , .scss , .sass , .less , .html , .htm , .xml , .c , .cpp , .h , .cs , .java , .md , .vue , .ejs , .jsp , .asp , .aspx , .m , .tex , .latex , .bib , .ml , .mli , .fs , .fsi , .fsx , .asm , .s , .d
Default Comment Style:
// for unsupported file types.
Contributing
Contributions are welcome! Whether it's reporting bugs, suggesting features, or submitting pull requests, your help is appreciated.
Fork the Repository:
- Click the Fork button at the top right of the repository page.
Clone Your Fork:
git clone https://github.com/your-username/file-in-a-nutshell.git
Create a New Branch:
git checkout -b feature/awesome-feature
Make Changes:
- Add your changes to the codebase.
Commit Changes:
git commit -am 'Add awesome feature'
Push Changes:
git push origin feature/awesome-feature
Submit a Pull Request:
- Go to your fork on GitHub.
- Click the New Pull Request button.
- Select the base repository and branch.
- Click Create Pull Request.
Issues and Support
For any issues, bugs, or feature requests, please create an issue on GitHub.
For additional support or questions, you can contact the maintainer.
License
This project is licensed under the MIT License.
Acknowledgements
- Inspired by the need to quickly copy file paths with their contents for interaction with AI tools.
Made with ❤️ by Aleoli | GitHub
| |