summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMartin Bielik <mx.bielik@gmail.com>2023-03-25 18:06:30 +0100
committerMartin Bielik <mx.bielik@gmail.com>2023-03-25 18:26:06 +0100
commit894f58a9887ad91cb2567b346907b9388debf0c5 (patch)
treefedb7b5f6981180e8dd4db0bebfcadadc6f84a2b /README.md
parent5e8a27664ce42cb0a04aa9a095fb70edc5098dc2 (diff)
downloadvim-ai-894f58a9887ad91cb2567b346907b9388debf0c5.tar.gz
updated keybindings docu
Diffstat (limited to '')
-rw-r--r--README.md21
1 files changed, 12 insertions, 9 deletions
diff --git a/README.md b/README.md
index a483d8b..6cb5e05 100644
--- a/README.md
+++ b/README.md
@@ -86,6 +86,14 @@ Map keys in your `.vimrc` to trigger `:AI` command.
" complete text on the current line or in visual selection
nnoremap <leader>a :AI<CR>
xnoremap <leader>a :AI<CR>
+
+" edit text with a custom prompt
+xnoremap <leader>s :AIEdit fix grammar and spelling<CR>
+nnoremap <leader>s :AIEdit fix grammar and spelling<CR>
+
+" trigger chat
+xnoremap <leader>c :AIChat<CR>
+nnoremap <leader>c :AIChat<CR>
```
### Completion configuration
@@ -141,19 +149,14 @@ let g:vim_ai_chat = {
### Custom commands
-To customize and re-use prompts it is useful to put some context to the language model. You can do it with prepending text to `:AI` command.
+To customize and re-use prompts it is useful to put some context in it. You can do it by prepending text to AI commands.
```vim
-" key binding with custom context
-xnoremap <leader>s :AIEdit fix grammar and spelling and use formal language<CR>
-nnoremap <leader>s :AIEdit fix grammar and spelling and use formal language<CR>
+command! -range -nargs=? AITranslate <line1>,<line2>call AIEditRun(<range>, "Translate to English: " . <q-args>)
-" key binding to trigger chat
-xnoremap <leader>c :AIChat<CR>
-nnoremap <leader>c :AIChat<CR>
+command! -range -nargs=? AICode <line1>,<line2>call AIRun(<range>, "Programming syntax is " . &filetype . ", " . <q-args>)
-" command with custom context (vim-ai functions: AIRun, AIEditRun, AIChatRun)
-command! -range -nargs=? AICode <line1>,<line2>call AIRun(<range>, "Programming syntax is " . &filetype . ", " . <f-args>)
+" available functions are: AIRun, AIEditRun, AIChatRun
```