irongit

A Neovim plugin enabling you to solve LeetCode problems.

94 lines1.8 KBLua
1---@alias lc.lang
2---| "cpp"
3---| "java"
4---| "python"
5---| "python3"
6---| "c"
7---| "csharp"
8---| "javascript"
9---| "typescript"
10---| "php"
11---| "swift"
12---| "kotlin"
13---| "dart"
14---| "golang"
15---| "ruby"
16---| "scala"
17---| "rust"
18---| "racket"
19---| "erlang"
20---| "elixir"
21---| "bash"
22---| "html"
23---| "pythonml"
24---| "react"
25---| "vanillajs"
26
27---@alias lc.hook
28---| "LeetEnter"
29---| "LeetQuestionNew"
30
31---@class lc.UserConfig
32local M = {
33 ---@type string
34 arg = "leetcode.nvim",
35
36 ---@type lc.lang
37 lang = "cpp",
38
39 cn = { -- leetcode.cn
40 enabled = false, ---@type boolean
41 translate_problems = true, ---@type boolean
42 translator = true, ---@type boolean
43 },
44
45 ---@type string
46 directory = vim.fn.stdpath("data") .. "/leetcode/",
47
48 ---@type boolean
49 logging = true,
50
51 cache = {
52 update_interval = 60 * 60 * 24 * 7, ---@type integer 7 days
53 },
54
55 console = {
56 open_on_runcode = true, ---@type boolean
57
58 dir = "row", ---@type "col" | "row"
59
60 size = {
61 width = "90%", ---@type string | integer
62 height = "75%", ---@type string | integer
63 },
64
65 result = {
66 size = "60%", ---@type string | integer
67 },
68
69 testcase = {
70 virt_text = true, ---@type boolean
71
72 size = "40%", ---@type string | integer
73 },
74 },
75
76 description = {
77 position = "left", ---@type "top" | "right" | "bottom" | "left"
78
79 width = "40%", ---@type string | integer
80 },
81
82 hooks = {
83 ---@type fun()[]
84 LeetEnter = {},
85
86 ---@type fun(question: { lang: string })[]
87 LeetQuestionNew = {},
88 },
89
90 ---@type boolean
91 image_support = false, -- setting this to `true` will disable question description wrap
92}
93
94return M