Reputation: 1775
I want to add a keybinding in dotspacemacs/user-config, to execute and external "elm-format" command, in the elm-layer, with some parameters:
elm-format --yes current-file.elm
I couldn't find how to do it, what I found on how to define keybindings is:
(define-key elm-mode-map (kbd "f") 'elm-format)
So I'm not sure about somethings here:
Let me know if you need any further clarifications.
[1] https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/elm
Upvotes: 1
Views: 688
Reputation: 3276
How do I know which keymap should I be adding a keybinding to?
If you use emacs 25 or later, you can use SPC h k d
to describe elm related keys in elm-mode
and the keymap information is contained along with the key description.
How should I put a command there?
You can always write a command wrapper for this kind of stuff.
Upvotes: 0