https://github.com/umaarov/file-path-inserter
Automatically inserts file paths as comments at the top of your code files. Supports multiple file types and integrates with VSCode.
https://github.com/umaarov/file-path-inserter
automation file-management nodejs opensource programming vscode
Last synced: 5 days ago
JSON representation
Automatically inserts file paths as comments at the top of your code files. Supports multiple file types and integrates with VSCode.
- Host: GitHub
- URL: https://github.com/umaarov/file-path-inserter
- Owner: umaarov
- License: mit
- Created: 2024-09-05T04:32:00.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-05T05:21:25.000Z (over 1 year ago)
- Last Synced: 2026-01-21T05:42:36.821Z (3 months ago)
- Topics: automation, file-management, nodejs, opensource, programming, vscode
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# File Path Inserter
**File Path Inserter** is a tool designed to automatically insert the file path as a comment at the top of your code files. This tool supports multiple file types and can be easily integrated into your development environment with a customizable keybinding.
## Features
- **Supports Multiple File Types**: Detects file types and uses appropriate comment syntax.
- **Customizable Keybinding**: Easily configure keybindings in VSCode.
- **No Additional Project Configuration Required**: Simple setup and usage across all projects.
## Supported Languages and Tools
The File Path Inserter supports the following languages and tools:
- **JavaScript (.js)**
- **TypeScript (.ts)**
- **C++ (.cpp)**
- **Java (.java)**
- **C# (.cs)**
- **Go (.go)**
- **PHP (.php)** - Note: Special handling for PHP files with ` Preferences > Keyboard Shortcuts`.
* Click on the `{}` icon at the top right to open `keybindings.json`.
* Add the following keybinding configuration:
* ```sh
[
{
"key": "ctrl+alt+i",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "node C:/scripts/insertFilePath.js ${file}\u000D"
},
"when": "editorTextFocus"
}
]]
* Adjust the path (`C:/scripts/insertFilePath.js`) to where you saved the script.
## Usage
1. **Open a File** in VSCode.
2. **Press the Keybinding**: `Ctrl+Alt+I` (or the keybinding you configured).
3. **Verify the File**: The file path should be inserted as a comment at the top of the file.
### Example Output
For a JavaScript file, the comment will look like this:
``` sh
// C:/path/to/your/file.js
```
For a PHP file, if the file starts with `
```
## Contributing
We welcome contributions! If you’d like to contribute, please:
1. **Fork the Repository**: Click the "Fork" button on GitHub.
2. **Create a New Branch**: For your changes, run:
```sh
git checkout -b your-branch-name
```
3. **Make Your Changes**: Edit files and test your changes.
4. **Submit a Pull Request**: Push your branch to your forked repository and open a pull request.
### License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
### Contact
For any questions or support, please contact hs.umarov21@gmail.com.