A plugin for quickly creating timestamped journal entries in from neovim.
I just wanted a way of quickly creating tiny timestamped journal entries in a datestamped file. This is designed to work with Obsidian daily note.
Use whatever package manager you like.
If you're using plug
:
Plug 'nvim-lua/plenary.nvim'
Plug 'rohanorton/mytime.nvim'
Or, my personal favourite, packer
:
use({
"rohanorton/mytime.nvim",
requires = { "nvim-lua/plenary.nvim" }
})
You will need to call the setup:
local mytime = require('mytime')
mytime.setup({
-- REQUIRED: you must specify directory that files are save to
directory = "/path/to/the/directory/you/want/files/created/in",
-- Defaults:
ui_height = 1,
ui_width = 60,
})
Suggested keybindings:
noremap <silent> <leader>ll <Plug>mytime-add-log
noremap <silent> <leader>lr <Plug>mytime-read-log
Opens a prompt for you journal entry.
The entry is appended to a today's log file, alongside a timestamp, on enter.
Cancelled on click outside, "q" in normal mode
Can be invoked directly using lua:
require('mytime').add_log()
Or it can be assigned a keybinding:
noremap <silent> <leader>ll <Plug>mytime-add-log
Prints the content of today's log file.
require('mytime').read_log()
Or it can be assigned a keybinding:
noremap <silent> <leader>lr <Plug>mytime-read-log
Open the log file for manual editing
require('mytime').edit_log()
Or it can be assigned a keybinding:
noremap <silent> <leader>le <Plug>mytime-edit-log