aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Benencia <id@rbenencia.name>2023-07-29 10:13:58 -0700
committerRaúl Benencia <id@rbenencia.name>2023-07-29 10:13:58 -0700
commitc8b9bb82012b00c0c1c498fedbb2aa4a85eeab8c (patch)
treeac7814fa229823529308e1e55c88e1a48f5e4ffa
parent075a3e48bcd35fd7fda212e92ca724506b2b5715 (diff)
emacs: vterm tweaks
-rw-r--r--.emacs.d/rul-init.d/vterm.el43
1 files changed, 18 insertions, 25 deletions
diff --git a/.emacs.d/rul-init.d/vterm.el b/.emacs.d/rul-init.d/vterm.el
index 28c54e9..4d752a1 100644
--- a/.emacs.d/rul-init.d/vterm.el
+++ b/.emacs.d/rul-init.d/vterm.el
@@ -1,36 +1,26 @@
(use-package multi-vterm
:ensure t
:config
-(setq
- vterm-max-scrollback 100000
-)
-(defvar vterm-source
+(setq vterm-source
`(:name "VTerm Buffer"
- :category 'buffer
- :narrow ?t
- :face 'consult-buffer
- :history 'buffer-name-history
- :state #'consult--buffer-state
- :new
- (lambda (name)
- (with-current-buffer (get-buffer-create name)
- (insert "#+title: " name "\n\n")
- (vterm)
- (consult--buffer-action (current-buffer))))
- :items
- (lambda ()
- (mapcar #'buffer-name
- (seq-filter
- (lambda (x)
- (eq (buffer-local-value 'major-mode x) 'vterm-mode))
- (buffer-list))))))
-
-(add-to-list 'consult-buffer-sources 'vterm-source 'append)
+ :category 'buffer
+ :narrow ?t
+ :face 'consult-buffer
+ :action ,#'consult--buffer-action
+ :items
+ (lambda ()
+ (mapcar #'buffer-name
+ (seq-filter
+ (lambda (x)
+ (eq (buffer-local-value 'major-mode x) 'vterm-mode))
+ (buffer-list))))))
(setq consult-vterm-buffer-sources
(list
- `(:hidden nil :narrow ?v ,@vterm-source)))
+ `(:hidden nil :narrow ?t ,@vterm-source)))
+
+(setq vterm-max-scrollback 100000)
(defun consult-vterm-buffer ()
"Switch to a vterm buffer"
@@ -38,4 +28,7 @@
(consult-buffer consult-vterm-buffer-sources))
(bind-key "C-x b" 'consult-vterm-buffer vterm-mode-map)
+
+(add-to-list 'consult-buffer-sources 'vterm-source 'append)
+(add-hook 'vterm-mode-hook 'goto-address-mode)
)
nihil fit ex nihilo