nvim: add word count
This commit is contained in:
@@ -72,6 +72,24 @@ return require('packer').startup(function(use)
|
||||
},
|
||||
lualine_c = { 'filename', require('nvim-navic').get_location },
|
||||
lualine_x = { 'lsp_progress', 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_y = {
|
||||
'progress',
|
||||
function()
|
||||
-- show wordcount in md and tex file
|
||||
-- show precise count when selecting
|
||||
if vim.bo.filetype == "md" or vim.bo.filetype == "tex" then
|
||||
if vim.fn.wordcount().visual_words == 1 then
|
||||
return tostring(vim.fn.wordcount().visual_words) .. " word"
|
||||
elseif not (vim.fn.wordcount().visual_words == nil) then
|
||||
return tostring(vim.fn.wordcount().visual_words) .. " words"
|
||||
else
|
||||
return tostring(vim.fn.wordcount().words) .. " words"
|
||||
end
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end
|
||||
},
|
||||
lualine_z = {
|
||||
'location',
|
||||
function()
|
||||
|
||||
@@ -4,7 +4,7 @@ opt.colorcolumn = "80" -- Colored column at 80c
|
||||
opt.cursorline = true -- Highlight entire current row
|
||||
opt.number = true -- Show line numbers
|
||||
opt.relativenumber = true -- Show relative line numbers from cursor
|
||||
opt.scrolloff = 12 -- Minimum lines at top and bottom
|
||||
opt.scrolloff = 5 -- Minimum lines at top and bottom
|
||||
opt.signcolumn = "yes" -- Show icons column at on the left side
|
||||
opt.swapfile = false -- Do not create a swapfile
|
||||
opt.smartindent = true -- Autoindent new lines
|
||||
|
||||
Reference in New Issue
Block a user