An open API service indexing awesome lists of open source software.

https://github.com/kenfdev/nvim-feedbacks


https://github.com/kenfdev/nvim-feedbacks

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

          

# nvim-feedbacks

A neovim plugin for adding inline feedback/annotations to code lines that persist to markdown files.

## Overview

nvim-feedbacks allows you to add comments/feedback to specific lines in your code. When invoked, a floating window appears where you can write your feedback. The feedback is then appended to a markdown file stored in a `.feedback` directory. Lines with feedback display a sign icon, and you can view, cycle through, and delete feedbacks from within neovim.

## Requirements

- Neovim >= 0.9

## Installation

Using [lazy.nvim](https://github.com/folke/lazy.nvim):

```lua
{
'kenfdev/nvim-feedbacks',
config = function()
require('feedbacks').setup()
end,
}
```

## Commands

| Command | Description |
|---------|-------------|
| `:FeedbackAdd` | Add feedback to current line (or visual selection) |
| `:FeedbackEdit` | Edit feedback on current line in floating window |
| `:FeedbackToggleSigns` | Toggle sign icons for all feedbacks in current buffer |
| `:FeedbackOpenFile` | Open the current review file for direct editing |
| `:FeedbackArchiveFile` | Move current review file to `.feedback/archive/` |

## Default Keybindings

All keybindings use `f` prefix:

| Keybinding | Command | Description |
|------------|---------|-------------|
| `fa` | `:FeedbackAdd` | Add feedback |
| `fe` | `:FeedbackEdit` | Edit feedback |
| `fs` | `:FeedbackToggleSigns` | Toggle signs |
| `fo` | `:FeedbackOpenFile` | Open review file |
| `fx` | `:FeedbackArchiveFile` | Archive current file |

Keybindings can be disabled via setup configuration.

## Configuration

```lua
require('feedbacks').setup({
-- Sign column icon (emoji or text)
sign_icon = '💬',

-- Default keybindings (set to false to disable)
keymaps = {
add = 'fa',
edit = 'fe',
toggle = 'fs',
open = 'fo',
archive = 'fx',
},

-- Feedback directory name (relative to project root)
feedback_dir = '.feedback',

-- Archive subdirectory name
archive_dir = 'archive',
})
```

## Floating Window Keybindings

### Add Window (when adding feedback)

| Key | Action |
|-----|--------|
| `` | Submit feedback and close |
| `` | Cancel and close without saving |

### View Window (when viewing feedback)

| Key | Action |
|-----|--------|
| `` | Next feedback (if multiple on same line) |
| `` | Previous feedback |
| `d` | Delete feedback (with confirmation) |
| `` | Close window |

## File Structure

### Feedback Directory

- Location: `.feedback/` directory in the nearest git project root
- If no git project found: `.feedback/` in the current working directory
- Created silently on first feedback if it doesn't exist

### Review Files

- **Format**: Markdown (`.md`)
- **Naming**: ISO date format: `YYYY-MM-DD.md` (e.g., `2024-01-15.md`)
- **Active file**: Defaults to today's date; remembered within session if manually switched

### Feedback Entry Format

Each feedback entry uses a heading for the reference and content below:

```markdown
## README.md L3
This function needs error handling

## src/main.lua L15-L20
Consider extracting this into
a separate module for reusability

## lib/utils.lua L42
TODO: Add unit tests for edge cases
```

## License

MIT