Skip to content

Commit 78ad913

Browse files
🤖 automatedchrisgrieser
authored andcommitted
Office (nvim/my-plugins/)
1 parent 36cd242 commit 78ad913

12 files changed

Lines changed: 155 additions & 116 deletions

nvim/my-plugins/genghis.lua

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,3 @@ require("config.utils").pluginKeymaps {
3939
},
4040
{ "<leader>fN", function() require("genghis").createNewFile() end, desc = "󰝒 New" },
4141
}
42-
43-
--------------------------------------------------------------------------------

nvim/my-plugins/gitsigns.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require("gitsigns").setup {
1515
current_line_blame_formatter_nc = "+++ uncommitted",
1616
current_line_blame_opts = { delay = 500 },
1717
}
18+
1819
--------------------------------------------------------------------------------
1920

2021
require("config.utils").pluginKeymaps {

nvim/my-plugins/leetcode.lua

Lines changed: 0 additions & 12 deletions
This file was deleted.

nvim/my-plugins/leetcode.lua-bkp

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-- DOCS Get cookie https://github.com/kawre/leetcode.nvim#sign-in
2+
-- 1. Login at https://leetcode.com/
3+
-- 2. DevTools -> Network -> Search for `graphql` -> reload site if needed
4+
-- 3. Under `Set-Cookie`, copy the `csrftoken` and `LEETCODE_SESSION` cookies,
5+
-- keep the prefix, join them with `;`, and ensure no trailing line break:
6+
-- -> should be: `csrftoken=…;LEETCODE_SESSION=…`
7+
--------------------------------------------------------------------------------
8+
vim.pack.add {
9+
"https://github.com/nvim-lua/plenary.nvim",
10+
"https://github.com/MunifTanjim/nui.nvim",
11+
"https://github.com/kawre/leetcode.nvim",
12+
}
13+
--------------------------------------------------------------------------------
14+
15+
-- https://github.com/kawre/leetcode.nvim#-commands
16+
vim.g.whichkeyAddSpec { "<leader>x", group = "󰹂 Leetcode" }
17+
require("config.utils").pluginKeymaps {
18+
{ "<leader>xx", "<cmd>Leet run<CR>", { desc = " Run" } },
19+
{ "<leader>xx", "<cmd>Leet run<CR>", { desc = " Run" } },
20+
{ "<leader>xd", "<cmd>Leet desc<CR>", { desc = " Toggle problem desc" } },
21+
{ "<leader>xs", "<cmd>Leet submit<CR>", { desc = " Submit" } },
22+
{ "<leader>xo", "<cmd>Leet open<CR>", { desc = "󰖟 Open in browser" } },
23+
{ "<leader>xh", "<cmd>Leet info<CR>", { desc = " Hints" } },
24+
{ "<leader>xm", "<cmd>Leet menu<CR>", { desc = "󰹯 Leetcode menu" } },
25+
{ "<leader>xp", "<cmd>Leet list difficulty=easy<CR>", { desc = " Problem list (easy)" } },
26+
-- stylua: ignore
27+
{"<leader>xr", "<cmd>Leet random difficulty=easy<CR>", { desc = " Random problem (easy)" }},
28+
{ "<leader>xa", "<cmd>Leet list status=ac<CR>", { desc = " Accepted problem" } },
29+
}
30+
31+
--------------------------------------------------------------------------------
32+
33+
require("leetcode").setup {
34+
lang = "typescript", -- https://github.com/kawre/leetcode.nvim#lang
35+
storage = {
36+
home = vim.g.iCloudSync .. "/leetcode",
37+
},
38+
description = {
39+
position = "left",
40+
width = "40%",
41+
},
42+
}
Lines changed: 107 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,120 @@
1-
vim.pack.add { "https://github.com/MeanderingProgrammer/render-markdown.nvim" }
2-
--------------------------------------------------------------------------------
3-
4-
require("config.utils").pluginKeymaps {
5-
1+
vim.pack.add {
2+
"https://github.com/echasnovski/mini.icons",
3+
"https://github.com/MeanderingProgrammer/render-markdown.nvim",
64
}
7-
85
--------------------------------------------------------------------------------
96

7+
vim.api.nvim_create_autocmd("FileType", {
8+
pattern = "markdown",
9+
callback = function(ctx)
10+
vim.keymap.set(
11+
"n",
12+
"<leader>oc",
13+
function() require("render-markdown").toggle() end,
14+
{ desc = " Markdown render", buffer = ctx.buf }
15+
)
16+
end,
17+
})
18+
1019
require("render-markdown").setup {
11-
quote = {
12-
repeat_linebreak = true, -- full border on soft-wrap
13-
},
14-
html = {
15-
comment = {
16-
text = function(ctx)
17-
local text = ctx.text:match("^<!%-%-%s*(.-)%s*%-%->$")
18-
if not text then return "" end
19-
return "󰆈 " .. text:gsub("\n.*", " ↓↓↓")
20-
end,
20+
quote = {
21+
repeat_linebreak = true, -- full border on soft-wrap
22+
},
23+
html = {
24+
comment = {
25+
text = function(ctx)
26+
local text = ctx.text:match("^<!%-%-%s*(.-)%s*%-%->$")
27+
if not text then return "" end
28+
return "󰆈 " .. text:gsub("\n.*", " ↓↓↓")
29+
end,
30+
},
31+
},
32+
pipe_table = {
33+
border_enabled = true,
34+
border_virtual = true, -- borders not on empty lines -> preserves blank lines
2135
},
22-
},
23-
pipe_table = {
24-
border_enabled = true,
25-
border_virtual = true, -- borders not on empty lines -> preserves blank lines
26-
},
27-
heading = {
28-
position = "inline", -- = remove indentation of headings
29-
width = "block", -- = not full width
30-
min_width = vim.o.textwidth,
31-
icons = { "󰎤 ", "󰎧 ", "󰎪 ", "󰎭 ", "󰎱 ", "󰎳 " }, -- `numeric_x` glyphs
32-
-- icons = { "󰲠 ", "󰲢 ", "󰲤 ", "󰲦 ", "󰲨 ", "󰲪 " },
33-
},
34-
dash = {
35-
width = vim.o.textwidth,
36-
priority = 10, -- don't cover codelens from `markdown-oxide` for 1st line of frontmatter
37-
},
38-
bullet = {
39-
icons = { "", "▪️", "▫️" }, -- ◆◇•◦▫️▪️
40-
ordered_icons = "", -- disable overwriting ordered list numbers with 1-2-3
41-
},
42-
checkbox = {
43-
checked = { icon = "󰄵" },
44-
unchecked = { icon = "󰄱" },
45-
custom = {
46-
todo = { rendered = "󰡖", raw = "[-]", highlight = "RenderMarkdownInfo" },
36+
heading = {
37+
position = "inline", -- = remove indentation of headings
38+
width = "block", -- = not full width
39+
min_width = vim.o.textwidth,
40+
icons = { "󰎤 ", "󰎧 ", "󰎪 ", "󰎭 ", "󰎱 ", "󰎳 " }, -- `numeric_x` glyphs
41+
-- icons = { "󰲠 ", "󰲢 ", "󰲤 ", "󰲦 ", "󰲨 ", "󰲪 " },
4742
},
48-
},
49-
code = {
50-
position = "left",
51-
width = "block", -- = not full width
52-
min_width = 50,
53-
left_pad = 0, -- better `0` due to uneven padding https://github.com/MeanderingProgrammer/render-markdown.nvim/issues/576#issuecomment-3694595069
54-
right_pad = 1,
55-
border = "thin", -- use the `above`/`below` chars as is
56-
below = "", -- ▀▔
57-
above = "", -- ▃▁
58-
language_border = "",
59-
language_left = "▁▁█",
60-
language_right = "█",
61-
highlight_border = "PmenuThumb",
62-
},
63-
link = {
64-
-- no icon for internal links, since distinguished via color in
65-
-- `query/markdown_inline/highlights.scm`
66-
hyperlink = "",
67-
wiki = { icon = "" },
68-
email = "󰇮 ",
69-
footnote = { icon = "", superscript = false },
43+
dash = {
44+
width = vim.o.textwidth,
45+
priority = 10, -- don't cover codelens from `markdown-oxide` for 1st line of frontmatter
46+
},
47+
bullet = {
48+
icons = { "", "▪️", "▫️" }, -- ◆◇•◦▫️▪️
49+
ordered_icons = "", -- disable overwriting ordered list numbers with 1-2-3
50+
},
51+
checkbox = {
52+
checked = { icon = "󰄵" },
53+
unchecked = { icon = "󰄱" },
54+
custom = {
55+
todo = { rendered = "󰡖", raw = "[-]", highlight = "RenderMarkdownInfo" },
56+
},
57+
},
58+
code = {
59+
position = "left",
60+
width = "block", -- = not full width
61+
min_width = 50,
62+
left_pad = 0, -- better `0` due to uneven padding https://github.com/MeanderingProgrammer/render-markdown.nvim/issues/576#issuecomment-3694595069
63+
right_pad = 1,
64+
border = "thin", -- use the `above`/`below` chars as is
65+
below = "", -- ▀▔
66+
above = "", -- ▃▁
67+
language_border = "",
68+
language_left = "▁▁█",
69+
language_right = "█",
70+
highlight_border = "PmenuThumb",
71+
},
72+
link = {
73+
-- no icon for internal links, since distinguished via color in
74+
-- `query/markdown_inline/highlights.scm`
75+
hyperlink = "",
76+
wiki = { icon = "" },
77+
email = "󰇮 ",
78+
footnote = { icon = "", superscript = false },
79+
80+
custom = {
81+
web = { icon = "" }, -- for links that do not match a pattern below
7082

71-
custom = {
72-
web = { icon = "" }, -- for links that do not match a pattern below
83+
-- news sites
84+
medium = { pattern = "medium%.com", icon = "󰬔 " }, -- letter-glyphs are named `alpha_…`
85+
verge = { pattern = "theverge%.com", icon = "󰰫 " },
86+
techcrunch = { pattern = "techcrunch%.com", icon = "󰬛󰬊 " },
87+
wired = { pattern = "wired%.com", icon = "󰬞 " },
88+
nytimes = { pattern = "nytimes%.com", icon = "󰬕󰬠 " },
89+
bloomberg = { pattern = "bloomberg%.com", icon = "󰯯 " },
90+
guardian = { pattern = "theguardian%.com", icon = "󰯾 " },
91+
zeit = { pattern = "zeit%.de", icon = "󰬡 " },
92+
spiegel = { pattern = "spiegel%.de", icon = "󰬚 " },
93+
tagesschau = { pattern = "tagesschau%.de", icon = "󰰥 " },
7394

74-
-- news sites
75-
medium = { pattern = "medium%.com", icon = "󰬔 " }, -- letter-glyphs are named `alpha_…`
76-
verge = { pattern = "theverge%.com", icon = "󰰫 " },
77-
techcrunch = { pattern = "techcrunch%.com", icon = "󰬛󰬊 " },
78-
wired = { pattern = "wired%.com", icon = "󰬞 " },
79-
nytimes = { pattern = "nytimes%.com", icon = "󰬕󰬠 " },
80-
bloomberg = { pattern = "bloomberg%.com", icon = "󰯯 " },
81-
guardian = { pattern = "theguardian%.com", icon = "󰯾 " },
82-
zeit = { pattern = "zeit%.de", icon = "󰬡 " },
83-
spiegel = { pattern = "spiegel%.de", icon = "󰬚 " },
84-
tagesschau = { pattern = "tagesschau%.de", icon = "󰰥 " },
95+
-- misc
96+
openai = { pattern = "openai%.com", icon = "" },
97+
doi = { pattern = "doi%.org", icon = "󰑴 " },
98+
mastodon = { pattern = "%.social/@", icon = "" },
99+
researchgate = { pattern = "researchgate%.net", icon = "󰙨 " },
100+
my_website = { pattern = "chris%-grieser.de", icon = "" },
101+
},
102+
},
103+
--------------------------------------------------------------------------
104+
sign = { enabled = false },
105+
render_modes = { "n", "c", "i", "v", "V" },
106+
win_options = {
107+
-- makes toggling this plugin also toggle conceallevel
108+
conceallevel = { default = 0 },
85109

86-
-- misc
87-
openai = { pattern = "openai%.com", icon = "" },
88-
doi = { pattern = "doi%.org", icon = "󰑴 " },
89-
mastodon = { pattern = "%.social/@", icon = "" },
90-
researchgate = { pattern = "researchgate%.net", icon = "󰙨 " },
91-
my_website = { pattern = "chris%-grieser.de", icon = "" },
110+
-- disabled on render, since heading width already indicates it
111+
colorcolumn = { default = vim.o.colorcolumn, rendered = "" },
92112
},
93-
},
94-
--------------------------------------------------------------------------
95-
sign = { enabled = false },
96-
render_modes = { "n", "c", "i", "v", "V" },
97-
win_options = {
98-
conceallevel = { default = 0 }, -- makes toggling this plugin also toggle conceallevel
99-
colorcolumn = { default = vim.o.colorcolumn, rendered = "" }, -- disabled on render, since heading width already indicates it
100-
},
101-
overrides = { -- LSP hovers: hide code block lines
102-
buftype = {
103-
nofile = {
104-
code = { border = "hide", style = "normal" },
113+
overrides = { -- LSP hovers: hide code block lines
114+
buftype = {
115+
nofile = {
116+
code = { border = "hide", style = "normal" },
117+
},
105118
},
106119
},
107-
},
108120
}

nvim/my-plugins/satellite.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
vim.pack.add { "https://github.com/lewis6991/satellite.nvim" }
22
--------------------------------------------------------------------------------
33

4-
require("satellite.nvim").setup {
4+
require("satellite").setup {
55
current_only = false,
66
winblend = 25, -- only little transparency, since otherwise hard to see in some themes
77
handlers = {

nvim/my-plugins/snacks.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ require("config.utils").pluginKeymaps {
77

88
--------------------------------------------------------------------------------
99

10-
require("snacks.nvim").setup {
10+
require("snacks").setup {
1111

1212
}

nvim/my-plugins/surround.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ require("config.utils").pluginKeymaps {
77

88
--------------------------------------------------------------------------------
99

10-
require("nvim-surround").setup {
10+
require("surround").setup {
1111

1212
}

0 commit comments

Comments
 (0)