Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

voice.nvim

voice.nvim is a Neovim plugin that records and plays voice notes attached to specific lines of code.

Features

  • Per-file storage using mirrored file-path directories under voice_comments/ in your project root.
  • Inline markers rendered with extmarks and virtual text for lines that have voice notes.
  • Async audio operations with ffmpeg (recording) and ffplay (playback), so Neovim stays responsive.
  • Automatic marker loading when file buffers are opened.
  • Default keymaps:
    • <leader>vr: start/stop recording a voice note on the current line
    • <leader>vp: play the voice note on the current line

Structure

voice.nvim/
├── lua/
│   └── voice/
│       ├── init.lua
│       ├── core.lua
│       ├── audio.lua
│       ├── marks.lua
│       └── utils.lua
└── plugin/
  └── voice.lua

Requirements

  • Neovim 0.9+
  • ffmpeg
  • ffplay

Installation

Example for lazy.nvim:

{
 "NitroVim/voice.nvim",
 config = function()
  require("voice").setup({
   -- Optional overrides
  -- storage_root = vim.fn.getcwd() .. "/voice_comments",
   -- keymaps = { record = "<leader>vr", play = "<leader>vp" },
  })
 end,
}

The plugin also auto-initializes with defaults via plugin/voice.lua.

Default Configuration

require("voice").setup({
 storage_root = nil,
 keymaps = {
  record = "<leader>vr",
  play = "<leader>vp",
 },
 ui = {
  marker_text = "  [voice]",
  marker_hl = "Comment",
  priority = 200,
 },
 audio = {
  ffmpeg_cmd = "ffmpeg",
  ffplay_cmd = "ffplay",
  record = {
   format = "wav",
   input_args = { "-f", "alsa", "-i", "default" },
   extra_args = { "-acodec", "pcm_s16le", "-ar", "44100", "-ac", "1", "-loglevel", "error" },
  },
  playback = {
   extra_args = { "-nodisp", "-autoexit", "-loglevel", "error" },
  },
 },
})

Usage

  1. Move the cursor to a line.
  2. Press <leader>vr to start recording.
  3. Press <leader>vr again to stop and save.
  4. Press <leader>vp to play the voice note for that line.

Audio files are stored under voice_comments/<path-to-file>/ with one file per line number (for example 22.wav).

By default, voice.nvim uses the nearest Git project root for storage. If no Git root is found, it falls back to the current file's directory.

About

Voice comments for your code - record, play, explain.

Topics

Resources

Contributing

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages