diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-04-23 11:04:23 +0200 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-04-23 11:04:29 +0200 |
| commit | e1f9498b120bdb0aab2ea57b893c2877a587194a (patch) | |
| tree | ca2933a3f1af0c129399f5a1fb5ca516eacc10a2 /README.md | |
| parent | 27ee959366ab8b5aebc2d0db6f508ebdc84519b6 (diff) | |
| download | vim-ai-e1f9498b120bdb0aab2ea57b893c2877a587194a.tar.gz | |
renamed custom commands examples
Diffstat (limited to '')
| -rw-r--r-- | README.md | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -303,8 +303,8 @@ To create a custom command, you can call `AIRun`, `AIEditRun` and `AIChatRun` fu ```vim " custom command suggesting git commit message, takes no arguments -function! AIPromptCommitMessageFn() - let l:diff = system('git diff --staged') +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 = { @@ -317,10 +317,10 @@ function! AIPromptCommitMessageFn() \} call vim_ai#AIRun(l:range, l:config, l:prompt) endfunction -command! AIPromptCommitMessage call AIPromptCommitMessageFn() +command! GitCommitMessage call GitCommitMessageFn() " custom command that provides a code review for selected code block -function! AIPromptCodeReviewFn(range) range +function! CodeReviewFn(range) range let l:prompt = "programming syntax is " . &filetype . ", review the code below" let l:config = { \ "options": { @@ -329,7 +329,7 @@ function! AIPromptCodeReviewFn(range) range \} '<,'>call vim_ai#AIChatRun(a:range, l:config, l:prompt) endfunction -command! -range AIPromptCodeReview <line1>,<line2>call AIPromptCodeReviewFn(<range>) +command! -range CodeReview <line1>,<line2>call CodeReviewFn(<range>) ``` ## Important Disclaimer |