Skip to content

Display the count for every word in the current buffer.

License

Notifications You must be signed in to change notification settings

jajajasalu2/vim-count-words

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

vim-count-words

Display the count for every word in the current buffer.

Why?

I find it useful to:

  • Detect duplicate words and do what I want that info.
  • Get a gist of what a file/module is about.

Usage

vim-count-words provides the <Plug>CountWords mapping. Map it however you want to. Example:

map <leader>gc <Plug>CountWords

This binding works for both visual and normal modes.

Upon using the binding, you'll have to open the quickfix window to display the results, as so:

:copen

Settings

g:wordcount_threshold is used for setting a lower limit of the word count for a word to be displayed. By default it is 2. For example:

let g:wordcount_threshold = 2

g:wordcount_ignore_case is used for ignoring the case of the words. By default it is 1, i.e., the case is ignored. If 0, the case will not be ignored. For example:

let g:wordcount_ignore_case = 1

g:wordcount_descending_order is used for displaying the words in descending order. By default it is 0, i.e., ascending order. For example:

let g:wordcount_descending_order = 0

Installation

Use your favorite plugin manager. For vim-plug:

Plug 'jajajasalu2/vim-count-words'

TODO

  • Write test cases
  • Enable CI/CD
  • Take care of exception handling
  • Add a command, enable passing in user args to override default (g:) settings
  • Add an ignore words list setting?
  • Look into compatibility issues with Windows/Mac OS, resolve if any
  • Write help files to read from Vim

License

MIT

About

Display the count for every word in the current buffer.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published