Feature suggestion: convenience access to silex/docker functions from keymap
I'm using heavily dockerfile-mode. I've found it awesomely useful! Thanks for sharing.
I use it under Spacemacs's docker layer, which neatly merges dockerfile-mode with silex's docker package.
Based on daily usage, I have some suggestions to save a few keystrokes:
- Add a key bind (eg.
C-d) to quickly accessdockermain command transient. - Adding key binding for some
docker-*commands, at least those closely related to building (egdocker-containersanddocker-images), useful for tidyng up after long working sessions. - Should
dockerpackage had any keymap of its own, nesting it in our keymap would be also great. Adding such a keymap ondockerpackage looks like not a big deal, I guess.
It might sound overlapping/mixing packages, but having docker-* commands handy right in the Dockerfile sounds quite reasonable to me.
Just asking for feedback, although I might take a stab at it, once I up a little more my elisp-fu. :grin:
C-d is already bound to delete-key, but C-c C-d could work
If you look where docker-file-mode-map, you can see the existing keybinding and add more.
You could consider adding dockerfile-mode-hook so that instead of baking it into the mode, you could hook into it in your .emacs file to add whatever you like. I'm a little surprised I didn't add it when I wrote this. (e.g. for another mode, this is how the hook is defined -> https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/m4-mode.el#L93)
As to nesting keymaps, I've never done it myself, nor do I know how atm.
PRs welcome for any/all of the above.
Thanks for the quick feedback, @drewcsillag .
Indeed, I was meaning C-c C-d for the binding. Sorry for not being clear.
Thank you very much for the pointers. I've mostly solved it under Spacemacs, but it's nice to see you're open to PRs.
EDIT: I acknowledge that the natural place to have it implemented is in this package, instead of Spacemacs. If I find some spare time, I'd like to upstream my solution to this package.