OpenAI 및 GPT를 사용하여 텍스트를 생성하고 편집하기위한 미니멀리스트 Neovim 플러그인.
<Ctrl-A>
누르거나 실행 :AI <prompt>
.vim 플러그의 경우 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로 보냅니다. 민감한 정보가 포함 된 파일에 사용하지 마십시오.