https://github.com/seokbeomkim/org-linenote
A Emacs note package inspired by Visual Studio Code's Linenote.
https://github.com/seokbeomkim/org-linenote
emacs linenote note org
Last synced: about 1 year ago
JSON representation
A Emacs note package inspired by Visual Studio Code's Linenote.
- Host: GitHub
- URL: https://github.com/seokbeomkim/org-linenote
- Owner: seokbeomKim
- License: gpl-3.0
- Created: 2024-02-18T08:42:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-31T06:17:40.000Z (over 1 year ago)
- Last Synced: 2025-04-04T11:48:39.169Z (about 1 year ago)
- Topics: emacs, linenote, note, org
- Language: Emacs Lisp
- Homepage:
- Size: 1.15 MB
- Stars: 35
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* 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
The package is available on MELPA(https://melpa.org)!
#+BEGIN_SRC elisp
(require 'org-linenote)
#+END_SRC
* 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-relative~: use relative paths in ~org-linenote-browse~.
- ~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.
** Tagging Support
Unlike VS Code's extension, the package supports tags. The tags can be used when browsing notes.
- ~org-linenote-add-tags~
- ~org-linenote-remove-tags~
** 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.
#+begin_src emacs-lisp
(setq org-linenote--default-extension ".md")
#+end_src
Create a symbolic link (org-linenote directory to VS Code Linenote directory)
#+BEGIN_SRC bash
$ ln -sv $PROJECT/.linenote $PROJECT/.vscode/linenote
#+END_SRC
* Change-Log
** 1.1.3
- Fix a wrong syntax in texinfo
** 1.1.2
- Add a texinfo documentation
- Update README.org
** 1.1.1
- Add an customizable option ~org-linenote-use-relative~.
** 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 (https://github.com/melpa/melpa/pull/8955)
** 0.1.1
- Fixed a bug on note browsing
- Add =org-linenote--default-extension=
** 0.1.0
- initial version
* Credits
- Thanks to Adam Porter () and Chris Rayner () for the feedback.