generated from 2KAbhishek/bare-minimum
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlualine.lua
More file actions
30 lines (28 loc) Β· 1.03 KB
/
lualine.lua
File metadata and controls
30 lines (28 loc) Β· 1.03 KB
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
28
29
30
local config = require('tdo.config').config
-- Only copy the tdo module and replace the calls to config with your own values for lazy loading
local tdo = {
function()
local update_frequency = config.lualine.update_frequency or 300
if not vim.g.tdo_last_update or (os.time() - vim.g.tdo_last_update) > update_frequency then
vim.g.tdo_last_update = os.time()
local result = vim.fn.system('tdo pending')
vim.g.tdo_count = tonumber(result:match('%d+')) or 0
end
return vim.g.tdo_count or 0
end,
icon = 'ο§ ',
color = { fg = '#8BCD5B', gui = 'bold' },
cond = function()
local show_everywhere = config.lualine.only_show_in_notes or false
if show_everywhere then
return true
end
local notes_dir = vim.env.NOTES_DIR
if not notes_dir then
return false
end
local current_file = vim.fn.expand('%:p')
return current_file:find(vim.fn.expand(notes_dir), 1, true) == 1
end,
}
return tdo