Git Product home page Git Product logo

codestats.nvim's Introduction

codestats.nvim

A CodeStats.net client written for NeoVIM in LUA.

Preqrequisites

This plugin is only available for NeoVIM with LUA support (version 0.5 and above).

Installation

Packer

-- Initialize with explicit token
use {
    'YannickFricke/codestats.nvim',
    config = function()
        require('codestats-nvim').setup({
            token = "MY-CODESTATS-MACHINE-TOKEN"
        })
    end,
    requires = {{'nvim-lua/plenary.nvim'}}
}

-- Initialize via the CODESTATS_API_KEY environment variable
use {
    'YannickFricke/codestats.nvim',
    config = function()
        require('codestats-nvim').setup()
    end,
    requires = {{'nvim-lua/plenary.nvim'}}
}

Defaults

require('codestats-nvim').setup({
    token = nil, -- When the token is not provided, codestats.nvim will fallback to the CODESTATS_API_KEY environment variable
    endpoint = "https://codestats.net", -- The endpoint which should be used. Mostly you dont want to overwrite it
    interval = 60, -- The interval in seconds between pushes to the CodeStats API
})

FAQ

Getting the filetype of the current buffer

:lua print(vim.bo.filetype)

The filetype will then be printed at the bottom left side.

The plugin doesn't detect the correct language

Every known filetype which maps to the correct language are defined in ./lua/codestats-nvim/filetypes.lua in the mapped_filetypes variable.

To get the filetype of the current buffer see Getting the filetype of the current buffer.

Feel free to send a pull request to make your alias available to everyone else!

Beware: I won't merge pull request with wrong mappings. For example vimwiki maps the markdown to vimwiki (which is absolutely wrong)

Otherwise you have the possibility to remap existing languages in Code::Stats itself.

  1. Go to your preferences
  2. Click on Language aliases
  3. Follow the instructions on the page

The plugin sends XP where it shouldn't

All filetypes which should be ignored are defined in ./lua/codestats-nvim/filetypes.lua in the ignored_filetypes variable.

To get the filetype of the current buffer see Getting the filetype of the current buffer.

The plugin doesn't count deletions

Yes this is a serious thing. Currently I didn't found a nice way to detect deletions.

Sadly the autocmds don't offer an event way to detect single deletions.

codestats.nvim's People

Contributors

yannickfricke avatar vvarma avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.