vim-bitoai.mp4
- install the bito cli
https://github.com/gitbito/CLI
- install and setup vim-plug (plugin manager)
https://github.com/junegunn/vim-plug
- install vim plugin from inside vim
Plug 'vim-bitoai'
- change config
" will show in buffers list
let g:bito_buffer_name_prefix = get(g:, 'bito_buffer_name_prefix', 'bito_history_')
" if your bito cli is not sys command, you should change the bito path
let g:vim_bito_path = get(g:, 'vim_bito_path', "bito")
" can change all the result of boti ,like: "Please translate the comment into chinses", "Please write the comment in chinses
let g:vim_bito_prompt_append = get(g:, 'vim_bito_prompt_append', "")
- BitoAiGenerate
- BitoAiGenerateUnit
- BitoAiGenerateComment
- BitoAiCheck
- BitoAiCheckSecurity
- BitoAiCheckStyle
- BitoAiCheckPerformance
- BitoAiReadable
- BitoAiExplain
if !exists("g:vim_bito_prompt_{command}")
let g:vim_bito_prompt_{command} = "your prompt"
endif
" if should select code
command! -range -nargs=0 BitoAi{Command} :call BitoAiSelected('{command}')
should replace the {command}
with your self
Add these to your vimrc using
vim ~/.vimrc
call plug#begin('~/.vim/plugged')
Plug '~/Desktop/vim-bitoai'
call plug#end()
" Bito Vim Integration Key Bindings
" Generate code
xnoremap G :<C-U>BitoAiGenerate<CR>
" Generate code for a selected range in 'unit' mode
xnoremap U :<C-U>BitoAiGenerateUnit<CR>
" Generate code comments for a selected range
xnoremap C :<C-U>BitoAiGenerateComment<CR>
" Check code for potential issues for a selected range
xnoremap K :<C-U>BitoAiCheck<CR>
" Check code security for a selected range
xnoremap X :<C-U>BitoAiCheckSecurity<CR>
" Check code style for a selected range
xnoremap S :<C-U>BitoAiCheckStyle<CR>
" Check code performance for a selected range
xnoremap P :<C-U>BitoAiCheckPerformance<CR>
" Make code more readable for a selected range
xnoremap R :<C-U>BitoAiReadable<CR>
" Explain
xnoremap E :<C-U>BitoAiExplain<CR>
Example Usage of HotKeys:
-
Open a file:
vim create_doc_overview.sh
-
Press
v
to enter visual mode. -
Highlight text using the
arrow keys
-
With Caps Lock ON, press
E
to explain the highlighted code.