Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: convenience access to silex/docker functions from keymap #72

Open
pataquets opened this issue Mar 5, 2022 · 2 comments

Comments

@pataquets
Copy link
Contributor

pataquets commented Mar 5, 2022

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 access docker main command transient.
  • Adding key binding for some docker-* commands, at least those closely related to building (eg docker-containers and docker-images), useful for tidyng up after long working sessions.
  • Should docker package had any keymap of its own, nesting it in our keymap would be also great. Adding such a keymap on docker package 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. 😁

@drewcsillag
Copy link
Collaborator

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.

@pataquets
Copy link
Contributor Author

pataquets commented Mar 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants