Giter Club home page Giter Club logo

vterm-toggle's Introduction

MELPA

vterm-toggle Toggle vterm buffer

emacs-libvterm is fully-fledged terminal emulator inside GNU Emacs based on libvterm.

This package provides the command vterm-toggle which toggles between the vterm buffer and whatever buffer you are editing.

This is done in an "intelligent" way. Features are:

  1. Starts a vterm if none is existent.
  2. Minimum distortion of your window configuration.
  3. When done in the vterm-buffer you are returned to the same window configuration you had before you toggled to the shell.
  4. If you desire, you automagically get a cd command in the shell to the directory where your current buffers file exists, just call vterm-toggle-cd instead of vterm-toggle.
(global-set-key [f2] 'vterm-toggle)
(global-set-key [C-f2] 'vterm-toggle-cd)

;; you can cd to the directory where your previous buffer file exists
;; after you have toggle to the vterm buffer with `vterm-toggle'.
(define-key vterm-mode-map [(control return)]   #'vterm-toggle-insert-cd)

;Switch to next vterm buffer
(define-key vterm-mode-map (kbd "s-n")   'vterm-toggle-forward)
;Switch to previous vterm buffer
(define-key vterm-mode-map (kbd "s-p")   'vterm-toggle-backward)

Customize

vterm-toggle-cd-auto-create-buffer

With

(setq vterm-toggle-cd-auto-create-buffer nil)

vterm-toggle-cd would activate a recent vterm buffer even if no prompt can be found (with vterm-toggle-use-dedicated-buffer still nil). So when the current buffer is not a vterm buffer, it would always activate a recent vterm buffer if there is one but would only insert cd if the prompt is available. And you can bind

(define-key vterm-mode-map [(control return)]   #'vterm-toggle-insert-cd)

vterm-toggle-reset-window-configration-after-exit

t Reset window configuration after vterm buffer is killed. 'kill-window-only Kill Window only.

vterm-toggle-hide-method

  1. delete-window Delete vterm window
  2. nil Toggle without closing the vterm window, just jump back-and-forth between vterm and a code buffer.
  3. reset-window-configration Reset window configration

show vterm buffer in current window

(setq vterm-toggle-fullscreen-p nil)
(add-to-list 'display-buffer-alist
             '((lambda (buffer-or-name _)
                   (let ((buffer (get-buffer buffer-or-name)))
                     (with-current-buffer buffer
                       (or (equal major-mode 'vterm-mode)
                           (string-prefix-p vterm-buffer-name (buffer-name buffer))))))
         (display-buffer-reuse-window display-buffer-same-window)))


show vterm buffer in bottom side

(setq vterm-toggle-fullscreen-p nil)
(add-to-list 'display-buffer-alist
             '((lambda (buffer-or-name _)
                   (let ((buffer (get-buffer buffer-or-name)))
                     (with-current-buffer buffer
                       (or (equal major-mode 'vterm-mode)
                           (string-prefix-p vterm-buffer-name (buffer-name buffer))))))
                (display-buffer-reuse-window display-buffer-at-bottom)
                ;;(display-buffer-reuse-window display-buffer-in-direction)
                ;;display-buffer-in-direction/direction/dedicated is added in emacs27
                ;;(direction . bottom)
                ;;(dedicated . t) ;dedicated is supported in emacs27
                (reusable-frames . visible)
                (window-height . 0.3)))

show vterm buffer in side window

If you want show vterm buffer at bottom side window:

(setq vterm-toggle-fullscreen-p nil)
(add-to-list 'display-buffer-alist
             '((lambda (buffer-or-name _)
                   (let ((buffer (get-buffer buffer-or-name)))
                     (with-current-buffer buffer
                       (or (equal major-mode 'vterm-mode)
                           (string-prefix-p vterm-buffer-name (buffer-name buffer))))))
               (display-buffer-reuse-window display-buffer-in-side-window)
               (side . bottom)
               ;;(dedicated . t) ;dedicated is supported in emacs27
               (reusable-frames . visible)
               (window-height . 0.3)))

work with centaur-tabs (select next/prev vterm buffer)

https://github.com/ema2159/centaur-tabs/

You can customize centaur-tabs and make all vterm buffer in a tab group, and use centaur-tabs-forward and centaur-tabs-backward switch from one vterm buffer to another.

(global-set-key  (kbd "s-n") 'centaur-tabs-forward)
(global-set-key  (kbd "s-p") 'centaur-tabs-backward)
(setq centaur-tabs-buffer-groups-function 'vmacs-awesome-tab-buffer-groups)
(defun vmacs-awesome-tab-buffer-groups ()
  "`vmacs-awesome-tab-buffer-groups' control buffers' group rules. "
  (list
   (cond
    ((derived-mode-p 'eshell-mode 'term-mode 'shell-mode 'vterm-mode)
     "Term")
    ((string-match-p (rx (or
                          "\*Helm"
                          "\*helm"
                          "\*tramp"
                          "\*Completions\*"
                          "\*sdcv\*"
                          "\*Messages\*"
                          "\*Ido Completions\*"
                          ))
                     (buffer-name))
     "Emacs")
    (t "Common"))))

(setq vterm-toggle--vterm-buffer-p-function 'vmacs-term-mode-p)
(defun vmacs-term-mode-p(&optional args)
  (derived-mode-p 'eshell-mode 'term-mode 'shell-mode 'vterm-mode))

vterm-toggle-use-dedicated-buffer

When vterm-toggle-use-dedicated-buffer is not nil, you can toggle to a dedicated vterm buffer.

you can toggle to different dedicated buffer for different purpose. For example, I want to replace default compile with my vterm-compile

(defvar vterm-compile-dedicated-buffer nil)
(defun vterm-compile ()
  (interactive)
  (let ((vterm-toggle-use-dedicated-buffer t)
        (vterm-toggle--vterm-dedicated-buffer vterm-compile-dedicated-buffer))
    (with-current-buffer (vterm-toggle-cd)
      (setq vterm-compile-dedicated-buffer (current-buffer))
      (rename-buffer "term compile")
      (compilation-shell-minor-mode 1)
      (vterm-send-string compile-command t)
      (vterm-send-return))
    )
  )

vterm-toggle's People

Contributors

jixiuf avatar manuel-uberti avatar opsnull avatar prongq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vterm-toggle's Issues

How to create a second vterm

I use vterm-toggle to create a vterm window and then later to switch to it. This works great! :-)

However, how can I create an independent second vterm window - and then late switch to it?

Issue defining autoloads

Hi:

After a fresh installation with use-package I am getting this message:

command-execute: Autoloading file /home/XXX/.emacs.d/elpa/vterm-toggle-20210130.1149/vterm-toggle.elc failed to define function vterm-toggle-cd

when I reinstall the package the problem seems to do away, but every time vterm is updated the problem comes back.

Feature: toggle if visible and not active

Many times I toggle the terminal, run commands and copy some output then paste it into a different buffer, at this point I don't need the term anymore so hitting to toggle it gives me the focus of the terminal window so I have to hit again to hide it.

Would it be possible to add a variable to allow this behavior? If the window is visible (active or inactive) should hide it.

Thanks.

Is it possible to include toggling behavior based on if vterm is currently running a foreground process?

Is there is a function to check whether the vterm buffer is currently in its prompt state and not running some foreground process?


With this one could do cool things like:

Let's call this new defun (vterm-active-toggle) (just a dummy name) for an demonstration:

  1. Launch Emacs with no open vterm buffers
  2. Invoke (vterm-active-toggle) which would open a new vterm
  3. Run a long running command (let's use sleep 300 as an example)
  4. When vterm is the currently active buffer, (vterm-active-toggle) should check if there is a foreground process running in the current vterm. If yes, it would just hide the buffer. If not, it should kill the vterm because it is idling (to clear up buffer names). In this case because of sleep 300s, it just hides vterm
  5. Invoking (vterm-active-toggle) would see that the first vterm buffer is still busy running something, so it would just create a new vterm buffer
  6. Without anything entered here in this new vterm, invoking (vterm-active-toggle) would just kill this vterm buffer because nothing is running in the foreground

Do you think something like this is realistic to implement?
Not sure if it would require changes to emacs-libvterm?

I think if there is such a defun to detect the state of vterm, I could actually code it myself. The toggling is really the easy part here.


I already checked with (vterm-next-prompt) and similar defuns from vterm, but even when a process is already running, it just goes to the bottom of the prompt which is not helpful in detecting this. Not sure if I just missed something.

vterm-toggle-insert-cd does not work first time vterm opens

Hello,

Thanks for creating this awesome package! It has been really useful for my workflow. I just have one feature request (unfortunately my elisp skills are not sufficient to make a PR...):

When I try to invoke vterm-toggle-insert-cd the first time a vterm terminal is created via vterm-toggle, it doesn't do anything. If my understanding of the code is correct, it is because vterm-toggle-cd--cmd has not been set yet at this point. I can only use vterm-toggle-insert-cd if I do vterm-toggle (creates new vterm) -> vterm-toggle (hides vterm) -> vterm-toggle (show vterm again) -> vterm-toggle-insert-cd.

I guess for most people this is trivial, as the first time a vterm terminal is created will already be in the folder of the previous buffer. However, I am using vterm-toggle with vterm-toggle-scope set to project, hence my created vterms will be in the project root (which is what I generally want). I just want to be able to jump to the subfolder containing the file of the previous buffer via vterm-toggle-insert-cd.

Many thanks for your time and effort!

Vterm not opening on the bottom.

I added the code from the README for showing vterm buffer in bottom side, but whenever I run vterm-toggle it always opens on the right.

Here is my vterm configuration,

  (use-package vterm
    :straight t
    :commands vterm
    :config
    (setq vterm-max-scrollback 10000))
  (use-package vterm-toggle
    :straight t
    :custom
    (vterm-toggle-reset-window-configration-after-exit t))
  (setq vterm-toggle-fullscreen-p nil)
  (add-to-list 'display-buffer-alist
               '((lambda(bufname _) (with-current-buffer bufname (equal major-mode 'vterm-mode)))
                 (display-buffer-reuse-window display-buffer-at-bottom)
                 ;;(display-buffer-reuse-window display-buffer-in-direction)
                 ;;display-buffer-in-direction/direction/dedicated is added in emacs27
                 ;;(direction . bottom)
                 ;;(dedicated . t) ;dedicated is supported in emacs27
                 (reusable-frames . visible)
                 (window-height . 0.3)))

