First commit.
This commit is contained in:
31
lisp/utilities/term.el
Normal file
31
lisp/utilities/term.el
Normal file
@@ -0,0 +1,31 @@
|
||||
;;; term.el --- Initialize the Emacs terminal -*- lexical-binding: t; -*-
|
||||
;;; Commentary: A terminal in Emacs
|
||||
;;; Code: Cross-referencing commands
|
||||
|
||||
(defun user--term-mode-hook ()
|
||||
"Term mode hook."
|
||||
(user--shell-mode-common-hook))
|
||||
|
||||
|
||||
(defun user--term-exec-hook ()
|
||||
"Term startup hook."
|
||||
;; Automatically close buffer when finished.
|
||||
(let* ((buf (current-buffer))
|
||||
(proc (get-buffer-process buf)))
|
||||
(set-process-sentinel
|
||||
proc
|
||||
`(lambda (process event)
|
||||
(if (string= event "finished\n")
|
||||
(kill-buffer ,buf))))))
|
||||
|
||||
(use-package term
|
||||
:defer
|
||||
:init
|
||||
(add-hook 'term-exec-hook 'user--term-exec-hook)
|
||||
(add-hook 'term-mode-hook 'user--term-mode-hook)
|
||||
:config
|
||||
(define-key term-raw-map (kbd "C-c C-y") 'term-paste))
|
||||
|
||||
|
||||
(provide 'utilities/term)
|
||||
;;; term.el ends here
|
Reference in New Issue
Block a user