Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dimfeld/section-wordcount.nvim
Neovim plugin to count words in each section of a document
https://github.com/dimfeld/section-wordcount.nvim
asciidoc markdown neovim neovim-plugin wordcount
Last synced: 22 days ago
JSON representation
Neovim plugin to count words in each section of a document
- Host: GitHub
- URL: https://github.com/dimfeld/section-wordcount.nvim
- Owner: dimfeld
- License: mit
- Created: 2023-03-09T07:38:30.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-03-18T18:44:06.000Z (over 1 year ago)
- Last Synced: 2024-10-07T07:06:58.642Z (about 1 month ago)
- Topics: asciidoc, markdown, neovim, neovim-plugin, wordcount
- Language: Lua
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# section-wordcount
This is a plugin for counting words in each section of a markdown or asciidoc file. It
is aware of header levels so, for example, the word count for a level 2 header will include
the words in all the level 3 and higher sections inside it.## Installation
Use any package manager.
For VimPlug:
```
Plug 'dimfeld/section-wordcount.nvim'
```## Usage
First the global setup function should be called to enable the plugin.
```lua
require('section-wordcount').setup{
-- These are the default values and can be omitted
highlight = "String",
virt_text_pos = "eol",
}
```For each file type that you want to enable, the `wordcounter` function can be called on the buffer
to enable it. The `header_char` option defaults to `'#'` for Markdown but can be customized for
other file formats:```vim
augroup SectionWordcount
au!
au FileType markdown lua require('section-wordcount').wordcounter{}
au FileType asciidoc lua require('section-wordcount').wordcounter{
\ header_char = '=',
\ }
augroup END
```