What am I doing wrong here?

Windows accumulating in vterm group

Hello ! :)

Thanks for the wonderful project , it's helping me a lot !

But I often find myself full of unnecessary buffers in the same vterm group, as you can see below:

unnecessary-buffers

I'm using emacs 27.2 and my current config for centaur-tabs buffer groups and vterm-toggle are:

    (defun centaur-tabs-buffer-groups ()
      "`centaur-tabs-buffer-groups' control buffers' group rules.
 Group centaur-tabs with mode if buffer is derived from `eshell-mode' `emacs-lisp-mode' `dired-mode' `org-mode' `magit-mode'.
 All buffer name start with * will group to \"Emacs\".
 Other buffer group by `centaur-tabs-get-group-name' with project name."
      (list
       (cond
        ((or (string-equal "*" (substring (buffer-name) 0 1))
             (memq major-mode '(magit-process-mode
                                magit-status-mode
                                magit-diff-mode
                                magit-log-mode
                                magit-file-mode
                                magit-blob-mode
                                magit-blame-mode
                                )))
         "Emacs")
        ((derived-mode-p 'prog-mode)
         "Editing")
        ((derived-mode-p 'emacs-lisp-mode)
         "Elisp")
        ((derived-mode-p 'dired-mode)
         "Dired")
        ((memq major-mode '(helpful-mode
                            help-mode))
         "Help")
        ((memq major-mode '(org-mode
                            org-agenda-clockreport-mode
                            org-src-mode
                            org-agenda-mode
                            org-beamer-mode
                            org-indent-mode
                            org-bullets-mode
                            org-cdlatex-mode
                            org-agenda-log-mode
                            diary-mode))
         "OrgMode")
        (t
         (centaur-tabs-get-group-name (current-buffer))))))
  (use-package vterm-toggle
    :after vterm
    :config
    (global-set-key [f2] 'vterm-toggle)
    (global-set-key [C-f2] 'vterm-toggle-cd)
    (define-key vterm-mode-map [(control return)]   #'vterm-toggle-insert-cd)
    (define-key vterm-mode-map (kbd "s-n") 'vterm-toggle-forward) ;Switch to next vterm buffer
    (define-key vterm-mode-map (kbd "s-p") 'vterm-toggle-backward) ;Switch to previous vterm buffer

    (setq vterm-toggle-cd-auto-create-buffer nil)

    (defun myssh()
      (interactive)
      (let ((default-directory "/ssh:root@host:~"))
        (vterm-toggle-cd)))

    (setq vterm-toggle-fullscreen-p nil)
    (add-to-list 'display-buffer-alist
                 '((lambda(bufname _) (with-current-buffer bufname (equal major-mode 'vterm-mode)))
                   (display-buffer-reuse-window display-buffer-in-side-window)
                   (side . bottom)
                   (dedicated . t) ;dedicated is supported in emacs27
                   (reusable-frames . visible)
                   (window-height . 0.3)))

    (setq centaur-tabs-buffer-groups-function 'vmacs-awesome-tab-buffer-groups)
    (defun vmacs-awesome-tab-buffer-groups ()
      "`vmacs-awesome-tab-buffer-groups' control buffers' group rules. "
      (list
       (cond
        ((derived-mode-p 'eshell-mode 'term-mode 'shell-mode 'vterm-mode)
         "Term")
        ((string-match-p (rx (or
                              "\*Helm"
                              "\*helm"
                              "\*tramp"
                              "\*Completions\*"
                              "\*sdcv\*"
                              "\*Messages\*"
                              "\*Ido Completions\*"
                              ))
                         (buffer-name))
         "Emacs")
        (t "Common"))))

    (setq vterm-toggle--vterm-buffer-p-function 'vmacs-term-mode-p)
    (defun vmacs-term-mode-p(&optional args)
      (derived-mode-p 'eshell-mode 'term-mode 'shell-mode 'vterm-mode)))

