Add 'dots/' from commit 'f64b634dd8fbb2c8a2898c3b9d0acc9452e4d966'
git-subtree-dir: dots git-subtree-mainline:2ad98cde17git-subtree-split:f64b634dd8
This commit is contained in:
19
dots/.config/nvim/ftplugin/json.lua
Normal file
19
dots/.config/nvim/ftplugin/json.lua
Normal 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 })
|
||||
15
dots/.config/nvim/ftplugin/pandoc.lua
Normal file
15
dots/.config/nvim/ftplugin/pandoc.lua
Normal 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, {})
|
||||
Reference in New Issue
Block a user