-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathmind.lua
65 lines (57 loc) · 1.75 KB
/
mind.lua
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
local M = {}
M.config = function()
local status_ok, mnd = pcall(require, "mind")
if not status_ok then
return
end
local function sep_os_replacer(str)
local result = str
local path_sep = package.config:sub(1, 1)
result = result:gsub("/", path_sep)
return result
end
local join_path = require("lvim.utils").join_paths
mnd.setup {
persistence = {
state_path = sep_os_replacer(join_path(vim.fn.expand(lvim.builtin.mind.root_path), "/mind.json")),
data_dir = sep_os_replacer(join_path(vim.fn.expand(lvim.builtin.mind.root_path), "/data")),
},
ui = {
width = 40,
icon_preset = {
{ " ", "Sub-project" },
{ " ", "Journal, newspaper, weekly and daily news" },
{ " ", "For when you have an idea" },
{ " ", "Note taking?" },
{ " ", "Task management" },
{ " ", "Uncheck, empty square or backlog" },
{ " ", "Full square or on-going" },
{ " ", "Check or done" },
{ " ", "Trash bin, deleted, cancelled, etc." },
{ " ", "GitHub" },
{ " ", "Monitoring" },
{ " ", "Internet, Earth, everyone!" },
{ " ", "Frozen, on-hold" },
},
highlight = {
node_root = "Number",
},
},
keymaps = {
normal = {
T = function(args)
require("mind.ui").with_cursor(function(line)
local tree = args.get_tree()
local node = require("mind.node").get_node_by_line(tree, line)
if node.icon == nil or node.icon == " " then
node.icon = " "
end
args.save_tree()
require("mind.ui").rerender(tree, args.opts)
end)
end,
},
},
}
end
return M