Add 'dots/' from commit 'f64b634dd8fbb2c8a2898c3b9d0acc9452e4d966'

git-subtree-dir: dots
git-subtree-mainline: 2ad98cde17
git-subtree-split: f64b634dd8
This commit is contained in:
2025-10-04 18:28:04 +02:00
232 changed files with 11175 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
local json_newline = function()
local line = vim.api.nvim_get_current_line()
if line == "" then
print("line is empty")
return "o"
elseif string.byte(line, -1) == string.byte(",") then
return "o"
elseif string.byte(line, -1) == string.byte("{") then
print("line ends with '{'")
return "o"
elseif string.byte(line, -1) == string.byte("}") then
print("line ends with '}'")
return "o"
else
return "A,<CR>"
end
end
vim.keymap.set("n", "o", json_newline, { buffer = true, expr = true })

View File

@@ -0,0 +1,15 @@
-- NOTE: May want to move this, as it is more specific to wiki than to pandoc
vim.api.nvim_create_user_command("AnkiDeck", function()
local handle = io.popen("get-anki-decks")
local decks = {}
for line in handle:lines() do
table.insert(decks, line)
end
handle:close()
vim.ui.select(decks, { prompt = "Select Anki deck" }, function(choice)
if choice then
vim.api.nvim_put({ choice }, "", true, true)
end
end)
end, {})