I have written the extension Command on All Files. It is a modification of the extension Format All Files in Workspace by Alex Ross.
You can configure multiple commands that you want to run on all files and configure to which files it should apply. You can override the includeFileExtensions
and excludeFolders
setting per command.
If you use multi-command by ryuta46 you can create a sequence of commands that you want to apply to each file. (Why recreate what already is implemented) For an example see the extension page.
For the organizeImports
from the TS Hero plugin you can have this configuration
settings.json
"commandOnAllFiles.commands": {
"TS Hero: Organize Imports": {
"command": "typescriptHero.imports.organize",
"includeFileExtensions": [".ts"]
}
}
keybindings.json
{
"key": "ctrl+i o", // or any other key combo
"command": "commandOnAllFiles.applyOnWorkspace",
"args": ["TS Hero: Organize Imports"]
}
For version 0.1.0 of the extension only the method of the keybinding is implemented to supply the argument to the commandOnAllFiles.applyOnWorkspace
command. In the next release it can be done from the Command Palette.