Files
README.md

hashigaki #

External line-level comment storage for local files.

CLI #

Build the Go CLI:

go build -o hashigaki ./cmd/hashigaki

Use a custom database path when needed:

HASHIGAKI_DB=/tmp/comments.jsonl ./hashigaki list

Notes added inside a Git repository are linked to the current HEAD commit via commit_hash. Override it explicitly when needed:

hashigaki add main.go 42 "Check this branch" --commit 0123456789abcdef0123456789abcdef01234567

hashigaki list [file] shows active notes for the current Git HEAD by default. Use --all to include notes from other commits:

hashigaki list --all

Neovim #

Add this repository to your runtime path with your plugin manager, then ensure the hashigaki binary is available on PATH. The plugin uses Neovim's built-in Lua APIs and is intended for Neovim 0.10 or newer.

Example local setup:

{
  dir = "/path/to/hashigaki",
  config = function()
    require("hashigaki").setup({
      command = "hashigaki",
      diagnostics = {
        enabled = true,
        virtual_text = false,
        signs = true,
        underline = false,
      },
      hover = {
        enabled = true,
        delay_ms = 800,
        width = 64,
        max_height = 14,
      },
    })
  end,
}

Commands:

  • :HashigakiAdd opens a floating note window for the current line.
  • Visual select lines, then run :HashigakiAdd to add one note to that line range.
  • :HashigakiAdd! allows adding while the buffer has unsaved changes.
  • :HashigakiRefresh refreshes comment diagnostics for the current buffer.
  • :HashigakiDelete deletes hashigaki note(s) on the current line.
  • :HashigakiUpdate opens a floating window to update a hashigaki note on the current line.

The plugin marks lines with notes as Neovim diagnostics with INFO severity. Diagnostics refresh on buffer enter, buffer read, buffer write, :HashigakiRefresh, and after adding a note.

Lines with notes (including every line of a range note) also get a background highlight using the HashigakiNote highlight group, so commented areas stand out like a marker. Customize it by overriding the group or disable it:

vim.api.nvim_set_hl(0, "HashigakiNote", { bg = "#403000" })
require("hashigaki").setup({ highlight = { enabled = false } })

Built-in virtual text is disabled by default to avoid duplicate inline text when using another diagnostics UI plugin. If you want Neovim's built-in virtual text, enable it explicitly:

require("hashigaki").setup({
  diagnostics = {
    virtual_text = {
      prefix = "hashigaki",
      spacing = 2,
    },
  },
})

Range notes use the first comment line plus ... as the diagnostic message. Leaving the cursor on a line with a hashigaki diagnostic opens a side float after delay_ms and shows the full note text.

If multiple notes start on the same line, hashigaki combines them into one diagnostic so virtual text is shown once, with a (+N) suffix. The hover float still shows all notes.

Inside the floating window:

  • <CR> adds the note.
  • <Esc> or <C-c> cancels.