Closed dvorapa closed 9 years ago
Thanks for filing an issue, this would be a useful feature and should be fairly straightforward to implement. The current selection is available via the method ProjectManager.getSelectedItem()
http://brackets.io/docs/current/modules/project/ProjectManager.html, we can add a couple of variables in the configuration like $CURRENT_FILE
to be used in cmd
and $CURRENT_FILE_DIR
to be used in dir
.
Wow, thanks for quick response. :thumbsup: for your work
Implemented in the commit 009ff20be77cea59d071ed9d784e1846c5048484. The variable for currently selected file is SELECTED_ITEM
and for its parent directory SELECTED_ITEM_DIR
.
Example configuration fragment:
[
...
{
"name": "Display contents of the currently selected file",
"dir": "$SELECTED_ITEM_DIR",
"cmd": "cat $SELECTED_ITEM",
"shortcut": "Ctrl-Alt-C"
}
...
]
The new version is not yet in the extension repository, but you can just check out the sources and overwrite the installed extension in the directory /home/username/.config/Brackets/extensions/user/aivanov.command-line-shortcuts
(for Linux). Be careful not to overwrite your customized configuration file.
Works as expected, many thanks!
Thank you also for feedback, please, feel free to suggest further extensions.
Add a special variable for currently openned file to use in the command ("cmd" option)