Skip to content

dancek/zsh-codestats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

Code::Stats plugin for Zsh

Code-stats-zsh hooks onto Zsh, counts characters as you type and saves your statistics in Code::Stats. You'll receive XP for the language Terminal (Zsh) for each character, backspace/delete and enter you type.

This plugin is an early beta, so expect some rough edges.

Installation

  1. Ensure you have curl.
  2. Get your personal API key from https://codestats.net/my/machines and set environment variable in e.g. .zshrc.
    CODESTATS_API_KEY="<api key here>"
    
  3. Install and source the script in one of the following ways (in .zshrc after the environment variable):

Zgen

zgen load [email protected]:code-stats/code-stats-zsh.git

Add a line for the plugin, run zgen update, then restart the shell by e.g. exec zsh.

Manual installation

Clone this git repo and source the script directly.

source codestats.zsh

Other plugin managers (Zplug, Antigen, ...)

Probably just pointing to the git repo will work.

Options

  • CODESTATS_API_KEY: the API key used when submitting pulses. Required.
  • CODESTATS_API_URL: the base URL to the Code::Stats API. Only set this if you know what you're doing! :)
  • CODESTATS_LOG_FILE: a log file for debugging. Must exist and be writable.

Other plugins

Plugins that wrap ZLE widgets should probably be loaded after code-stats-zsh. For example, zsh-syntax-highlighting needs to be loaded after code-stats-zsh for it to work properly.

Releases

No releases published

Packages

No packages published

Languages