A custom picker for usememos.
Features:
- Create a new memo
- Search using
?filterapi - Update memo contents as if writing to a buffer
- Delete memo (unlink buffer)
Install with Lazy:
{
"wg-romank/telememos.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
config = true
}Setup environment variables for your instance.
export MEMOS_URL="https://memos.vpn"
export MEMOS_TOKEN="eyJhbGciOi....."Suggested keymaps:
vim.keymap.set('n', '<leader>mf', require('telememos').memos_picker, { desc = 'Find memo' })
vim.keymap.set('n', '<leader>ms', require('telememos').save_memo, { desc = 'Save memo' })
vim.keymap.set('n', '<leader>md', require('telememos').delete_memo, { desc = 'Delete memo' })Opening memo with <leader>mf will create autocmd for that buffer so it will be linked to memo on your instance. Saving buffer will trigger command to update contents on the instance.
You can also <leader>ms on any of your buffers, this will call POST endpoint on the instance and save its contents. default_state and default_visibility parameters will be used to set respective API fields. See section below how to override this behavior.
Any buffer bound with a memo can use <leader>md to delete memo from the instance and 'unlink' it.
Options to override:
debounce_ms- how long to wait for picker input before searchingmin_characters- how many characters to wait for before searchingdefault_visibility,default_state- as specified in create APIname_prefix- buffer name prefix, default is[M]to distinguish between files and buffers linked to memosmax_header_length- buffer name cap, name is generated from memo contents when you link buffers withsave_memocommanddefault_layout- your telescope picker layout configuration
To actually override options pass them as config parameter.
config = {
name_prefix = '[M]',
max_header_length = 20,
default_visibility = 'PUBLIC',
default_state = 'STATE_UNSPECIFIED',
debounce_ms = 250,
min_characters = 3,
default_layout = {
previewer = true,
layout_strategy = 'vertical',
layout_config = {
width = 0.8,
preview_cutoff = 0,
height = 0.8,
prompt_position = "top",
},
sorting_strategy = "ascending",
}
}- Open new buffer & save as memo as a single command
