-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:AIChat without running assistant #147
Comments
Here's a function to reuse an aichat buffer. let g:aichat_scratch_buffer_name = ">>> AI chat"
function! ReuseChatBuffer()
if &filetype ==# 'aichat' | return | endif
" reuse some window of filetype Aichat in this tab
let buffer_list_window_tab = tabpagebuflist(tabpagenr())
let buffer_list_window_tab = filter(buffer_list_window_tab, 'getbufvar(v:val, "&filetype") ==# "aichat"')
if !empty(buffer_list_window_tab) | return win_gotoid(win_findbuf(buffer_list_window_tab[0])[0]) | endif
" reuse some window of filetype Aichat in any tab
let buffer_list_window = []
for i in range(tabpagenr('$'))
call extend(buffer_list_window, tabpagebuflist(i + 1))
endfor
let buffer_list_window = filter(buffer_list_window, 'getbufvar(v:val, "&filetype") ==# "aichat"')
if !empty(buffer_list_window) | return win_gotoid(win_findbuf(buffer_list_window[0])[0]) | endif
" reuse some buffer named >>> AIChat
if bufnr(g:aichat_scratch_buffer_name) >= 0
exe 'vertical belowright sbuffer' bufnr(g:scratch_buffer_name)
return
endif
" reuse some buffer of filetype Aichat
let buffer_list = map(getbufinfo(), 'v:val.bufnr')
let buffer_list = filter(buffer_list, 'getbufvar(v:val, "&filetype") ==# "aichat"')
if !empty(buffer_list)
exe 'vertical belowright sbuffer' buffer_list[0]
return
endif
endfunction |
I am quite confused what is this issue about.
there is no concept of assistant, what do you mean by that?
I don't get this too Could you try to explain again? |
How about running
:AIChat
without running the assistant if there are non-blank lines following the bottom-most>>> user
line, say by appending a bang!
to:AIChat
, to paste additional lines below it?The text was updated successfully, but these errors were encountered: