help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: vterm-module compile error


From: Emanuel Berg
Subject: Re: vterm-module compile error
Date: Sun, 01 Nov 2020 01:00:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis wrote:

>>>> But vterm has one weird thing that really bugs me... the
>>>> vterm-mode-map instantly and fully takes over your entire
>>>> keyboard! C-p is `previous-line', right? Wrong! Here it is
>>>> `vterm-send-C-p', and that does something else!
>>>
>>> [...]
>>>
>>> Of course it is customizable.
>> 
>> Can I have a vterm-can-I-have-my-keys-back-please please?
>
> C-p and C-n do history back and forth in M-x term and also in M-x
> vterm

That's a problem! And here is the (one) solution...

Check out the emacs-init directory for the other stuff if it fancies
you, otherwise just use the loop to get everyday Emacs keys back.
I think I'll be adding a couple of more to that list before I'm happy
with vterm.

;;; -*- lexical-binding: t -*-
;;;
;;; this file:
;;;   http://user.it.uu.se/~embe8573/emacs-init/term.el
;;;   https://dataswamp.org/~incal/emacs-init/term.el

(require 'super)
(require 'switch-to-buffer-regexp)
(require 'vterm)

(defun use-vterm (new)
  (interactive "P")
  (when (or new (not (switch-to-buffer-regexp "vterm")))
    (vterm) ))
(defalias 'vt #'use-vterm)

(let ((the-map vterm-mode-map)
      (keys '(
              "\C-a"
              "\C-e"
              "\C-n"
              "\C-p"
              )))
  (disable-super-global-keys the-map)
  (dolist (k keys)
    (define-key the-map k nil) )
  (define-key the-map "\C-\M-p" #'vterm-send-C-p)
  (define-key the-map "\C-\M-n" #'vterm-send-C-n) )

-- 
underground experts united
http://user.it.uu.se/~embe8573
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]