From 12f3e4b8d79650fed11279051e0ec951fc500c02 Mon Sep 17 00:00:00 2001 From: Amin Bandali Date: Tue, 11 Dec 2018 17:03:46 -0500 Subject: [PATCH 1/1] [emacs] assimilate and add multi-term --- .gitmodules | 3 +++ init.org | 39 ++++++++++++++++++++++++++++++++++++++- lib/multi-term | 1 + 3 files changed, 42 insertions(+), 1 deletion(-) create mode 160000 lib/multi-term diff --git a/.gitmodules b/.gitmodules index b752b3c..c40f84d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -206,6 +206,9 @@ # think the submodule is dirty. so, let's ignore the untracked # files of this submodule ignore = untracked +[submodule "multi-term"] + path = lib/multi-term + url = git@github.com:emacsorphanage/multi-term.git [submodule "mwim"] path = lib/mwim url = git@github.com:alezost/mwim.el.git diff --git a/init.org b/init.org index 44f31dc..1c69169 100644 --- a/init.org +++ b/init.org @@ -728,6 +728,7 @@ customizing it. ;; custom mode state mappings (dolist (mspair '((ebdb-mode . emacs) + (term-mode . emacs) (helpful-mode . motion) (view-mode . motion))) (evil-set-initial-state (car mspair) (cdr mspair))) @@ -797,6 +798,8 @@ customizing it. "a" '(:ignore t :wk "apps") "a i" 'ielm + "a s" '(:ignore t :wk "shells/terms") + "b" '(:ignore t :wk "buffers") "b k" 'kill-this-buffer "b s" 'save-buffer @@ -1840,7 +1843,7 @@ Emacs package that displays available keybindings in popup #+begin_src emacs-lisp (use-package shell-toggle :after eshell - :general (amin--leader-keys "a s" 'amin/shell-toggle) + :general (amin--leader-keys "a s e" 'amin/shell-toggle) :bind ("C-c e" . amin/shell-toggle) :config (defun amin/shell-toggle (make-cd) @@ -2111,6 +2114,40 @@ For when I /have to/ use GH. :after eshell) #+end_src +** multi-term + +#+begin_src emacs-lisp +(use-package multi-term + :defer 1 + :general (amin--leader-keys + "a s m" 'multi-term + "a s p" 'multi-term-dedicated-toggle) + :bind ("C-c C-j" . term-line-mode) + :config + (setq multi-term-program "/bin/screen" + ;; TODO: add separate bindings for connecting to existing + ;; session vs. always creating a new one + multi-term-dedicated-select-after-open-p t + multi-term-dedicated-window-height 20 + multi-term-dedicated-max-window-height 30 + term-bind-key-alist + '(("C-c C-c" . term-interrupt-subjob) + ("C-c C-e" . term-send-esc) + ("C-k" . kill-line) + ("C-y" . term-paste) + ("M-f" . term-send-forward-word) + ("M-b" . term-send-backward-word) + ("M-p" . term-send-up) + ("M-n" . term-send-down) + ("" . term-send-backward-kill-word) + ("" . term-send-backward-kill-word) + ("M-d" . term-send-delete-word) + ("M-," . term-send-raw) + ("M-." . comint-dynamic-complete)) + term-unbind-key-alist + '("C-z" "C-x" "C-c" "C-h" "C-y" ""))) +#+end_src + * Email #+begin_src emacs-lisp diff --git a/lib/multi-term b/lib/multi-term new file mode 160000 index 0000000..f954e4e --- /dev/null +++ b/lib/multi-term @@ -0,0 +1 @@ +Subproject commit f954e4e18b0a035151d34852387e724d87a3316f -- 2.20.1