code-stats.nvim
Code::Stats plugin for Neovim.
Install
rocks.nvim
Command style
:Rocks install code-stats.nvim
Declare style
~/.config/nvim/rocks.toml:
[plugins] "code-stats.nvim" = "scm"
Then
:Rocks sync
or:
$ luarocks --lua-version 5.1 --local --tree ~/.local/share/nvim/rocks install code-stats.nvim # ~/.local/share/nvim/rocks is the default rocks tree path # you can change it according to your vim.g.rocks_nvim.rocks_path
Configure
local CodeStats = require 'code-stats.nvim.codestats'.CodeStats local args = CodeStats.args args.headers['X-API-Token'] = "XXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" local codestats = CodeStats { args = args } codestats:create_autocmds()
For compatibility of code-stats-zsh and code-stats-bash, the following is also OK:
local CodeStats = require 'code-stats.nvim.codestats'.CodeStats local codestats = CodeStats { dotenv = "/the/path/of/codestats.sh" } codestats:create_autocmds()
/the/path/of/codestats.sh:
CODESTATS_API_KEY=XXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Tips
For Nix user, run
/the/path/of/luarocks/rocks-5.1/code-stats.nvim/VERSION/scripts/update.sh when
dynamic link libraries are broken after nix-collect-garbage -d.