Skip to content

A Emacs note package inspired by Visual Studio Code's Linenote.

License

Notifications You must be signed in to change notification settings

seokbeomKim/org-linenote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

org-linenote

An Emacs note package inspired by Visual Studio Code’s Linenote (https://marketplace.visualstudio.com/items?itemName=tkrkt.linenote).

What is this package?

org-linenote has several key features:

  • Creating a note per line
  • Saving notes by preserving the directory structure
  • Compatibility with VS Code Linenote extension
  • No org properties required
  • Based on a Git repository

org-linenote is useful when you need a detailed note on a specific line of code or document, unlike other note-taking packages that create a note per file. Additionally, the package does not require Org properties but only utilizes the line number from the filename.

Also, the package provides compatibility with the VS Code Linenote extension. If you manage the notes within the markdown (.md) format, the same notes can also be utilized in Visual Studio Code.

These features make org-linenote useful when you need ‘line-by-line’ notes to analyze the code and share notes with others. I use this package for analyzing Linux kernel and sharing insights with people (most of them are vscode users).

Installation

(require 'org-linenote)

Usage

https://github.com/seokbeomKim/org-linenote/blob/image/example.gif

The package provides interactive functions as follows:

  • org-linenote-mode: to enable Linenote’s highlight on the current buffer.
  • org-linenote-browse: to browse notes for the current buffer.
  • org-linenote-add-annotate: to add a note for the current line.
  • org-linenote-edit-annotate: an alias for org-linenote-add-annotate. Edit the note corresponding to the current line.
  • org-linenote-remove-annotate: to remove the note corresponding to the current line.
  • org-linenote-move-forward: to move to the next note from the current line.
  • org-linenote-move-backward: to move to the previous note from the current line.
  • org-linenote-find-root-dir: to find the root directory of the project.
  • org-linenote-find-note-dir: to find the note directory of the current buffer.
  • org-linenote-auto-open: to enable the note-following feature to view notes of the currently focused line.

Single-line and multi-line notes

This package manages the notes by using relative paths and line numbers. Every note is stored in the .linenote directory in the project root directory with the relative path and the line number.

For example, when we add a note on init/main.c:131, then it creates the note in .linenote/init/main.c#L131.org (or .md file based on the configuration). You can also create a multi-line note by selecting multiple lines in the code or document. In this case, the note is created in .linenote/init/main.c#L131-133.org, for example.

Integrating org-linenote and VS Code’s Linenote

org-linenote utilizes the directory $PROJECT/.linenote, but VS Code Linenote uses $PROJECT/.vscode/linenote.

Notes must be in markdown format to be displayed correctly in VS Code. org-linenote can deal with both org and markdown format. But, VS Code Linenote can only deal with markdown format. So, I recommend using the markdown format for compatibility with vscode-linenote if you use vscode as well.

If you want to create notes with a different extension, you can set org-linenote--default-extension to other values. This only affects the extension of new notes to create and does not filter existing notes.

(setq org-linenote--default-extension ".md")

Create a symbolic link (org-linenote directory to VS Code Linenote directory)

$ ln -sv $PROJECT/.linenote $PROJECT/.vscode/linenote

Change-Log

0.2.1

  • Add an interactive function to toggle auto-open feature
  • Fixed incorrect function names

0.2.0

  • Fix a bug on mode activation
  • Add a feature to auto highlight by filenotify events
  • Add interactive functions to move to the next/previous note
  • Add interactive functions to find Linenote directory

0.1.2

  • Refactor org-linenote-mode to use minor-mode
  • Modified code according to MELPA PR feedbacks (melpa/melpa#8955)

0.1.1

  • Fix a bug on note browsing
  • Add org-linenote--default-extension

0.1.0

  • initial version

Feedback

If you have any feedback, suggestions for improvements, or advice, please feel free to get in touch.

About

A Emacs note package inspired by Visual Studio Code's Linenote.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published