An Emacs note package inspired by Visual Studio Code’s Linenote (https://marketplace.visualstudio.com/items?itemName=tkrkt.linenote).
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).
(require 'org-linenote)
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 fororg-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.
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.org-linenote-fringe-side
: to configure the side of the fringes.
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.
org-linenote-highlight-style
: to customize the style of highlighting.
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.
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
- Added support for fringes.
- Fixed a highlighting issue caused by temporary files.
- Added eldoc support.
- Fixed a bug on revert-buffer.
- Changed
org-linenote--default-extension
andorg-linenote--highlight-style
to customizable variables. Now it is available inM-x customize
.
- Added an interactive function to toggle auto-open feature
- Fixed incorrect function names
- 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
- Refactored org-linenote-mode to use minor-mode
- Modified code according to MELPA PR feedbacks (melpa/melpa#8955)
- Fixed a bug on note browsing
- Add
org-linenote--default-extension
- initial version
- tag support
If you have any feedback, suggestions for improvements, or advice, please feel free to get in touch.