Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thanhvg/emacs-virtual-comment

Virtual Comments for Emacs
https://github.com/thanhvg/emacs-virtual-comment

emacs

Last synced: about 1 month ago
JSON representation

Virtual Comments for Emacs

Awesome Lists containing this project

README

        

#+startup: content indent
#+title: Emacs Virtual Comments

[[http://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]]

* Intro
This package allows adding virtual comments to files in buffers. These comments
don't belong to the files so they don't. They are saved in project root or a
global file which can be viewed and searched. The file name is =.evc=.

* Demo
[[file:media/screencast.gif]]

* Virtual comments
A virtual comment is an overlay and it is added above the line it comments on
and has the same indentation. The virtual comment can be single line or
multiline. Each line can have one comment.

* Install
Spacemacs layer:
https://github.com/thanhvg/spacemacs-eos

Melpa

[[https://melpa.org/#/virtual-comment][file:https://melpa.org/packages/virtual-comment-badge.svg]]

#+begin_src
(require 'virtual-comment)
(add-hook 'find-file-hook 'virtual-comment-mode)
#+end_src

* Commands
- =virtual-comment-make=: create or edit a comment at current line
- =virtual-comment-next=: go to next comment in buffer
- =virtual-comment-previous=: go to previous comment in buffer
- =virtual-comment-delete=: remove the current comment
- =virtual-comment-paste=: paste the last removed comment to current line
- =virtual-comment-realign=: realign the comments if they are misplaced
- =virtual-comment-persist=: manually persist project comments
- =virtual-comment-show=: show all comments of current project in a derived mode
from =outline-mode=, press enter on a comment will call =virtual-comment-go= to go
to the location of comment. =C-c C-d=
(=virtual-comment-show-delete-display-unit-at-point=) will delete that comemt.

There are no default bindings at all for these commands.

* Remarks
- It's very hard to manage overlays. So this mode should be use in a sensible
way. Only comments of files can be persisted.
* Changes
** 0.5
- won't create =.evc= if there is no comment for the project
- only save data if there is change
- if can't parse the =.evc= file copy it to =.evc.error=
** 0.4
- a backup of current data will be made as =.evc.bk= when data
is persisted
* Test
#+begin_src sh
cask install
cask exec ert-runner
#+end_src
* Other similar packages and inspirations
https://github.com/blue0513/phantom-inline-comment
https://www.emacswiki.org/emacs/InPlaceAnnotations