From cc2dc076d8015152b64ebb83c7bd07fb2cf70912 Mon Sep 17 00:00:00 2001 From: Matthew Kosarek Date: Sat, 15 Oct 2022 19:44:49 -0400 Subject: Adding vterm and a toggle function --- init.el | 6 +++--- lisp/general.el | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/init.el b/init.el index 8c7cda5..56bf349 100644 --- a/init.el +++ b/init.el @@ -14,7 +14,7 @@ (setq package-list - '(good-scroll counsel smartparens xref-js2 eglot json-mode markdown-mode emojify tern rtags cmake-ide cmake-mode tide auctex evil js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org neotree)) + '(good-scroll counsel smartparens xref-js2 eglot json-mode markdown-mode emojify tern rtags cmake-ide cmake-mode tide auctex evil js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org neotree minimap vterm vterm-toggle)) ;; Fetch the list of packages available (unless package-archive-contents @@ -58,11 +58,11 @@ ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(custom-safe-themes - '("5859f61b502aa335b502b231c86a051210cb5974f74966e620c31be3a966659f" "32a9fa0f3722e679ed77a28aed3ae99161ef54dc27c35fd19e68e0410633960b" default)) + '("5859f61b502aa335b502b231c86a051210cb5974f74966e620c31be3a966659f" "32a9fa0f3722e679ed77a28aed3ae99161ef54dc27c35fd19e68e0410633960b" default)) '(org-agenda-files (list org-directory)) '(org-directory "~/Documents/org") '(package-selected-packages - '(neotree good-scroll counsel ## smartparens xref-js2 eglot json-mode markdown-mode emojify tern rtags cmake-ide cmake-mode tide auctex evil js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org))) + '(vterm-toggle vterm minimap neotree good-scroll counsel ## smartparens xref-js2 eglot json-mode markdown-mode emojify tern rtags cmake-ide cmake-mode tide auctex evil js2-highlight-vars ac-js2 js2-refactor js2-mode flycheck-irony company-irony all-the-icons req-package projectile irony org))) ;;; init.el ends here (custom-set-faces diff --git a/lisp/general.el b/lisp/general.el index 00c0a76..89c60b4 100644 --- a/lisp/general.el +++ b/lisp/general.el @@ -164,5 +164,25 @@ ) +;; Vterm +(require 'vterm) +(require 'vterm-toggle) +(setq vterm-toggle-fullscreen-p nil) +(add-to-list 'display-buffer-alist + '((lambda (buffer-or-name _) + (let ((buffer (get-buffer buffer-or-name))) + (with-current-buffer buffer + (or (equal major-mode 'vterm-mode) + (string-prefix-p vterm-buffer-name (buffer-name buffer)))))) + (display-buffer-reuse-window display-buffer-at-bottom) + ;;(display-buffer-reuse-window display-buffer-in-direction) + ;;display-buffer-in-direction/direction/dedicated is added in emacs27 + ;;(direction . bottom) + ;;(dedicated . t) ;dedicated is supported in emacs27 + (reusable-frames . visible) + (window-height . 0.3))) +(bind-key* (kbd "M-t") 'vterm-toggle) + + (provide 'general) ;;; general.el ends here -- cgit v1.2.1