This is a very, very rough proof of concept, it might break, or produce errors that interrupt your workflow. It is currently working well for me.
The features provided by codelens vary based on the filetype
of the current buffer. The basic features are as follow:
-
Provides the author name and date of most recent git modification at the top of the current file
There are additional features for Clojure, vim, javascript, terraform, python, and hug sql file types.
-
Provides the author name and date of most recent git modification for the current function, class, namespace etc.
-
Provides a count of the number of references to the current function, class, namespace etc.
-
Provides a count of the number of tests of the current function, class, namespace etc.
You can install vim-codelens using your favourite package manager, I use vim-plug.
Plug 'markwoodhall/vim-codelens'
let g:codelens_auto = 1
Turns on or off the ability to generate codelens data on buffer read or write. If you prefer to
toggle this off then you can manually run the :Codelens
command.
let g:codelens_bg_colour='#1da374'
Allows customisation of the background colour used when rendering codelens data.
let g:codelens_fg_colour='#292D33'
Allows customisation of the foreground colour used when rendering codelens data.
let g:codelens_show_references = 1
Turns on or off the ability to count the number of references to the current codelens target using git grep
.
let g:codelens_show_tests = 1
Turns on or off the ability to count the number of tests on the current codelens target using git grep
.
let g:codelens_allow_same_line = 1
Turns on or off the ability to render code lens data on the same line as the target if there is no whitespace above the target.