Coder Social home page Coder Social logo

annotate.nvim's Introduction

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.

annotate.nvim's People

Contributors

winter-again avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.