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

32 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

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

Eldoc support https://github.com/seokbeomKim/org-linenote/blob/image/example-eldoc.png

Interactive functions

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-add-tags: to add tags for the current line.
  • org-linenote-remove-tags: to remove tags for 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.

M-x customize

The following variables are customizable via M-x customize.

  • org-linenote-use-eldoc: to enable or disable eldoc support.
  • org-linenote-use-highlight: to enable or disable line highlighting.
  • org-linenote-use-fringe: to enable or disable fringe support.

Fringe

  • org-linenote-fringe-side: to choose between 'left-fringe or 'right-fringe.
  • org-linenote-fringe-face: to configure the face (i.e. color) of the fringes.
  • org-linenote-fringe-bitmap: to set the fringe bitmap style.

Highlight

  • org-linenote-highlight-style: to customize the style of highlighting.

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

1.1.0

  • Added tags support. The tags will be shown in the minibuffer via org-linenote-browse.
    • org-linenote-add-tags
    • org-linenote-remove-tags

1.0.1

  • Added support for fringes.
  • Fixed a highlighting issue caused by temporary files.

1.0.0

  • Added eldoc support.
  • Fixed a bug on revert-buffer.

0.2.2

  • Changed org-linenote--default-extension and org-linenote--highlight-style to customizable variables. Now it is available in M-x customize.

0.2.1

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

0.2.0

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

0.1.2

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

0.1.1

  • Fixed 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