summary refs log tree commit diff stats
path: root/lisp/+vterm.el
blob: 66e226bb484bfb0bbc83ebc9b33b0519cde51517 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
;;; +vterm.el --- Vterm extras -*- lexical-binding: t; -*-

;;; Commentary:

;;; Code:

(require +vterm)

(defun +vterm-counsel-yank-pop-action (orig-fun &rest args)
  (if (equal major-mode 'vterm-mode)
      (let ((inhibit-read-only t)
            (yank-undo-function (lambda (_start _end) (vterm-undo))))
        (cl-letf (((symbol-function 'insert-for-yank)
                   (lambda (str) (vterm-send-string str t))))
          (apply orig-fun args)))
    (apply orig-fun args)))

(provide '+vterm)
;;; +vterm.el ends here