about summary refs log tree commit diff stats
path: root/lisp/+vterm.el
blob: 06c0028f28264f83883b9131ad2aa5278a0d46b1 (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