-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathtemplate.lua
137 lines (104 loc) · 2.66 KB
/
template.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---@alias lc.lang
---| "cpp"
---| "java"
---| "python"
---| "python3"
---| "c"
---| "csharp"
---| "javascript"
---| "typescript"
---| "php"
---| "swift"
---| "kotlin"
---| "dart"
---| "golang"
---| "ruby"
---| "scala"
---| "rust"
---| "racket"
---| "erlang"
---| "elixir"
---| "bash"
---@alias lc.hook
---| "enter"
---| "question_enter"
---| "leave"
---@alias lc.size
---| string
---| number
---| { width: string | number, height: string | number }
---@alias lc.position "top" | "right" | "bottom" | "left"
---@alias lc.direction "col" | "row"
---@alias lc.inject { before?: string|string[], after?: string|string[] }
---@alias lc.storage table<"cache"|"home", string>
---@alias lc.picker { provider?: "fzf-lua" | "telescope" }
---@class lc.UserConfig
local M = {
---@type string
arg = "leetcode.nvim",
---@type lc.lang
lang = "cpp",
cn = { -- leetcode.cn
enabled = false, ---@type boolean
translator = true, ---@type boolean
translate_problems = true, ---@type boolean
},
---@type lc.storage
storage = {
home = vim.fn.stdpath("data") .. "/leetcode",
cache = vim.fn.stdpath("cache") .. "/leetcode",
},
---@type table<string, boolean>
plugins = {
non_standalone = false,
},
---@type boolean
logging = true,
injector = {}, ---@type table<lc.lang, lc.inject>
cache = {
update_interval = 60 * 60 * 24 * 7, ---@type integer 7 days
},
console = {
open_on_runcode = true, ---@type boolean
dir = "row", ---@type lc.direction
size = { ---@type lc.size
width = "90%",
height = "75%",
},
result = {
size = "60%", ---@type lc.size
},
testcase = {
virt_text = true, ---@type boolean
size = "40%", ---@type lc.size
},
},
description = {
position = "left", ---@type lc.position
width = "40%", ---@type lc.size
show_stats = true, ---@type boolean
},
---@type lc.picker
picker = { provider = nil },
hooks = {
---@type fun()[]
["enter"] = {},
---@type fun(question: lc.ui.Question)[]
["question_enter"] = {},
---@type fun()[]
["leave"] = {},
},
keys = {
toggle = { "q" }, ---@type string|string[]
confirm = { "<CR>" }, ---@type string|string[]
reset_testcases = "r", ---@type string
use_testcase = "U", ---@type string
focus_testcases = "H", ---@type string
focus_result = "L", ---@type string
},
---@type lc.highlights
theme = {},
---@type boolean
image_support = false,
}
return M