For some reason the vterm group is included in the default centaur-tabs * group, along with lsp's auxiliary buffers.
I tried a few things without success :/.

Do you think there might be something wrong with my configuration or some bug?

vterm-toggle-cd improvements

Hello,

I discovered vterm-toggle-cd handles TRAMP! Nice work 👍

Here are a few use cases that are not handled correctly:

  • Using another port (syntax user@host#port) translates to ssh user@host:port when it'd be ssh -p port user@host
  • Using docker-tramp (https://github.com/emacs-pe/docker-tramp.el) but that's probably asking for too much :-)

Option for vterm-toggle-cd to always activate existing vterm buffer

It would be nice if there was a different command or an option for vterm-toggle-cd that would activate a recent vterm buffer even if no prompt can be found (with vterm-toggle-use-dedicated-buffer still nil). So when the current buffer is not a vterm buffer, it would always activate a recent vterm buffer if there is one but would only insert cd if the prompt is available.

Sometimes it's nice to get a new terminal if I have something running in the old one, but I'd rather have another keybinding to use in that case.

Unused lexical variables and/or functions

Greetings,

There appear to be a few unused lexical variables and/or functions in vterm-toggle.el.

Using the Elpaca package manager to byte-compile and thus install the package, I get this warning in the Elpaca Log:

vterm-toggle                   byte-compilation     vterm-toggle.el:229:56: Warning: Unused lexical variable `cur-port'              10.006751

@progfolio has showed me a few warnings they received during byte compilation (see progfolio/elpaca#182 (comment)):

vterm-toggle.el:211:2: Warning: docstring has wrong usage of unescaped single quotes (use \=' or different quoting such as `...') 185.809374
vterm-toggle.el:229:47: Warning: Unused lexical variable ‘cur-user’              185.810434
vterm-toggle.el:229:56: Warning: Unused lexical variable ‘cur-port’              185.819951
vterm-toggle.el:395:15: Warning: the function ‘project-roots’ is not known to be defined. 185.839441

Would you please look into this?

Thank you in advance!

Pressing u in meow modal keybinding normal mode toggles vterm

When I try to set toggle keybinding to ctrl+/, vterm toggles unexpectedly when I press u key while using meow modal editing mode for emacs. However it doesn't happen in evil mode.

When I set key bindings to other combination u key works as expected for undo. For eg: ctrl+,

(use-package vterm-toggle
  :ensure t)
(global-set-key (kbd "C-/") 'vterm-toggle)

Vterm-toggle doesn't create new vterm instance when in another project, but rather reuses old vterm instance

As titled, suppose I have created a vterm buffer associated with Project1. I later switch to Project2 and invoke vterm-toggle. The expected behavior (or at least the old behavior before the last couple of updates) is to create a dedicated new vterm for Project2. When I switch back to Project1 and invoke vterm-toggle there, the first vterm should pop up.
However, now I seem to ever only be able to have one vterm instance. No matter which project I'm in, invoking vterm-toggle gives me the first (and only) vterm instance. (It refuses to create a new one)

We used to have the expected behavior... did some latest update change accidentally change this?

Anyhow, I truly appreciate your work on this package. IMO a must-have to go alongside emacs-libvterm!!

P.s. The following is my config:

(use-package vterm-toggle
  :after (projectile vterm)
  :config
  (setq vterm-toggle-fullscreen-p nil)
  (setq vterm-toggle-scope 'project)
  (global-set-key (kbd "C-`") #'vterm-toggle)
  (add-to-list 'display-buffer-alist
               '((lambda (bufname _) (with-current-buffer bufname (equal major-mode 'vterm-mode)))
                 (display-buffer-reuse-window display-buffer-at-bottom)
                 (reusable-frames . visible)
                 (window-height . 0.7))))

`vterm-toggle-cd` not inserting CD command

Maybe this is me not understanding how the package works, but when I invoke vterm-toggle-cd I expect it to bring up a vterm buffer and cd to the location of the last active buffer.

Instead, calling that function inserts ^K into the vterm buffer, like so
Screen Shot 2020-07-09 at 12 38 24 PM

after this, manually calling vterm-toggle-insert-cd manually works correctly, but my understanding is that vterm-toggle-cd should be exactly equivalent to manually invokingvterm-toggle and then vterm-toggle-insert-cd - for me it's not.

Am I missing something?

vterm-toggle open remote terminal error: tcsetattr: Interrupted system call

zj@zj-pc16:~$ ssh -l root -p 52129  -e none 10.67.27.224
 cd /root/code/test
Last login: Thu Mar 25 16:53:31 2021 from 10.129.250.1

Happy Hacking!

Last Generated motd: Mon Apr  9 16:32:33 CST 2012

tcsetattr: Interrupted system call
 cd /root/code/test
[root@e22h01006 ~]$   cd /root/code/test
[root@e22h01006 test]$ ls
ls
test.go

The terminal function is abnormal, and there is an echo when executing the command, such as the above ls, the command line editing, history record and other functions are not available.

I execute ssh -l root -p 52129 -e none 10.67.27.224 manually,everything work normally.

I'm using the master branch vterm-toggle code.

Issue with (vterm-toggle-scope 'projectile)

Hi:

When I set this (vterm-toggle-scope 'projectile) option vterm-toggle and vterm-toggle-cd creates a new vterm buffer every time it is called if the current file is not in a project. Even if it is the same file. IMO the expected behavior if there is not project for the current file the behavior must be the same than when it is nil right? not create a new shell everytime... but check if there is one already for the current file/path.

Is this intended?

BTW: Maybe vterm-toggle should consider to use the internal project api if available instead of depending on external projectile?

How to open two vterm in same vterm-toggle buffer?

Hello,

Thank you for making vterm-toggle. I've got a problem when i do two tasks in a terminal. As i 've bound vterm-toggle like
(define-key vterm-mode-map (kbd "C-x t v") 'vterm-toggle)

but i'm unable to open two or more terminal. Like that vscode does.

Is there any way?

As i said, i want toggling in same vterm buffer not other buffer, so that i'll be just internal togging two vterm buffers in just some key stroke

Thank you for helping.

Consider projectile integration?

Thanks for the awesome package! I've been really enjoying using it. I also appreciate the intelligence of vterm-toggle-cd and vterm-toggle-cd-auto-create-buffer.

I have a proposal that I think you might be highly interested in:

Proposal

Oftentimes Emacs users have separated "projects" open at the same time. (Using projectile to manage each project is really a breeze, especially commands like projectile-find-file can limit the scope and fuzzy search files only in the current project). I think it'd be brilliant if we can somehow get vterm-toggle to "recognize" the current project we're in, and decide "whether or not" to create a new vterm instance, or instead re-use an existing vterm buffer that's within the project scope.

Let me know if something is unclear. I wish my Emacs Lisp skills are good enough that I could provide a PR, but truth is at this stage I can only raise suggestions.

Restart vterm in `vterm-toggle-cd` if vterm process has exited

Currently vterm-toggle-cd will start vterm when the first time it is called. But if the process exited by C-d or exit RET, calling vterm-toggle-cd will only pop the vterm buffer, without restarting the process. I will this feature maybe helpful.

Emacs for python development on remote servers

谢谢你解决了我在远程编辑文件时的一个痛点!
不过我还有两个小问题想请教一下您:

  1. python development:
    我现在用的是elpy来提供一些IDE features. 但是我在tramp编辑远程文件时, elpy的rpc进程无法识别远程环境(elpy作者已经表示无法提供这个feature). 您有什么解决方案吗? anaconda-mode我也试过, 同样无法让server跑在远程服务器上.
  2. better terminal in emacs:
    vterm 目前感觉比emacs term/ansi-term要好一些, 但是还是有一些terminal中的feature 无法模拟:
    我在iterm2中使用了fzf来模糊搜索, 但是在vterm buffer中, 使用fzf 出来的candidate 画面没法看.

exit term is not killing the window

Hi:

When in a toggled vterm if I insert exit the terminal finishes, but the window is not killed (like in multi-term for example).

I tried vterm-toggle-reset-window-configration-after-exit but is resets the configuration to the initial configuration when the vterm window was toggled on or created.

Is it possible to add an option to kill the window if I do an exit? OR add an special value for vterm-toggle-reset-window-configration-after-exit? something like 'kill-window-only or so?

Support multiple hopes

Hello,

Thank you for the work done on this project.

A one additional feature could be to support multiple hope.

When editing file with ssh and sudo combined like this :

/ssh:user@host|sudo:root@host:/home/user/file

vterm-toggle-cd only try to run the sudo command and doesn't make the ssh command :

$ sudo -u root -s -H -p P""a""s""s""w""o""r""d"":
Password:
Sorry, try again.
Password:

Don't force Projectile as a required dependency

I don't use Projectile, relying instead on the project.el built-in.
It should be an optional dependency for vterm-toggle, via fboundp or checks for the package being installed before trying to use it.

Usage with straight.el

Hi,

Do you have a working configuration with using the straight.el package manager? I have this config currently and I have numerous problems with not being able to use or import vterm since vterm-toggle uses the same directory.

(use-package vterm
  :straight (:post-build (let ((vterm-always-compile-module t))
                           (require 'vterm)))
  :bind (("C-c v" . vterm)
         :map vterm-mode-map
         ("C-g" . vterm--self-insert))
  )

(use-package vterm-toggle
  :straight (vterm :type git :host github :repo "jixiuf/vterm-toggle")
  :custom
  (vterm-toggle-fullscreen-p nil)
  )

Problems include:

  • Recompiling vterm everytime emacs starts up
  • not being able to load vterm after vterm-toggle is loaded.
  • straight.el complaining that the vterm's local-repo is being overwritten by vterm-toggle.

Do you have any insight about this?

vterm-toggle doesn't kill buffer after exit

I'm following the instruction and have vterm opened in bottom window with

(setq vterm-toggle-fullscreen-p nil)
(add-to-list 'display-buffer-alist
             '((lambda(bufname _) (with-current-buffer bufname (equal major-mode 'vterm-mode)))
                (display-buffer-reuse-window display-buffer-at-bottom)
                ;;(display-buffer-reuse-window display-buffer-in-direction)
                ;;display-buffer-in-direction/direction/dedicated is added in emacs27
                ;;(direction . bottom)
                ;;(dedicated . t) ;dedicated is supported in emacs27
                (reusable-frames . visible)
                (window-height . 0.3)))

However, when I exit vterm, the buffer window still remains, I have to manually close that buffer and that is not what I want. I also add vterm-kill-buffer-on-exit but it has no effect.

Evil state switching suggestions

vterm-toggle--switch-evil-state should check whether evil mode is actually enabled not just if evil has been loaded (e.g. (bound-and-true-p evil-local-mode)). It would also be nice if there was a setting to disable this functionality (don't switch states when toggling).

Also, thanks for this package. vterm-toggle-cd is very convenient.

Option: switch back and forth

Similar ability like (eyebrowse-switch-back-and-forth t) which will go the the first vterm if nothing left in the last.

1 -> 2 -> 3 -> 1

So when vterm-toggle-forward invoked, it will go the 1 term when it reaches 3

Thank you for vterm-toggle.

Several commands no-op

In situations where intuitive behavior exists, these commands don't do anything:

vterm-toggle-backward
Several vterms are open. Expected this to toggle between them with some negative sort. If no vterm open, give me one.

vterm-toggle-forward
Several vterms are open. Expected this to toggle between them with some positive sort. If no vterm open, give me one.

vterm-insert-cd-show
Expected this command to switch to some available vterm buffer and then run cd to the directory of the file that I was editing. No observed behavior.

vterm-insert-cd
Expected this to do what cd-show does, but without necessarily showing me.

Seems to be a lot of missing behavior. Does it rely on vterms being opened by vterm-toggle? I don't know, but it won't integrate will with other vterm controls if it can't infer the open list of vterms and do something reasonable.

Function to switch to specific vterm buffer

It would be nice if in addition to vterm-toggle-forward and vterm-toggle-forward, there was a function that could be used to jump to vterm buffer with a specific number, creating it if it did not exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.