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

Make vterm option in kubel-exec-pod opt-in #100

Merged
merged 2 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ Get it from Melpa, or copy and load the `kubel.el` file.
If you want to have the evil compatibility package, get it from Melpa as well or
load the `kubel-evil.el` file.

# Setup

```elisp
(require 'kubel)
(kubel-vterm-setup) ; If you wish to have vterm as an option when using exec
```

Or if one uses `use-package`

```elisp
(use-package kubel
:after (vterm)
:config (kubel-vterm-setup))
```

## Usage

To list the pods in your current context and namespace, call
Expand Down
9 changes: 7 additions & 2 deletions kubel.el
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,6 @@ P can be a single number or a localhost:container port pair."

(defun kubel-exec-vterm-pod ()
"Exec into the pod under the cursor -> vterm."
(require 'vterm)
(interactive)
(kubel-setup-tramp)
(let* ((dir-prefix (kubel--dir-prefix))
Expand All @@ -1018,6 +1017,13 @@ P can be a single number or a localhost:container port pair."
(vterm-shell "/bin/sh"))
(vterm)))

;;;###autoload
(defun kubel-vterm-setup ()
"Adds a vterm enty to the KUBEL-EXEC-POP."
(require 'vterm)
(transient-append-suffix 'kubel-exec-popup "e"
'("v" "Vterm" kubel-exec-vterm-pod)))

(defun kubel-exec-ansi-term-pod ()
"Exec into the pod under the cursor -> `ansi-term'."
(interactive)
Expand Down Expand Up @@ -1179,7 +1185,6 @@ RESET is to be called if the search is nil after the first attempt."
("!" "Shell command" kubel-exec-pod-by-shell-command)
("d" "Dired" kubel-exec-pod)
("e" "Eshell" kubel-exec-eshell-pod)
("v" "Vterm" kubel-exec-vterm-pod)
("a" "Ansi-term" kubel-exec-ansi-term-pod)
("s" "Shell" kubel-exec-shell-pod)])

Expand Down