-
Notifications
You must be signed in to change notification settings - Fork 44
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 request] bind q
to exit resource details buffer (quit-window
and kill-buffer
)
#36
Comments
q
to exit resource details buffer q
to exit resource details buffer (quit-window
and kill-buffer
)
would binding as https://www.gnu.org/software/emacs/manual/html_node/elisp/Keymaps-and-Minor-Modes.html
There is an existing minor mode when viewing the yaml details of a resource, we could add something like: (define-minor-mode kubel-yaml-editing-mode
"Kubel Yaml editing mode.
Use C-c C-c to kubectl apply the current yaml buffer."
:init-value nil
:keymap (let ((map (make-sparse-keymap)))
(define-key map (kbd "C-c C-c") #'kubel-apply)
(define-key map (kbd "C-c q") #'kill-current-buffer)
map)) Binding (define-key map (kbd "q") #'kill-current-buffer) |
Huh! Which is undesirable if someone wanted to type the letter Anyhow, the following worked for me using evil. Or maybe just add it as a comment/note in the readme/wiki. (evil-define-key 'normal 'kubel-yaml-editing-mode "q" #'kill-current-buffer) |
@d1egoaz kubernetes.el package has this functionality. Check this out - https://github.com/kubernetes-el/kubernetes-el/blob/31191bccf759931c2a7f8fe179bd36d0c70de6da/kubernetes-utils.el#L80 |
I've been looking into this today, and what I've managed to do is to override the I also had to modify the function more, cause I never managed to set the optional Another thing I have problem with is that This code kinda works (it doesn't without commenting out the last
When I put the
PS(this should be a new issue?): How come all of the parameters for each function needs to be prepended with |
I've done some more work on this one, and the more I look at it, the more strange I think it is that it uses the Also, shouldn't This is my take on the new function:
The If you'd like @abrochard, I can make a PR with my change, and how I think it all could look like. PS: There is also something strange with |
This thread confuses me. I think there are multiple issues at hand:
|
Sounds like a good summary!
|
Sorry what is |
If you press ctrl+u before enter, you will get the transient menu, and there you can add -y. Im also afraid of breaking people's workflow, but should people use E/quick edit if they want to change a resource? I think either adding a flag like I've did, or added a new shortcut is the way to go for this feature. |
Got it. |
Agree with that, keep the scope small. I can make a PR with the name |
Sounds great, thank you! |
I’ve been looking into this today, and I’m pretty sure I’ve mistaken how at So I think the solution would be to make it read only when you run Another nice feature would be to set the buffers that pop up when you for example delete a resource, to be read-only mode.
PS: This post was posted a bit earlier today, but wanted to make some more research before I posted, so ended up deleting it right after. |
Maybe something for a new issue, but So adding A compromise may be to turn on |
press
q
to exit from any resource details buffer that is created whenenter
is pressed.Essentially running
quit-window
orkill-buffer
The text was updated successfully, but these errors were encountered: