Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A function that can toggle between term-char-mode and term-line-mode submodes?

Tags:

emacs

elisp

In term.el, we can change from one submode to another. But, is there a way to toggle between them with one function (and one key-binding)?

Another question: Is there a way to mark text with keyboard in term-char-mode?

like image 793
functional_overflow Avatar asked May 02 '13 15:05

functional_overflow


1 Answers

First, one should ask a single question in a single SO posting.

Second, there is no toggle function in term.el but you can add one yourself:

(defun term-toggle-mode ()
  (interactive)
  (if (term-in-line-mode) 
      (term-char-mode)
      (term-line-mode)))
(define-key term-mode-map "\C-c\C-t" 'term-toggle-mode)

You can see other term keymaps using C-h a term.*map RET and add define-key forms for them too.

Third, use the cua library to select text with keyboard.

like image 103
sds Avatar answered Nov 15 '22 05:11

sds