blob: b61a4ee98fe544bef708340f16e93560dc9544c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
-- Wordcount in markdown
--
-- Credits
-- https://github.com/nvim-lualine/lualine.nvim/issues/328#issuecomment-982672253
-- https://github.com/skwee357/nvim-prose
local M = {}
function M.wordcount()
local wc = vim.fn.wordcount()
if not (wc.visual_words == nil) then
return tostring(wc.visual_words) .. " words"
end
return tostring(wc.words) .. " words"
end
function M.is_available()
if vim.bo.filetype == "markdown" then
return true
end
return false
end
return M
|