Skip to content

willgraham345/annotate.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 

Repository files navigation

annotate.nvim

Note

This repo was archived as of 2024-02-23. There remain some bugs, but I don't have the motivation to continue working on this plugin. Feel free to fork. Thanks to all those who showed interest.

A plugin for creating and storing notes (annotations) related to a line of code/text. It uses Neovim's extended marks and a SQLite database to store annotation information.

2023-06-07_18-12-06.mp4

Installation & configuration

With folke/lazy.nvim

{
  'winter-again/annotate.nvim',
  dependencies = {'kkharji/sqlite.lua'},
  config = function()
    require('annotate').setup({
      -- path for the sqlite db file
      db_uri = vim.fn.stdpath('data') .. '/annotations_db',
      -- sign column symbol to use
      annot_sign = '󰍕',
      -- highlight group for symbol
      annot_sign_hl = 'Comment',
      -- highlight group for currently active annotation
      annot_sign_hl_current = 'FloatBorder',
      -- width of floating annotation window
      annot_win_width = 25,
      -- padding to the right of the floating annotation window
      annot_win_padding = 2
    })
  end
 }

Migrating note line separator character

Previously, I'd been using "``" as a separator when concatenating and reconstructing notes that span multiple lines. However, I've changed this to use "\n" instead. To update all existing notes to use the new character separator, use require('annotate').migrate_annotation_char_sep().

Functions

Map these to some keybinding:

require('annotate').create_annotation(): Create an annotation at the current cursor line and open floating window for the text. If an annotation already exists there, will open the floating window to allow modification.

require('annotate').delete_annotation(): Delete the annotation at the current cursor line, after showing the annotation text and prompting for confirmation.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Lua 100.0%