summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFiles
* docs: update README.mdIkko Eltociear Ashimine2024-09-121
| | | seleciton -> selection
* Merge pull request #113 from madox2/keep-open-mode-multiple-chatsMartin Bielik2024-09-112
|\ | | | | allow multiple chats in keep open mode
| * remove useless buffer in keep open modeMartin Bielik2024-07-291
| |
| * private MakeScratchWindow functionMartin Bielik2024-07-251
| |
| * switch to last created buffer in keep open modeMartin Bielik2024-07-241
| |
| * allow multiple chats in keep open modeMartin Bielik2024-07-232
|/
* fixes #110, python compatibility issue with escape sequenceMartin Bielik2024-06-111
|
* added abort flag to the plugin functionsMartin Bielik2024-06-091
|
* handle paste mode in finally blockMartin Bielik2024-06-091
|
* Merge pull request #108 from misterbuckley/fix-print-info-messageMartin Bielik2024-06-061
|\ | | | | Fix print_info_message <Esc> issue
| * Fix print_info_message <Esc> issueMichael Buckley2024-06-041
|/ | | | | | | | | | | | | | | | | | | | | I ran into an issue when first using this plugin where the print_info_message function wasn't working correctly due to vim misinterpreting the <Esc> sequence in `vim.command("normal \\<Esc>")` as a series of individual characters rather than a single literal Escape character. This resulted in the characters 'c>' being inserted into the active buffer at the cursor location because the 's' in '<Esc>' was being interpreted as a normal mode 's', causing it to enter insert mode, and none of the info messages were being echoed properly. This was frustrating as it was not easy to figure out why my commands weren't working initially (turns out I hadn't configured my billing plan correctly, d'oh). Fix this by using a more robust way of sending the <Esc> character to vim via `vim.command('call feedkeys("\<Esc>")')`. The usage of double quotes inside the feedkeys() call is important because it causes vim to treat the sequence as a proper escape sequence rather than a series of individual characters (see :h feedkeys).
* gpt-4o as default chat modelMartin Bielik2024-05-313
|
* define required max_tokens for turbo-instruct modelMartin Bielik2024-05-313
|
* Merge pull request #99 from Konfekt/patch-3Martin Bielik2024-05-163
|\ | | | | increase token limit
| * increase token limitEnno2024-04-143
|/
* Merge pull request #88 from Konfekt/tabwinMartin Bielik2024-03-241
|\ | | | | detect chat window in other tabs as well
| * refactoring: extracted to helper function, using guardsMartin Bielik2024-03-241
| |
| * retabMartin Bielik2024-03-241
| |
| * Implement smarter AI chat window detection to reuse existing AI chat windows.Konfekt2024-03-111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First search for AI chat windows within the same tab and then within other tabs if none are found in the current tab. It now prioritizes the reusing of an existing chat window that matches the '.aichat' filetype before considering opening a new one. If there are no existing AI chat windows, the plugin will open a new chat window as a last resort. diff --git a/autoload/vim_ai.vim b/autoload/vim_ai.vim: - " reuse chat in active window or tab + " TODO: look for first active chat buffer. If .aichat file is used, + " then reuse chat in active window - " allow .aichat files windows to be switched to, preferably on same tab - let buffer_list_tab = tabpagebuflist(tabpagenr()) - let buffer_list_tab = filter(buffer_list_tab, 'getbufvar(v:val, "&filetype") ==# "aichat"') - - let buffer_list = [] - for i in range(tabpagenr('$')) - call extend(buffer_list, tabpagebuflist(i + 1)) - endfor - let buffer_list = filter(buffer_list, 'getbufvar(v:val, "&filetype") ==# "aichat"') - - if len(buffer_list_tab) > 0 - call win_gotoid(win_findbuf(buffer_list_tab[0])[0]) - elseif len(buffer_list) > 0 - call win_gotoid(win_findbuf(buffer_list[0])[0]) - else - " open new chat window - let l:open_conf = l:config['ui']['open_chat_command'] - call s:OpenChatWindow(l:open_conf) - endif + " open new chat window + let l:open_conf = l:config['ui']['open_chat_command'] + call s:OpenChatWindow(l:open_conf)
| * detect chat window in other tabs as wellKonfekt2024-03-101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diff --git a/autoload/vim_ai.vim b/autoload/vim_ai.vim: - - let l:chat_win_ids = win_findbuf(bufnr(s:scratch_buffer_name)) - if !empty(l:chat_win_ids) - " TODO: look for first active chat buffer. If .aichat file is used, - " then reuse chat in active window - call win_gotoid(l:chat_win_ids[0]) + let l:chat_win_id = bufwinid(s:scratch_buffer_name) + if l:chat_win_id != -1 + " TODO: look for first active chat buffer, in case .aichat file is used + " reuse chat in active window + call win_gotoid(l:chat_win_id)
* | Merge pull request #89 from Konfekt/pasteMartin Bielik2024-03-241
|\ \ | | | | | | automatically unset &paste also after failed command
| * | consistent execution delimiterMartin Bielik2024-03-241
| | |
| * | automatically unset &paste also after failed commandKonfekt2024-03-141
| |/
* | Merge pull request #85 from madox2/custom-rolesMartin Bielik2024-03-2410
|\ \ | |/ |/| Custom roles
| * reusing parsing codeMartin Bielik2024-03-242
| |
| * Merge pull request #87 from Konfekt/custom-rolesMartin Bielik2024-03-113
| |\ | | | | | | Ensure role config file exists and optional Vim source
| | * optionally supplement roles dict by vim function sourceKonfekt2024-03-113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The application was restricted to loading role configurations only from a predefined config file, which limited extensibility. Enable dynamic role configuration by invoking a custom Vim function if it is defined. This allows users to extend the role configurations beyond the static file. diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt: -The roles in g:vim_ai_roles_config_file are converted to a Vim dictionary. -Optionally, additional roles can be added by defining a function VimAIRoleParser() -whose output is a dictionary of the same format as g:vim_ai_roles_config_file. - diff --git a/py/roles.py b/py/roles.py: -if vim.eval('exists("*VimAIRoleParser")'): - roles.update(vim.eval('VimAIRoleParser()')) - diff --git a/py/utils.py b/py/utils.py: - if vim.eval('exists("*VimAIRoleParser")'): - roles.update(vim.eval('VimAIRoleParser()')) -
| | * Ensure role config file exists before loading to prevent errorsKonfekt2024-03-101
| |/ | | | | | | | | | | | | | | | | | | | | The problem was that the application tried to load a roles configuration file without checking whether it actually exists, potentially leading to unhandled exceptions if the file is missing. Ensure that the roles configuration file exists before attempting to read from it; raise an exception with a clear message if the file is not found. diff --git a/py/roles.py b/py/roles.py: -if not os.path.exists(roles_config_path): - raise Exception(f"Role config file does not exist: {roles_config_path}") -
| * removed unused logMartin Bielik2024-03-091
| |
| * docu typoMartin Bielik2024-03-091
| |
| * supprot config only rolesMartin Bielik2024-03-091
| |
| * roles docuMartin Bielik2024-03-092
| |
| * simple error handlingMartin Bielik2024-03-091
| |
| * fix using role in existing chatMartin Bielik2024-03-091
| |
| * roles example fileMartin Bielik2024-03-095
| |
| * roles completionMartin Bielik2024-03-093
| |
| * parse role optionsMartin Bielik2024-03-093
| |
| * read role prompt from configMartin Bielik2024-03-093
|/
* removed unused variableMartin Bielik2024-03-091
|
* Merge pull request #84 from Konfekt/rangeMartin Bielik2024-03-091
|\ | | | | allow overriding range if called on visual selection
| * remove garbled textKonfekt2024-03-091
| |
| * fix typoKonfekt2024-03-091
| |
| * allow overriding range if called on visual selectionKonfekt2024-03-081
| | | | | | | | | | | | | | Check if the start and end line of range equals that of visual selection. If so, take the visual selection; otherwise the supplied range
* | removed config path logMartin Bielik2024-03-091
| |
* | Merge pull request #80 from jiangyinzuo/mainMartin Bielik2024-03-093
|\ \ | | | | | | feat: add an option to customize api key file location
| * | feat: add an option to customize api key file locationjiangyinzuo2024-03-083
| |/
* | Merge pull request #82 from Konfekt/issue81Martin Bielik2024-03-091
|\ \ | |/ |/| fix selection handling in vim_ai functions, fixes #81
| * Fix incorrect argument type passed in AINewChat commandKonfekt2024-03-081
|/ | | | | | | | | The vim-ai plugin had an issue where the AINewChat command was using <q-args> to always pass a quoted (possibly empty!) argument to the vim_ai#AINewChatRun function where an optional <f-args> agument was expected. Addresses https://github.com/madox2/vim-ai/issues/81
* docu range functionalityMartin Bielik2024-02-261
|
* Merge pull request #77 from Konfekt/rangeMartin Bielik2024-02-264
|\ | | | | fix selection handling in vim_ai functions