One use case would be to have the black
code formatter for python files, and the sqlfluff
code formatter for SQL files, and to use the same keyboard shortcut for both tools.
Currently, both are set up in Preferences -> Tools -> External Tools
, following black
documentation.
Sadly no. You cannot assign one shortcut and invoke a different External Tool based on the file extension.
But you can workaround it pretty easily:
black
for Python files and sqlfluff
for SQL files).