Posted on :: Tags: , , , , ,

I believe in the value of reducing friction when taking notes. Today, I added a function to my Neovim configuration to create a timestamped file and open it for editing.

function CreateTimestampedFile()
  local zkdir = os.getenv("HOME") .. "/github.com/iesahin/garden/zk/"
  local timestamp = os.date("%Y%m%d%H%M%S")
  local filename = zkdir .. "/" .. timestamp .. ".md"
  vim.cmd("edit " .. filename)
end

vim.api.nvim_set_keymap("n", "<leader>F", ":lua CreateTimestampedFile()<CR>", { noremap = true, silent = true })

Now, I can just hit <leader>F (which is <Space>F in my setup) and immediately start adding a note to my zettelkasten.