]> git.eshelyaron.com Git - kubed.git/commitdiff
Add transient menu for help in resource list buffers
authorEshel Yaron <me@eshelyaron.com>
Tue, 6 Aug 2024 15:47:33 +0000 (17:47 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 6 Aug 2024 16:07:03 +0000 (18:07 +0200)
* kubed-transient.el (kubed-list-transient): New transient.
(kubed-list-mode-map): Bind it.
* kubed.texi (Browse Resources): Document it.

kubed-transient.el
kubed.el
kubed.texi

index 1c12d510504df077ca45bb9e1496beccd4fcadea..8f778ad630fc583ff2b7e31e187ed090d212b9bc 100644 (file)
   (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
index e575a93379c01c713f4ad2450b74101d9f4a7e3c..3192c8aa923b9be07d895e53b01ca35a1eb17955 100644 (file)
--- 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
   "<backtab>" #'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'."
index 3d0187f1d1c6013f6ff3845d535e100d56d61c56..295c470fb45c2713d1599b79766914a80d1c645e 100644 (file)
@@ -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}