Skip to content

A simple reading time, and word count plugin for neovim ❤️

License

Notifications You must be signed in to change notification settings

skwee357/nvim-prose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

nvim-prose

A simple plugin to display reading time and word count.

Installing

Using plug:

Plug 'skwee357/nvim-prose'

Usage

Call setup with the config you want to pass. The default config is shown below

require('nvim-prose').setup {
    wpm = 200.0,
    filetypes = { 'markdown', 'asciidoc' },
    placeholders = {
        words = 'words',
        minutes = 'min'
    }
}

After than, you can use nvim-prose in any location you want (e.g. your status line). It exposes 3 methods:

  • word_count() - return the number of words in the document
  • reading_time() - return the reading time (in minutes) of the current document
  • is_available() - returns whether nvim-prose is supported in the current filetype (based on filetypes provided in the config)

With lualine

If you use lualine, you can set up nvim-prose with it like this:

local prose = require 'nvim-prose'

require 'lualine'.setup {
    ...
    sections = {
        ...
        lualine_x = {
                { prose.word_count,   cond = prose.is_available },
                { prose.reading_time, cond = prose.is_available },
            },
    },
    ...
}

To do

  • [] Add support for lualine (via lualine extensions)
  • [] Generate proper docs

About

A simple reading time, and word count plugin for neovim ❤️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages