From 5c8368d57cacd1c26df38b88ea7da9a2d3ad24b1 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Mon, 1 Nov 2021 01:41:55 +0300 Subject: nvim: add tex wordcount (but dont use) --- .config/nvim/lua/plugin_settings.lua | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to '.config/nvim') diff --git a/.config/nvim/lua/plugin_settings.lua b/.config/nvim/lua/plugin_settings.lua index ec23325..4bc7081 100644 --- a/.config/nvim/lua/plugin_settings.lua +++ b/.config/nvim/lua/plugin_settings.lua @@ -38,14 +38,21 @@ local function lualine_spell() end end -local function lualine_spell_cond() - if vim.wo.spell then - return true - else - return false - end +-- Grinds vim to a halt +local function lualine_tex_wordcount() + return vim.fn['vimtex#misc#wordcount']() .. " ‽" end +local conditions = { + spell_on = function () + return vim.wo.spell + end, + filetype_is_tex = function() + return vim.bo.filetype == "tex" + end +} + + require'lualine'.setup { options = { icons_enabled = true, @@ -57,7 +64,7 @@ require'lualine'.setup { lualine_a = {{'mode', fmt = string.lower}}, lualine_b = {'branch', 'diff', { lualine_spell, - cond = lualine_spell_cond + cond = conditions.spell_on, }}, lualine_c = {'filename'}, lualine_x = {'encoding', 'fileformat', 'filetype'}, -- cgit v1.2.3-70-g09d2