Skip to content

Instantly share code, notes, and snippets.

@dmj111
Forked from ahyatt/gist:313104
Created February 24, 2013 13:44
Show Gist options
  • Save dmj111/5023904 to your computer and use it in GitHub Desktop.
Save dmj111/5023904 to your computer and use it in GitHub Desktop.
(defun ash-term-hooks ()
;; dabbrev-expand in term
(define-key term-raw-escape-map "/"
(lambda ()
(interactive)
(let ((beg (point)))
(dabbrev-expand nil)
(kill-region beg (point)))
(term-send-raw-string (substring-no-properties (current-kill 0)))))
;; yank in term (bound to C-c C-y)
(define-key term-raw-escape-map "\C-y"
(lambda ()
(interactive)
(term-send-raw-string (current-kill 0))))
(setq term-default-bg-color (face-background 'default))
(setq term-default-fg-color (face-foreground 'default)))
(add-hook 'term-mode-hook 'ash-term-hooks)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment