Skip to content

🥬 A simple neovim plugin for CodeStats, the free stats tracking service for programmers.

License

Notifications You must be signed in to change notification settings

mcarn/codestats.nvim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🥬 codestats.nvim

A simple neovim plugin for Code::Stats.

Features

Requirements

  • cURL
  • neovim 0.5 or newer

Installation

use("mcarn/codestats.nvim")
local plugins = {"mcarn/codestats.nvim"}
require("lazy").setup(plugins, opts)

Configuration

local present, codestats = pcall(require, "codestats")

if not present then
    return
end

codestats.setup({
    key: "CODESTATS_API_KEY",
    username: "username"
})

Set the CODESTATS_API_KEY environment variable to your CodeStats token.

Fish

set -Ux "SFMyNTY.OEotWWdnPT0jI01qaz0.X0wVEZquh8Ogau1iTtBihYqqL71FD8N6p5ChQiIpaxQ"

Zsh

echo "export CODESTATS_API_KEY=SFMyNTY.OEotWWdnPT0jI01qaz0.X0wVEZquh8Ogau1iTtBihYqqL71FD8N6p5ChQiIpaxQ" >> ~/.zshenv

Bash

echo "export CODESTATS_API_KEY=SFMyNTY.OEotWWdnPT0jI01qaz0.X0wVEZquh8Ogau1iTtBihYqqL71FD8N6p5ChQiIpaxQ" >> ~/.bash_profile

You can also set CODESTATS_API_URL if you want to use a different instance, eg.

set -Ux CODESTATS_API_URL "https://beta.codestats.net/api"

Usage

Commmands

Use :Codestats to open a popup window exposing your api response information.

Lualine

Call get_codestats in any of the sections.

local function get_codestats()
	local codestats = require("codestats")
	local exp = codestats.current_xp()
	
	return "CS::" .. tostring(exp)

end

About

🥬 A simple neovim plugin for CodeStats, the free stats tracking service for programmers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 100.0%