blob: 3d28d3b69d7095095fc90b5656b9ea45db9a3de0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
require("simenandre.set")
require("simenandre.remap")
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.highlight.on_yank()`
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})
function open_daily_note()
local date = os.date("%Y-%m-%d")
local notes_dir = vim.fs.joinpath(vim.env.HOME, "ghq/github.com/simenandre/notes")
local file_path = vim.fs.joinpath(notes_dir, date .. ".md")
vim.cmd("edit " .. file_path)
end
-- Map the function to <leader>dn (for "daily note")
vim.keymap.set("n", "<leader>da", open_daily_note, { noremap = true, silent = true, desc = "Open daily note" })
|