1
0
Fork 0
This commit is contained in:
Luca Bilke 2024-04-15 17:29:36 +02:00
parent 2339f35451
commit df30a0ba0a
2 changed files with 50 additions and 42 deletions

View File

@ -41,13 +41,6 @@ local autocmds = {
command = "silent!!xrdb %", command = "silent!!xrdb %",
}, },
}, },
{ -- Trigger asciidoctor-pdf
"BufWritePost",
{
pattern = { "*.adoc" },
command = "silent!!asciidoctor -r asciidoctor-pdf -r asciidoctor-diagram -b pdf % &",
},
},
} }
vim.api.nvim_create_augroup("user_config", { clear = true }) vim.api.nvim_create_augroup("user_config", { clear = true })

View File

@ -85,9 +85,11 @@ return {
}, },
config = function(_, opts) config = function(_, opts)
local key = Lib.get_secret("openai") local key = Lib.get_secret("openai")
if key then
require("chatgpt.api").OPENAI_API_KEY = key require("chatgpt.api").OPENAI_API_KEY = key
require("chatgpt.api").AUTHORIZATION_HEADER = "Authorization: Bearer " .. key require("chatgpt.api").AUTHORIZATION_HEADER = "Authorization: Bearer " .. key
require("chatgpt").setup(opts) require("chatgpt").setup(opts)
end
end, end,
--stylua: ignore --stylua: ignore
keys = { keys = {
@ -130,6 +132,9 @@ return {
border = { border = {
style = "single", style = "single",
}, },
win_options = {
winhighlight = "Normal:NormalFloat,FloatBorder:FloatBorder",
},
}, },
keymaps = { keymaps = {
close = "<C-c>", close = "<C-c>",
@ -270,7 +275,17 @@ return {
keys = { keys = {
{ "<leader>zn", function() require("zk.commands").get("ZkNew")({ title = vim.fn.input('Title: ') }) end, desc = "New Note", mode = { "n", "v" } }, { "<leader>zn", function() require("zk.commands").get("ZkNew")({ title = vim.fn.input('Title: ') }) end, desc = "New Note", mode = { "n", "v" } },
{ "<leader>znt", function() require("zk.commands").get("ZkNewFromTitleSelection")() end, desc = "Title from selection", mode = { "v" } }, { "<leader>znt", function() require("zk.commands").get("ZkNewFromTitleSelection")() end, desc = "Title from selection", mode = { "v" } },
{ "<leader>znc", function() require("zk.commands").get("ZkNewFromContentSelection")({ title = vim.fn.input('Title: ') }) end, desc = "Content from selection", mode = { "v" } }, {
"<leader>znc",
function()
require("zk.commands").get("ZkNewFromContentSelection")({
title = vim.fn.input(
'Title: ')
})
end,
desc = "Content from selection",
mode = { "v" }
},
{ "<leader>zb", function() require("zk.commands").get("ZkBacklinks")() end, desc = "Links" }, { "<leader>zb", function() require("zk.commands").get("ZkBacklinks")() end, desc = "Links" },
{ "<leader>zl", function() require("zk.commands").get("ZkLinks")() end, desc = "Backlinks" }, { "<leader>zl", function() require("zk.commands").get("ZkLinks")() end, desc = "Backlinks" },
{ "<leader>zx", function() require("zk.commands").get("ZkIndex")() end, desc = "Index" }, { "<leader>zx", function() require("zk.commands").get("ZkIndex")() end, desc = "Index" },