Skip to content

Latest commit

 

History

History
76 lines (47 loc) · 2.19 KB

README.md

File metadata and controls

76 lines (47 loc) · 2.19 KB

whisper-vim

License: MIT

whisper-vim integrates OpenAI's Whisper into VIM so you can transcribe your voice to text with a single keystroke.

whisper-vim is just:

  • a bash script that calls sox to record your voice and then calls whisper-cli to transcribe the audio into text
  • a VIM mapping to call this script easily.

Please take a look at this Substack article where I further explain the personal context around this whisper-vim :-)

example.mp4

Usage

  • In NORMAL mode, press Ctrl-X to start recording your voice.
  • Press Ctrl-C to stop recording.
  • The trascribed text will be pasted below your cursor.

Features

Advantages:

  • Easy-to-install: you don't need to install whisper locally.
  • Easy-to-use: the recording and transcription process is as easy as it gets.
  • Easy-to-modify: it is just a bash script and a VIM mapping.

Disadvantages:

  • You need a OpenAI key, which you have to spend money on, but you get 5€ for free if you create a new account.

Installation

First, install sox and whisper-cli:

sudo apt-get install sox
pip install whisper-cli

(I have used python3.10 for installing whisper-cli.)

Second, add you OpenAI API key to whisper-cli:

whisper key set <openai_api_key>

If you have problems installing or configurating whisper-cli, please check its GitHub repository: https://github.com/vatsalaggarwal/whisper-cli

Third, add whisper-vim to you bin folder.

git clone https://github.com/fernandonobel/whisper-vim
cd whisper-vim
cp whisper-vim ~/bin/whisper-vim

Finally, add this mapping into your .vimrc:

nnoremap <C-x> :!whisper-vim record<CR>:!whisper-vim transcribe<CR>:let @a = system("cat /tmp/whisper-recording.txt")<CR>"ap

Contribute

Feel free to contribute :-)

Support

If you are having issues, please let me know as an Issue in this repository.

License

The project is licensed under the MIT license.