PCT-VIM - Precise Code Tracking Vim plugin
This plugin is the vim implementation of the PCT method developed by @tmanning. It is intended to assist in code auditing by enabling one to annotate read-only source code from a text editor. This plugin is the vim implementation. See @tmanning for the textmate implementation.
PCT uses an sqlite3 database to store and query audited ranges of code and notes that were taken/added for line ranges.
Follow the steps below to initialize the database:
- Install dependencies
- Source pct.vim
- Open a file in a project that you wish to audit
- Run the command below to initialize the database:
- Begin auditing!
Be aware that the plugin treats the root dirname of the database path as the root of the project. Any files in subfolders of the root project path will be included in reports and are considered "part of the project".
peeweepython module (
pip install peewee)
[r- mark the current/selected line(s) as having been reviewed
- Generic Comments (Annotations)
[a- annotate the current/selected line(s) with a single-line generic comment
[A- annotate the current/selected line(s) with a multi-line generic comment
[f- annotate the current/selected line(s) with a single-line finding
[F- annotate the current/selected line(s) with a multi-line finding
[t- annotate the current/selected line(s) with a single-line todo
[T- annotate the current/selected line(s) with a multi-line todo
- Annotation Modification
[d- delete an annotation on the current line
[R- toggle the report of the current project
[h- show a recent history of notes/reviewed source files
[o- open the file under the cursor in a new readonly tab (useful for reports)
- Annotation Navigation
[n- jump to the next annotation in the current file
[N- jump to the previous annotation in the current file
[?- display the current annotation(s) in a vertically-split window
Note that the only differentiation between annotations/findings/todos is the existence of certain keywords in the annotation. Todos contain the word "TODO" in the text, findings contain the word "FINDING" in the text, and generic annotations don't contain either.
- sometimes there are issues when viewing existing notes while scrolling through a split file
- ability to mark files as out-of-scope
- ability to edit annotations
Lines marked as reviewed
A simple note/annotation
Report and History