Skip to content

Latest commit

 

History

History
67 lines (40 loc) · 2.33 KB

README.adoc

File metadata and controls

67 lines (40 loc) · 2.33 KB

Warning

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.

Purpose

vim-codelens is a neovim plugin somewhat inspired by Visual Studio codelens.

At the moment it has very few features. The main one being to provide virtualtext against a function definition indicating when it was last modified, by who, and how many people have edited it.

screenshot

Features

The features provided by codelens vary based on the filetype of the current buffer. The basic features are as follow:

  1. 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.

  1. Provides the author name and date of most recent git modification for the current function, class, namespace etc.

  2. Provides a count of the number of references to the current function, class, namespace etc.

  3. Provides a count of the number of tests of the current function, class, namespace etc.

Installation

You can install vim-codelens using your favourite package manager, I use vim-plug.

Plug 'markwoodhall/vim-codelens'

Configuration

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.

License

Copyright © Mark Woodhall. Distributed under the same terms as Vim itself. See :help license