From e1f9498b120bdb0aab2ea57b893c2877a587194a Mon Sep 17 00:00:00 2001 From: Martin Bielik Date: Sun, 23 Apr 2023 11:04:23 +0200 Subject: renamed custom commands examples --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 21fee30..3b466d9 100644 --- a/README.md +++ b/README.md @@ -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 ,call AIPromptCodeReviewFn() +command! -range CodeReview ,call CodeReviewFn() ``` ## Important Disclaimer -- cgit v1.2.3