مكون إضافي NEOVIM الحد الأدنى لإنشاء النص وتحريره باستخدام Openai و GPT.
<Ctrl-A>
أو تشغيل :AI <prompt>
.لـ VIM-plug ، أضف هذا إلى init.vim:
Plug ' aduros/ai.vim '
تأكد من أن لديك متغيرًا للبيئة يسمى $OPENAI_API_KEY
الذي يمكنك إنشاؤه هنا. ستحتاج أيضًا إلى تثبيت curl
.
لمشاهدة خيارات المساعدة والتخصيص الكاملة ، قم بتشغيل :help ai.vim
.
إن اكتمال حالة الاستخدام الأساسي ، من خلال الضغط على <Ctrl-A>
في وضع إدراج.
على سبيل المثال:
function capitalize ( str : string ) : string {
( Press < Ctrl - A > here )
}
سوف يؤدي إلى:
function capitalize ( str : string ) : string {
return str . charAt ( 0 ) . toUpperCase ( ) + str . slice ( 1 ) ;
}
AI.VIM ليس فقط للبرمجة! يمكنك أيضًا إكمال النص البشري العادي:
Hey Joe, here are some ideas for slogans for the new petshop. Which do you like best?
1. <Ctrl-A>
نتائج في:
Hey Joe, here are some ideas for slogans for the new petshop. Which do you like best?
1. "Where Pets Come First!"
2. "Your Pet's Home Away From Home!"
3. "The Best Place for Your Pet!"
4. "The Pet Store That Cares!"
5. "The Pet Store That Loves Your Pet!"
يمكنك أيضًا إنشاء بعض النص عن طريق الضغط على <Ctrl-A>
في الوضع العادي وتوفير موجه. على سبيل المثال:
:AI write a thank you email to Bigco engineering interviewer
ينتج عنه شيء مثل:
Dear [Name],
I wanted to take a moment to thank you for taking the time to interview me for the engineering
position at Bigco. I was very impressed with the company and the team, and I am excited about the
possibility of joining the team.
I appreciate the time you took to explain the role and the company's mission. I am confident that I
have the skills and experience to be a valuable asset to the team.
Once again, thank you for your time and consideration. I look forward to hearing from you soon.
Sincerely,
[Your Name]
إلى جانب إنشاء نص جديد ، يمكنك أيضًا تحرير النص الموجود باستخدام تعليمة معينة.
body {
color : orange;
background : green;
}
اختيار CSS أعلاه وتشغيله :AI convert colors to hex
يؤدي إلى:
body {
color : # ffa500 ;
background : # 008000 ;
}
مثال آخر على تحرير النص:
List of capitals:
1. Toronto
2. London
3. Honolulu
4. Miami
5. Boston
اختيار هذا النص وتشغيله بصريًا :AI sort by population
:
List of capitals:
1. London
2. Toronto
3. Boston
4. Miami
5. Honolulu
يمكنك بناء اختصاراتك الخاصة لمطالبات طويلة ومعقدة. على سبيل المثال:
vnoremap <silent> <leader> f :AI fix grammar and spelling and replace slang and contractions with a formal academic writing style <CR>
مع هذا التعيين المخصص ، يمكنك تحديد نص يبدو هكذا:
Me fail English? That's unpossible!
ومن خلال الضغط على <leader>f
تحويله إلى هذا:
I failed English? That is impossible!
إذا توصلت إلى أي طرق مثيرة لاستخدام ai.vim ، فيرجى مشاركة ما تجده!
الدقة : GPT جيد في إنتاج النص والرمز الذي يبدو صحيحًا للوهلة الأولى ، ولكن قد يكون خطأً تمامًا. تأكد من إثبات قراءة كل شيء واختبار كل شيء عن طريق هذا البرنامج المساعد!
الخصوصية : يرسل هذا المكون الإضافي نصًا إلى Openai عند توليد الإكمال والتحريرات. لا تستخدمه في الملفات التي تحتوي على معلومات حساسة.