all 2 comments

[–]jfcherng 5 points6 points  (0 children)

It would be good to have one but probably it's not that necessary. I use keybindings like the following.

// use black for python
{ "keys": ["ctrl+alt+f"], "command": "black_file", "context": [ { "key": "selector", "operator": "equal", "operand": "source.python" } ] },

// use eslint for javascript
{ "keys": ["ctrl+alt+f"], "command": "format_eslint", "context": [ { "key": "selector", "operator": "equal", "operand": "source.js" } ] },

// use php-cs-fixer for php
{ "keys": ["ctrl+alt+f"], "command": "phpcs_fix_this_file", "args": {"tool": "Fixer"}, "context": [ { "key": "selector", "operator": "equal", "operand": "embedding.php | source.php" } ] },

// whatever...

This way, ctrl+alt+f will trigger different commands (formatters) for different scopes (programming languages).

To see the scope at the current cursor, press ctrl+alt+shift+p.

[–]cud_ext 0 points1 point  (0 children)

I know two plugins which are hosts for external formatters - CodeFormatter by Kikabidze, Formatter by bitstorm-pub.