vipul-sharma20 / annotate.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

annotate.nvim

Please note that this plugin is still WIP & unstable. Feel free to open an issue with any bugs or implementation suggestions.

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({
      -- 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
 }

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

License:GNU General Public License v3.0


Languages

Language:Lua 100.0%