From ae814f2f485c4ee9635d1d6bf11674797d387984 Mon Sep 17 00:00:00 2001 From: Chris Stryczynski Date: Sat, 17 Feb 2024 10:45:45 +0000 Subject: Update README.md Fix instructions which lead to `Undefined variable: g:vim_ai_chat` if config options are not initially set --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 993e762..5d7f26c 100644 --- a/README.md +++ b/README.md @@ -199,7 +199,7 @@ let g:vim_ai_chat = { \} ``` -Or modify options directly during the vim session: +Once the above is set, you can modify options directly during the vim session: ```vim let g:vim_ai_chat['options']['model'] = 'gpt-4' -- cgit v1.2.3 From dec808e78845cb981a7d8d23ac1a1c0eac58d114 Mon Sep 17 00:00:00 2001 From: Konfekt Date: Mon, 26 Feb 2024 08:20:16 +0100 Subject: drop superfluous selection argument and fix instruction argument --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 5d7f26c..1bc1f34 100644 --- a/README.md +++ b/README.md @@ -377,7 +377,6 @@ To create a custom command, you can call `AIRun`, `AIEditRun` and `AIChatRun` fu function! GitCommitMessageFn() let l:diff = system('git --no-pager diff --staged') let l:prompt = "generate a short commit message from the diff below:\n" . l:diff - let l:range = 0 let l:config = { \ "engine": "chat", \ "options": { @@ -386,7 +385,7 @@ function! GitCommitMessageFn() \ "temperature": 1, \ }, \} - call vim_ai#AIRun(l:range, l:config, l:prompt) + call vim_ai#AIRun(l:config, l:prompt) endfunction command! GitCommitMessage call GitCommitMessageFn() @@ -398,9 +397,9 @@ function! CodeReviewFn(range) range \ "initial_prompt": ">>> system\nyou are a clean code expert", \ }, \} - '<,'>call vim_ai#AIChatRun(a:range, l:config, l:prompt) + exe a:firstline.",".a:lastline . "call vim_ai#AIChatRun(a:range, l:config, l:prompt)" endfunction -command! -range CodeReview ,call CodeReviewFn() +command! -range=0 CodeReview ,call CodeReviewFn() ``` ## Contributing -- cgit v1.2.3