diff options
Diffstat (limited to 'plugin/vim-ai.vim')
| -rw-r--r-- | plugin/vim-ai.vim | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/plugin/vim-ai.vim b/plugin/vim-ai.vim index 1ed5326..d27f312 100644 --- a/plugin/vim-ai.vim +++ b/plugin/vim-ai.vim @@ -4,19 +4,8 @@ if !has('python3') finish endif -" detect if a visual selection is pending: https://stackoverflow.com/a/20133772 -let g:vim_ai_is_selection_pending = 0 -augroup vim_ai - autocmd! - autocmd CursorMoved * - \ let g:vim_ai_is_selection_pending = mode() =~# "^[vV\<C-v>]" -augroup END - -command! -range -nargs=? -complete=customlist,vim_ai#RoleCompletion AI <line1>,<line2>call vim_ai#AIRun({}, <q-args>) -command! -range -nargs=? -complete=customlist,vim_ai#RoleCompletion AIEdit <line1>,<line2>call vim_ai#AIEditRun({}, <q-args>) -" Whereas AI and AIEdit default to passing the current line as range -" AIChat defaults to passing nothing which is achieved by -range=0 and passing -" <count> as described at https://stackoverflow.com/a/20133772 -command! -range=0 -nargs=? -complete=customlist,vim_ai#RoleCompletion AIChat <line1>,<line2>call vim_ai#AIChatRun(<count>, {}, <q-args>) -command! -nargs=? AINewChat call vim_ai#AINewChatRun(<f-args>) -command! AIRedo call vim_ai#AIRedoRun() +command! -range -nargs=? -complete=customlist,vim_ai#RoleCompletion AI <line1>,<line2>call vim_ai#AIRun(<range>, {}, <q-args>) +command! -range -nargs=? -complete=customlist,vim_ai#RoleCompletion AIEdit <line1>,<line2>call vim_ai#AIEditRun(<range>, {}, <q-args>) +command! -range -nargs=? -complete=customlist,vim_ai#RoleCompletion AIChat <line1>,<line2>call vim_ai#AIChatRun(<range>, {}, <q-args>) +command! -nargs=? AINewChat call vim_ai#AINewChatRun(<f-args>) +command! AIRedo call vim_ai#AIRedoRun() |