From: Eshel Yaron Date: Tue, 6 Aug 2024 15:47:33 +0000 (+0200) Subject: Add transient menu for help in resource list buffers X-Git-Tag: v0.3.1~1 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=22d26e327a82951bda69ca1370c94e0be2a91b85;p=kubed.git Add transient menu for help in resource list buffers * kubed-transient.el (kubed-list-transient): New transient. (kubed-list-mode-map): Bind it. * kubed.texi (Browse Resources): Document it. --- diff --git a/kubed-transient.el b/kubed-transient.el index 1c12d51..8f778ad 100644 --- a/kubed-transient.el +++ b/kubed-transient.el @@ -315,5 +315,37 @@ (transient-setup 'kubed-transient-create-job nil nil :scope '("create" "job"))) +;;;###autoload (autoload 'kubed-list-transient "kubed-transient" nil t) +(transient-define-prefix kubed-list-transient () + "Help for Kubernetes resource list buffers." + ["Kubernetes Resources:" + ["Select" + :pad-keys t + ("RET" "Select" kubed-list-select-resource) + ("C-o" "Display" kubed-list-display-resource :transient t) + ("e" "Edit" kubed-list-edit :transient t) + ("w" "Copy name" kubed-list-copy-as-kill :transient t)] + ["Delete" + ("D" "Delete" kubed-list-delete :transient t) + ("d" "Mark" kubed-list-mark-for-deletion :transient t) + ("u" "Unmark" kubed-list-unmark :transient t) + ("x" "Delete marked" kubed-list-delete-marked :transient t)] + ["Other" + ("!" "Command line" kubed-list-kubectl-command :transient t) + ("+" "Create" kubed-list-create :transient t) + ("/" "Filter" kubed-list-set-filter :transient t) + ("G" "Update" kubed-list-update :transient t)] + ["Table" + ("|" "Fit column" kubed-list-fit-column-width-to-content :transient t) + ("}" "Widen column" tabulated-list-widen-current-column :transient t) + ("{" "Narrow column" tabulated-list-narrow-current-column :transient t) + ("S" "Sort" tabulated-list-sort :transient t)] + ["Movement" + :pad-keys t + ("n" "Next line" next-line :transient t) + ("p" "Previous line" previous-line :transient t) + ("TAB" "Narrow column" kubed-list-next-column :transient t) + ("S-TAB" "Narrow column" kubed-list-previous-column :transient t)]]) + (provide 'kubed-transient) ;;; kubed-transient.el ends here diff --git a/kubed.el b/kubed.el index e575a93..3192c8a 100644 --- a/kubed.el +++ b/kubed.el @@ -837,6 +837,8 @@ number at point, or the numeric prefix argument if you provide one." (tabulated-list-print t) (tabulated-list-init-header)) +(declare-function kubed-list-transient "kubed-transient" ()) + (defvar-keymap kubed-list-mode-map :doc "Common keymap for Kubernetes resource list buffers." "RET" #'kubed-list-select-resource @@ -858,7 +860,8 @@ number at point, or the numeric prefix argument if you provide one." "C-S-i" #'kubed-list-previous-column "S-TAB" #'kubed-list-previous-column "" #'kubed-list-previous-column - "+" #'kubed-list-create) + "+" #'kubed-list-create + "?" #'kubed-list-transient) (defun kubed-list-entries () "`tabulated-list-entries' function for `kubed-list-mode'." diff --git a/kubed.texi b/kubed.texi index 3d0187f..295c470 100644 --- a/kubed.texi +++ b/kubed.texi @@ -306,6 +306,10 @@ This mode provides the following commands for all type-specific derived modes: @table @kbd +@kindex @key{?} +@findex kubed-list-transient +@item @key{?} +Show help in transient menu (@code{kubed-list-transient}). @kindex @key{RET} @findex kubed-list-select-resource @item @key{RET}