You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And here is how you can register a user command and mapping for it:
---Helper to register a keymap and a command of the given lua function---@paramfuncfunction the function to register---@paramkeystring the keymap to register---@paramcmd_namestring the name of the command to registerlocalfunctionregister_keymap_and_command(func, key, cmd_name)
vim.api.nvim_create_user_command(cmd_name, func, {})
vim.api.nvim_set_keymap("n", key, "", {
noremap=true,
silent=true,
callback=func,
desc=cmd_name,
})
endregister_keymap_and_command(ObsidianRandomNote, "<leader>nr", "ObsidianRandomNote")
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Feeling bored? Want to read something that you wrote a long time ago (and probably forgot)? Use
ObsidianRandomNote
.And here is how you can register a user command and mapping for it:
Beta Was this translation helpful? Give feedback.
All reactions