You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just figured I would put here this consult function for chatgpt-shell buffers I've been using,
it uses the process name to fetch all the chatgpt-shell buffers so no need to pattern match buffer names in case they're renamed (previously used llm to fetch them).
Im using doom emacs so no idea if it'll work for everyone.
(require'consult)
(defgroupconsult-chatgpt-shell-buffersnil"Navigate between LLM conversation buffers.":group'convenience:prefix"consult-chatgpt-shell-buffers-")
;;;###autoload
(defunconsult-chatgpt-shell-buffers ()
"Choose an LLM conversation buffer from a Consult menu.Lists buffers that have a process with 'chatgpt' in the name."
(interactive)
(let* ((llm-buffers
(cl-loopfor proc in (process-list)
;; Check if process name contains "chatgpt"when (and (string-match-p"chatgpt" (process-name proc))
(process-buffer proc)
(buffer-live-p (process-buffer proc)))
collect (process-buffer proc)))
(selected-buffer
(consult--read
(mapcar#'buffer-name llm-buffers)
:prompt"Select an LLM buffer: ":category'buffer:sortnil:require-matcht:state (consult--buffer-state))))
(when selected-buffer
(switch-to-buffer selected-buffer))))
The text was updated successfully, but these errors were encountered:
Neat! I have a more rudimentary approach of invoking my usual function to swap buffers and type "llm" to filter chat buffes. Thanks for sharing it. Have you considered using completing-read? It would enable folks using any completion framework.
Just figured I would put here this consult function for chatgpt-shell buffers I've been using,
it uses the process name to fetch all the chatgpt-shell buffers so no need to pattern match buffer names in case they're renamed (previously used llm to fetch them).
Im using doom emacs so no idea if it'll work for everyone.
The text was updated successfully, but these errors were encountered: