summaryrefslogtreecommitdiff
path: root/doc/vim-ai.txt
diff options
context:
space:
mode:
authorKonfekt <Konfekt@users.noreply.github.com>2024-02-26 08:20:16 +0100
committerKonfekt <Konfekt@users.noreply.github.com>2024-02-26 10:10:18 +0100
commitdec808e78845cb981a7d8d23ac1a1c0eac58d114 (patch)
tree0df88197fc454319c46740c98f76d598e2827514 /doc/vim-ai.txt
parent46e3d5a609fdaa2ddb2af6cc5cb4e754b8b39bfa (diff)
downloadvim-ai-dec808e78845cb981a7d8d23ac1a1c0eac58d114.tar.gz
drop superfluous selection argument and fix instruction argument
Diffstat (limited to '')
-rw-r--r--doc/vim-ai.txt9
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/vim-ai.txt b/doc/vim-ai.txt
index 34765d7..72535b3 100644
--- a/doc/vim-ai.txt
+++ b/doc/vim-ai.txt
@@ -188,7 +188,6 @@ To create custom commands, call `AIRun`, `AIEditRun` and `AIChatRun` functions:
function! AIPromptCommitMessageFn()
let l:diff = system('git 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": {
@@ -197,12 +196,12 @@ To create custom commands, call `AIRun`, `AIEditRun` and `AIChatRun` functions:
\ "temperature": 1,
\ },
\}
- call vim_ai#AIRun(l:range, l:config, l:prompt)
+ call vim_ai#AIRun(l:config, l:prompt)
endfunction
- command! AIPromptCommitMessage call AIPromptCommitMessageFn()
+ command! AIPromptCommitMessage call AIPromptCommitMessageFn(range)
" custom command that provides a code review for selected code block
- function! AIPromptCodeReviewFn(range) range
+ function! AIPromptCodeReviewFn() range
let l:prompt = "programming syntax is " . &filetype . ", review the code below"
let l:config = {
\ "options": {
@@ -211,7 +210,7 @@ To create custom commands, call `AIRun`, `AIEditRun` and `AIChatRun` functions:
\}
'<,'>call vim_ai#AIChatRun(a:range, l:config, l:prompt)
endfunction
- command! -range AIPromptCodeReview <line1>,<line2>call AIPromptCodeReviewFn(<range>)
+ command! -range=0 AIPromptCodeReview <line1>,<line2>call AIPromptCodeReviewFn(<count>)
ABOUT *vim-ai-about*