emacs-libvterm
emacs-libvterm copied to clipboard
Is it possible for vterm to recognize `compilation-error-regexp-alist`?
Would be great if I could get highlighting on error lines within vterm. I use the compilation buffer currently, but I think vterm might be faster because I have a lot of text (1000s of lines) being output from the compilation process.
I've never used this feature myself, but vterm
has some support for being a compilation buffer. I know it's there (we have functions like vterm--compilation-setup
, vterm-next-error-function
, ...), but I cannot direct you on how to use this.
And if you want to simply highlight something, you can switch to vterm-copy-mode
and use any function that highlights the words you want (e.g., the built in highlight-regexp
).
I think compilation-shell-minor-mode
works with vterm
. To initialise this automatically for every vterm buffer, this seems to work for me:
(use-package vterm
:ensure t
:hook (vterm-mode . compilation-shell-minor-mode))
That mode sets up a few bindings (in compilation-shell-minor-mode-map
), like:
(define-key map "\M-\C-m" 'compile-goto-error)
(define-key map "\M-\C-n" 'compilation-next-error)
(define-key map "\M-\C-p" 'compilation-previous-error)
(define-key map "\M-{" 'compilation-previous-file)
(define-key map "\M-}" 'compilation-next-file)